I can\'t seem to get gnuplot to properly plot my time data. (I\'m using version 4.6, patchlevel 3.)
For an MWE (well, non-working...), the input file
With $1
you explicitely select the numerical value of the first column, which bypasses any gnuplot automatism to interpret the column values as appropriate (as time value in your case). Simply use using 1:2
:
reset
set xdata time
set timefmt "%H:%M:%S"
set format x "%H:%M:%S"
plot '-' using 1:2 with lines lw 3
15:36:12 1.0
15:43:17 3.0
16:12:02 2.0
e
Use the syntax $1
only when doing calculations with the actual numerical value in the respective column. $1
is a shortcut for column(1)
, gnuplot also knows stringcolumn(1)
and timecolumn(1)
for other purposes.