Gnuplot 绘制一些与日期相关的记录

Gnuplot 绘制一些与日期相关的记录,gnuplot,Gnuplot,我在绘制数据集时遇到一些问题,如下所示: 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

我在绘制数据集时遇到一些问题,如下所示:

  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!
根据文档,这意味着我的绘图定义没有生成任何点。然而,通过手工分析,它看起来不合理——xrange看起来正常,绘图列也不为空


有什么想法吗?

使用此脚本,您可以尝试将第一列绘制为x轴,第八列绘制为y轴。使用
set xdata time
指定x轴的数据类型设置为time/date。
不幸的是,您的第一列不是日期或时间类型。试一试

plot  "input.csv" using 2:8 title "total times" with linespoints
脚本将完美运行。

(至少在我的机器上是这样的。^^)。

thank这是预期的效果-但是gnuplot中的列不是从0开始计数的吗?不是,它们从1开始。第0列保留为数据的索引;所谓的伪列。您可以使用
列(0)
$0
访问该列。