2015-06-17 56 views
1

gnuplot在我的数据文件在午夜滚动时抛出非法的某个月份。GNUPLOT非法在每月的午夜

进出口使用的Gnuplot 4.6.6 (我见过有5.0同样的问题)

的Gnuplot:

reset 
set decimalsign locale 
set datafile separator "\t" 
set xdata time 
set timefmt "%d.%m.%y %H:%M:%S" #21.01.2015 07:16:17; 
set format x "%H:%M:%S" 
plot 'exam.txt' using 2:3 with lines 

我的数据:

16.06.2015 23:59:51 11,92048 -9,94011 
16.06.2015 23:59:55 11,92318 -9,60236 
16.06.2015 23:59:58 11,92403 -9,49577 
17.06.2015 00:00:02 11,92261 -9,67415 
17.06.2015 00:00:06 11,92398 -9,50203 
17.06.2015 00:00:09 11,92233 -9,70848 

有没有人建议什么错误?

回答

0

两件事:要解析四位数的年份值,您必须使用%Y,时间在第一列。因此,提供了数据和时间仅由一个正常的空间分离,其他列由tab(这个信息会丢失在计算器)分离,那么下面的应该很好地工作:

reset 
set decimalsign locale 
set datafile separator "\t" 
set xdata time 
set timefmt "%d.%m.%Y %H:%M:%S" 
set format x "%H:%M:%S" 
plot 'exam.txt' using 1:2 with lines 

一般来说,我会建议你要么使用清晰可辨的列分隔符(如;),要么保留默认值将任何空格视为列分隔符。

解析分布在多个列(前两个)的时间格式可以正常工作。在使用语句中,您必须给出时间数据开始的列号。要访问除时间列以外的任何其他列,计数将照常进行,即绘制您需要使用的所有数据。

reset 
set decimalsign locale 
set xdata time 
set timefmt "%d.%m.%Y %H:%M:%S" 
set format x "%H:%M:%S" 
set style data lines 
plot 'exam.txt' using 1:3, '' using 1:4 
+0

时间和日期之间的TAB似乎是主要问题! 非常感谢! – Nash2015