linux - gnuplot 中缩写日的问题

标签 linux gnuplot

我正在尝试在 Linux 上使用 gnuplot (v4.4.3) 绘制图形,输入文件包含时间(X 轴)和一些其他值。 (样本行 - 2011 年 8 月 2 日星期二 17:00:09 1.8 2.1 1.1 1.1 2.8) 时间是 C 函数的输出 - asctime。但是,每当我尝试绘图时都会出错。我将时间格式设置为 - %a %b %d %H:%M:%S %Y。但它总是会为非法的月份日、错误的缩写月份等抛出错误。我在其他一些小文件上测试了它,发现只要文件中有缩写日,它就会爆炸。文档说我将不得不使用 % a 代表缩短的一天,我正在这样做。请帮我解决这个问题。

最佳答案

您遇到的问题是 set timefmt 中没有 %a - abbreviated name of day of the week,因此无法使用。它似乎存在于 set format 说明符中。

下面的示例应该会引导您:

set xdata time
set timefmt "%b %d %H:%M:%S %Y"
set format x "%H/%a"
plot "-" u 1:5 w lp
    Aug 2 17:00:09 2011 1
    Aug 3 02:00:09 2011 2
    Aug 4 22:00:09 2011 3
    Aug 5 04:00:09 2011 4
    e

关于linux - gnuplot 中缩写日的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6922004/

相关文章:

linux - 查找文件夹和子文件夹中所有文件的替代方法

c - 管道数组 : Will parent process load the array fast enough?

Gnuplot 多图 : Convenient method for creating more complex layouts

matrix - 快速可视化一个大的二进制矩阵?

linux - 逃命~!在 awk(bash 命令)中,反斜杠不是行中的最后一个字符

linux - flock(1) 无法释放锁

php - 不能用find和exec移动?

Python:声音文件的频率分析

gnuplot - 如何使用 splot 在 gnuplot 中绘制不同的线段

gnuplot 箭头坐标 (x,y) 错误列