X轴上的Gnuplot日期和时间

use*_*950 5 format time gnuplot

我想做的是绘制一个图,其中我的x轴从数据的第一列中获取一个日期,然后从我的第二列中获取一个时间,并同时使用两者来创建x轴,

我有一组来自日期记录器的数据,我想在gnuplot上绘制图形,因为我每天都会获取新数据,因此只要在获取每个txt文件时就添加它们就非常容易

文本文件如下所示(每个24小时)

日期时间值

30/07/2014 00:59:38 0.075
30/07/2014 00:58:34 0.102
30/07/2014 00:57:31 0.058
30/07/2014 00:56:31 0.089 30/07/2014
00 :55:28 0.119
30/07/2014 00:54:26 0.151
30/07/2014 00:53:22 0.17
30/07/2014 00:52:19 0.171
30/07/2014 00:51:17 0.221
30 / 07/2014 00:50:17 0
30/07/2014 00:49:13 0
30/07/2014 00:48:11 0
30/07/2014 00:47:09 0

这种在gnuplot xaxis上混合日期和时间的解决方案非常适合我,但是它非常复杂,我不知道发生了什么,更不用说将其应用于多个文件了

这是我尝试的代码,但是我收到了非法的“每月某天”错误?

#!/gnuplot
set timefmt '%d/%m/%Y %H:%M:%S'
set xdata time
set format x '%d/%m/%Y %H:%M:%S'



#DATA FILES
plot '30.07.2014 Soli.txt'  using 1:3 title '30/07/2014'  with points pt 5 lc rgb 'red',\
     '31.07.2014 Soli.txt'  using 1:3 title '31/07/2014'  with points pt 5 lc rgb 'blue'
Run Code Online (Sandbox Code Playgroud)

所有帮助表示赞赏!谢谢

Chr*_*oph 6

如果数据文件中出现一些意外数据,例如在您的情况下取消注释和未使用的标题行,则会触发此类错误。

下列 file.dat

Date Time Value
30/07/2014 00:59:38 0.075
30/07/2014 00:58:34 0.102
Run Code Online (Sandbox Code Playgroud)

用最小的脚本给出这样的错误

set xdata time
set timefmt '%d/%m/%Y %H:%M:%S'
plot 'file.dat' using 1:3
Run Code Online (Sandbox Code Playgroud)

要解决错误,请删除第一行(或中间的类似行)。

从 4.6.6 版开始,您还可以使用该skip选项跳过数据文件开头的某些行,例如:

set xdata time
set timefmt '%d/%m/%Y %H:%M:%S'
plot 'file.dat' using 1:3 skip 1
Run Code Online (Sandbox Code Playgroud)