I want to add an offset to the time-based data from a file which I want to plot using gnuplot. I can plot the data just fine, but when I try to add a time-based offset the graph is empty.
The purpose is to plot multiple bars next to each other, like described here, but with time-based data: Two plots "with boxes" next to each other with gnuplot
Data file:
00:00 7719
01:00 20957
02:00 15989
03:00 9711
04:00 1782
05:00 871
06:00 4820
07:00 860
08:00 873
09:00 848
10:00 879
11:00 726
12:00 944
13:00 924
14:00 996
15:00 806
16:00 848
17:00 967
18:00 2277
19:00 2668
20:00 32183
21:00 14414
22:00 20426
23:00 16140
I am trying to plot the data using this code:
set xdata time
set timefmt "%H:%S"
set format x "%H"
set style fill solid 0.6 border -1
set boxwidth 0.3 relative
plot ["00:00":"23:30"] 'data.dat' using ($1-0.3):2 with boxes, \
'data.dat' using ($1+0.3):2 with boxes
This is only a test - the real data file has additional data columns, and I am trying to place the boxes next to each other using offset, however I'm having no luck with time-based data and offsets.
Without offset the code is fine:
set xdata time
set timefmt "%H:%S"
set format x "%H"
set style fill solid 0.6 border -1
set boxwidth 0.3 relative
plot ["00:00":"23:30"] 'data.dat' using 1:2 with boxes