Time / date handling in gnuplot 5

I have the following dataset

0   22/01   5:40.416    07/01   5:59.149
1   29/01   5:49.765    14/01   5:59.036
2   05/02   5:45.675    21/01   5:52.160
3   12/02   5:44.241    28/01   5:55.160
4   19/02   5:49.330    04/02   5:44.065
5   26/02   5:48.044    11/02   5:34.803

and I want to build column 3 as function 2 (and also 5 as function 4, but that is not a problem). The format is day / month and minutes: seconds .xxx.

In gnuplot 4.6, it was somewhat simple to specify how to read both columns, specifying different time formats for x and y. Minimum script that worked:

set xdata time
set timefmt x "%d/%m"
set format x "%b"

set ydata time
set timefmt y "%M:%S"
set format y "%M:%S"

plot 'data.dat' using 2:3

I recently upgraded to gnuplot 5, and the command set timefmt x "%d/%m"(and its equivalent y) now throws an error. It looks like you can no longer put xor y, and you can only use one timefmtfor the entire script.

release notes state that

set {xy}tics time, set {xy}data time. , set xdata time set timefmt x , . , .

. -, , " ", set timefmt x "%d/%m". -, , , gnuplot x y .

. 2011 , , .

+4
1

, , . , , , , . , , . , x y.

, , . timecolumn(N,"timeformat"), :

set xtics time
set format x "%b"

set ytics time
set format y "%M:%S"

plot 'data.dat' using (timecolumn(2, "%d/%m")):(timecolumn(3, "%M:%S"))

set timefmt timefunction(), using. () timecolumn(). , ( ) . 5.0:

unix 1--1970. gnuplot (1 2000 ). , , . , gnuplot, print strftime("%F",0). .

set xtics time. xtics , , , , timecolumn(). , , , , .

+4

Source: https://habr.com/ru/post/1664795/


All Articles