I have data in the following format in a text file. I want to print the time (hours, mins and secs) on the x-axis. Each timestamp is on a separate line
00:00:05,1
00:00:15,0
01:05:23,1
07:45:00,0
23:21:22,1
Trying the following commands with gnuplot but time isn't printed on x-axis. I would like the time displayed in hours.
set datafile separator ","
set xdata time
set xrange["00:00:00":"24:00:00"]
set timefmt '%H:%M:%S
plot 'data.txt' using 1:2 with boxes
Any help greatly appreciated.
The
set timefmt
settings are used only for reading the data file. If you don't provide an explicit output format, timedate is assumed automatically. Useset xtics format '%H:%M:%S'
to set an explicit output format. Also, parsing of theset xrange
strings can be done properly only after you have set the time format: