开发者

Plotting some date related records

I'm having some trouble with plotting dataset that looks like this:

  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-0开发者_如何转开发2 03:00:00.0,null,2,0,0,24,0,495,2250,abc

I'm using this kind of gnuplot script:

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

I keep getting an error:

all points y value undefined!

which according to docs means that my plot definition did not produce any points. However by analyzing it by hand, it looks unreasonable - the xrange looks ok and the plot columns are also not null.

Any ideas?


With this script, you try to plot the first column as your x-axis and the eighth column as your y-axis. With set xdata time you specify, that the datatype of your x-axis is set to time/date.
Unfortunately your first column is not of type date nor time. Try

plot  "input.csv" using 2:8 title "total times" with linespoints

and the script will run perfectly.
(At least it does on my machine ^^).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜