【发布时间】:2020-01-23 20:51:31
【问题描述】:
我有一个输入文件 E3,其数据排列如下:
01/01/2020 00:00 15 0 39
01/01/2020 00:01 3 4 64
01/01/2020 00:02 0 24 9
...
01/07/2020 11:53 13 0 0
01/07/2020 11:54 19 2 20
01/07/2020 11:55 2 0 2
我正在尝试使用以下代码来绘制它:
set terminal x11 size 1900, 800
set term x11 1 noraise
set grid
set xlabel font "Times Roman, 22"
set xlabel "Date\nTime"
set xdata time
set timefmt "%m/%d/%Y %H:%M"
set xrange [ "01/01/2020 00:00" : "01/07/2020 11:55" ]
set format x "%m/%d\n%H:%M"
set xtics time
set y2label font "Times Roman, 22"
set y2label "Events"
set ytics 10
set y2tics 10
set key left top
plot './E3' using 0:3 with lines title "Delete" ls 15, './E3' using 0:4 with lines title "Failed" ls 4, './E3' using 0:5 with lines title "Update" ls 6
pause -1
当我尝试让 gnuplot 运行上述程序时,它返回以下错误:
plot './E3' using 0:3 with lines title "Delete" ls 15, './E3' using 0:4 with lines title "Failed" ls 4, './E3' using 0:5 with lines title "Update" ls 6
^
"enum.gnu.1", line 18: all points y value undefined!
注释掉集合 xrange 可以消除错误。但是,在图中,x 轴上的抽动是 01/01\n00:00, 01/01\n00:15, ... 01:01\n02:45 - 这不是我想要的。我想要的是每天都有一个 x tic - 对应于 1440 个数据点 - 每个 tic 都标有日期和时间。 IE。 01/01\n00:00, 01/02\n00:00, ... 01/07\n00:00.
我做错了什么?
【问题讨论】:
标签: gnuplot