来自csv输入的gnuplot TIMEMT错误;坏时间格式“;

来自csv输入的gnuplot TIMEMT错误;坏时间格式“;,gnuplot,Gnuplot,我正试图绘制一个包含两列的500 MB csv文件,如下所示: ID,"timestamp" 1,"2016-02-09 14:46:52.683" 2,"2016-02-09 14:47:02.687" 3,"2016-02-09 14:47:09.896" 4,"2016-02-09 14:47:12.702" 5,"2016-02-09 14:47:22.663" 6,"2016-02-09 14:47:32.668" 7,"2016-02-09 14:47:42.68" 8,"2016-

我正试图绘制一个包含两列的500 MB csv文件,如下所示:

ID,"timestamp"
1,"2016-02-09 14:46:52.683"
2,"2016-02-09 14:47:02.687"
3,"2016-02-09 14:47:09.896"
4,"2016-02-09 14:47:12.702"
5,"2016-02-09 14:47:22.663"
6,"2016-02-09 14:47:32.668"
7,"2016-02-09 14:47:42.68"
8,"2016-02-09 14:47:52.676"
9,"2016-02-09 14:48:02.661"
我已经写了一个gnuplot脚本,但我不确定哪里出错了。我也关注过其他帖子。我错过了什么

我认为毫秒数据有时几乎没有值可能是一个问题,但我不确定如何解决

非常感谢!克里斯

set datafile separator ","
set key autotitle columnhead
set xdata time
set timefmt '"%Y-%m-%d %H:%M:%.6S"'
set format x "%Y-%m-%d %H:%M:%.6S"
# set xrange ['"2016-04-01 00:00:00.000000"':'"2016-05-01 17:00:00.000000"']
plot "~/timestampi.csv" u 2:1
输出:

Terminal type set to 'qt'
gnuplot> load "~/g.p"
         "/home/chrisb/g.p", line 6: warning: Bad time format in string
         "/home/chrisb/g.p", line 6: warning: Bad time format in string
         "/home/chrisb/g.p", line 7: warning: Skipping data file with no valid points

gnuplot> plot "~/timestampi.csv" u 2:1 w l
                                          ^
         "/home/chrisb/g.p", line 7: all points y value undefined!

gnuplot> 

仅tic标签支持指定明确的第二精度。解析输入数据时,秒始终解析为浮点数:

set datafile separator ","
set key autotitle columnhead
set xdata time
set timefmt '"%Y-%m-%d %H:%M:%S"'
set format x "%Y-%m-%d %H:%M:%.6S"
set xrange ['"2016-04-01 00:00:00"':'"2016-05-01 17:00:00"']
plot "~/timestampi.csv" u 2:1

请注意,将
%.6S
设置格式一起使用是可行的,但没有意义,因为在如此大的时间范围内,你不会在一秒钟内得到抽搐。

谢谢Christof。不幸的是,我不得不删除这些引语,然后原始脚本就变成了现实!谢谢你的提示!最好的,克里斯