我在绘制看起来像这样的数据集时遇到了一些麻烦:
2250,2011-07-05 02:00:00.0,null,4,0,0,24,0,626,2250,abc
2250,2011-07-05 04:00:00.0,null,2,0,0,24,0,302,2250,abc
2250,2011-07-05 03:00:00.0,null,9,0,0,24,0,687,2250,abc
2250,2011-07-03 03:00:00.0,null,4,0,0,24,0,423,2250,abc
2250,2011-07-02 05:00:00.0,null,3,0,0,24,0,1525,2250,abc
2250,2011-07-02 04:00:00.0,null,4,0,0,24,0,636,2250,abc
2250,2011-07-11 04:00:00.0,null,1,0,0,24,0,33,2250,abc
2250,2011-07-02 03:00:00.0,null,2,0,0,24,0,495,2250,abc
我正在使用这种gnuplot脚本:
set datafile separator ","
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S.0"
set xrange ["2011-06-29 01:00:00.0":"2011-07-11 04:00:00.0"]
set xtics border in scale 1,0.5 nomirror rotate by -45 offset character 0, 0, 0
plot "input.csv" using 1:8 title "total times" with linespoints
我一直收到错误:
all points y value undefined!
根据docs意味着我的情节定义没有产生任何分数。然而,通过手工分析,它看起来不合理 - xrange看起来没问题,情节列也不是空的。
有什么想法吗?
答案 0 :(得分:3)
使用此脚本,您尝试将第一列绘制为x轴,将第八列绘制为y轴。在指定set xdata time
时,x轴的数据类型设置为时间/日期
不幸的是,您的第一列不是日期和时间类型。尝试
plot "input.csv" using 2:8 title "total times" with linespoints
并且脚本将完美运行 (至少它在我的机器上^^)。