From: Daniel E. <nuc...@gm...> - 2011-05-18 15:34:53
|
Hi all, I am attempting to plot a series of train times on a graph, with time on the x-axis, and location on the y-axis. The plot works fine for trains travelling through all the locations listed, but GNUPlot doesn't like trains which start at an intermediate location, or trains where there is only a passing time, rather than an arrival/departure time. Also, is there a way to class the Y axis by labels, rather than by numbers? I've currently had to throw in the "Stn No" column to get it to work. My plotting code is: set title "Timetable D" set style data lines set xlabel "Time" set timefmt "%H:%M" set xdata time set xrange ["08:00":"20:00"] set format x "%H:%M" set ylabel "Location" set grid set key left plot for [i=3:4] 'SVRTableD.dat' using i:2:yticlabels(1) title column(i) A couple of lines of example data are: Station Stn No 1055 BH 1000 BY KR 1 12:05 BY 2 11:54 BY 2 11:51 10:00 AY 3 11:38 AY 3 11:35 10:12 HY 4 11:27 HY 4 11:24 10:19 HL 5 11:16 10:26 HL 5 11:10 10:31 BH 6 10:55 10:46 The 1055 BH plots correctly, however, the 1000 BY line starts itself at KR, as well as giving strange results for stations where there is no arrival time (the train does not stop at a number of locations). The latter could be fixed by putting in dummy arrival times that are the same as the departure one, but I'd rather not have to edit all my data to do that! Regards, Daniel |