From: <gp...@bl...> - 2013-12-09 20:31:22
|
Hi All, I am having problems getting what I want. I would like to have 3 (or more) groups of bars, each in their own colour. Each group shows the same points over time. I don't want to mix them in the normal way. Ideally I would like to have the points in each group numbered 1,2,etc and the groups with colours in a key. However, that didn't seem possible. Here is my example data file: Time1;15;11;12;13;11;10;10;11;15;11;12 Time2;8;9;8;7;8;10;11;8;9;12;13 Time3;4;5;6;4;3;4;5;6;7;2;3 When I use this code (I get more or less what I want but not in different colours): set auto x set yrange [0:16] set ylabel 'Number' set xlabel 'Group' set style data histogram set style histogram cluster gap 5 set style fill solid border rgb "black" unset key set datafile separator ";" plot \ 'data.dat' using 2:xtic(1) ls 1, \ 'data.dat' using 3:xtic(1) ls 1, \ 'data.dat' using 4:xtic(1) ls 1, \ 'data.dat' using 5:xtic(1) ls 1, \ 'data.dat' using 6:xtic(1) ls 1, \ 'data.dat' using 7:xtic(1) ls 1, \ 'data.dat' using 8:xtic(1) ls 1, \ 'data.dat' using 9:xtic(1) ls 1, \ 'data.dat' using 10:xtic(1) ls 1, \ 'data.dat' using 11:xtic(1) ls 1, \ 'data.dat' using 12:xtic(1) ls 1 So I tried this: set auto x set yrange [0:16] set ylabel 'Number' set xlabel 'Group' set style data histogram set style histogram cluster gap 5 set style fill solid border rgb "black" unset key set datafile separator ";" set style line 1 lc rgb 'blue' set style line 2 lc rgb 'green' set style line 3 lc rgb 'yellow' plot \ 'data.dat' every ::0::0 using 2:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 3:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 4:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 5:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 6:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 7:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 8:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 9:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 10:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 11:xtic(1) ls 1, \ 'data.dat' every ::0::0 using 12:xtic(1) ls 1, \ 'data.dat' every ::1::1 using 2:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 3:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 4:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 5:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 6:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 7:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 8:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 9:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 10:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 11:xtic(1) ls 2, \ 'data.dat' every ::1::1 using 12:xtic(1) ls 2, \ 'data.dat' every ::2::2 using 2:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 3:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 4:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 5:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 6:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 7:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 8:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 9:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 10:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 11:xtic(1) ls 3, \ 'data.dat' every ::2::2 using 12:xtic(1) ls 3 Which gives me the colours, but the group names are gone and the groups are no longer separated? Is there an easier way to get what I want? It is not problem to re-organise the data file. Thanks in advance, J. |