I would like to plot this kind of data:
The data would looks like that:
22/02 51:10
25/02 63:10
01/03 50:55
23/03 52:10
I already done that for the X axis:
set xdata time
set timefmt "%d/%m"
But I don't know how to manage Y axis.
As Tom said, you can only use one timefmt. However, if it is possible to split your data to more columns like this:
22/02 51 10
25/02 63 10
01/03 50 55
23/03 52 10
you can then plot the time length by direct calculation, like this:
plot 'file' u 1:($2 + $3/60)
to plot minutes, or like this:
plot 'file' u 1:($2/60 + $3/3600)
to plot hours.
From ?xdata
There is currently only one timefmt, which implies that all the time/date columns must conform to this format.
So you need to alter your data somewhat to conform to one setting.
something like
00:00:22/02 51:10:22/02
00:00:25/02 63:10:22/02
00:00:01/03 50:55:22/02
00:00:23/03 52:10:22/02
Note that you can use command line tools to do this within gnuplot, see here
Once the file is edited you can read it like so
set xdata time
set ydata time
set timefmt "%M:%S:%d/%m"
set format x "%d/%m"
set format y "%M:%S"
plot "date_time.dat" u 1:2 w l
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With