Gnuplot - 开始日期和时间 + 增加的分钟数
Gnuplot - start date and time + incremented minutes
我有一个关于 Gnuplot 的问题 - 我的测量设备记录开始日期和时间(例如 15.09.2020 15:09:00 格式可以更改),每 60 分钟进行一次测量。我不知道结束时间。我应该如何做 x 轴,以便轴抽动是“day.month”?
我知道,那个温度记录器启动了:
2020 年 9 月 15 日 15:09:00
datafile.csv 包含:
minutes;temperature
0;12.8829
60;4.5346
120;4.5417
180;4.5454
240;4.5394
请记住,在 gnuplot 中,时间和日期被处理为从 1970 年 1 月 1 日开始的秒数 00:00:00。
在 gnuplot 控制台中检查 help strptime
、help format
。尝试以下操作:
代码:
### convert relative time into absolute time
reset session
$Data <<EOD
minutes;temperature
0;12.8829
60;4.5346
120;4.5417
180;4.5454
240;4.5394
1440;2.22
2880;1.11
10000;0.00
EOD
set datafile separator ";"
Startdate = strptime("%d.%m.%Y %H:%M:%S","15.09.2020 15:09:00")
myTime(col) = Startdate + column(col)*60
set format x "%d.%m." timedate
plot $Data u (myTime(1)):2 w lp pt 7
### end of code
结果:
我有一个关于 Gnuplot 的问题 - 我的测量设备记录开始日期和时间(例如 15.09.2020 15:09:00 格式可以更改),每 60 分钟进行一次测量。我不知道结束时间。我应该如何做 x 轴,以便轴抽动是“day.month”?
我知道,那个温度记录器启动了: 2020 年 9 月 15 日 15:09:00
datafile.csv 包含:
minutes;temperature
0;12.8829
60;4.5346
120;4.5417
180;4.5454
240;4.5394
请记住,在 gnuplot 中,时间和日期被处理为从 1970 年 1 月 1 日开始的秒数 00:00:00。
在 gnuplot 控制台中检查 help strptime
、help format
。尝试以下操作:
代码:
### convert relative time into absolute time
reset session
$Data <<EOD
minutes;temperature
0;12.8829
60;4.5346
120;4.5417
180;4.5454
240;4.5394
1440;2.22
2880;1.11
10000;0.00
EOD
set datafile separator ";"
Startdate = strptime("%d.%m.%Y %H:%M:%S","15.09.2020 15:09:00")
myTime(col) = Startdate + column(col)*60
set format x "%d.%m." timedate
plot $Data u (myTime(1)):2 w lp pt 7
### end of code
结果: