【问题标题】:gnuplot confuses when date time data crosses midnight当日期时间数据超过午夜时,gnuplot 会感到困惑
【发布时间】:2019-05-15 21:19:51
【问题描述】:

我正在尝试使用 gnuplot 选项set xdata time; set timefmt "%m/%d %H:%M:%S"; set datafile separator "-"; set format x "%m-%d\n%H:%M" 绘制下面的数据集

05/23 23:56:00-16
05/23 23:57:00-12
05/23 23:58:00-18
05/24 23:59:00-12
05/24 00:00:00-16
05/24 00:01:00-22
05/24 00:02:00-18
05/24 00:03:00-15
05/24 00:04:00-16
05/24 00:05:00-16
05/24 00:06:00-16
05/24 00:07:00-14
05/24 00:08:00-12
05/24 00:09:00-14
05/24 00:10:00-14
05/24 00:11:00-14
05/24 00:12:00-12
05/24 00:13:00-16
05/24 00:14:00-12
05/24 00:15:00-17

但是,当我以plot "stats.log" using 1:2 with lines 运行绘图命令时,我得到下图。图表中的 奇怪 跳跃似乎发生在 05/25 00:00:00 - 00:09:00 之间,如果我删除它,图表会按预期绘制。将<sort 添加到绘图命令会将此数据集移动到图表的末尾,但这不是我想要的。

有什么办法可以解决这个问题吗?

【问题讨论】:

  • 您确定问题不在输入数据中吗?看起来第 4 行将时间归因于错误的日期。

标签: gnuplot


【解决方案1】:

我认为你有一个错误的数据点:

...
05/23 23:58:00-18  # correct
05/24 23:59:00-12  # wrong day, should be 05/23 ...
05/24 00:00:00-16  # correct
...

【讨论】:

  • 错过了这么愚蠢的事情。非常感谢您花时间指出这一点。
猜你喜欢
  • 1970-01-01
  • 2013-01-06
  • 2012-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多