linux - 时间转换在 gnuplot 中不起作用

标签 linux bash gnuplot

我有以下代码片段可以通过 gnuplot 输出图形。

set datafile separator ","

set title "Memory"
set xlabel "Values"
set ylabel "Date"
set ydata time
set timefmt "%H"
set format y "%d/%m/%Y"
set key left top
set grid

plot 'memory-memory-buffered_combined' using 0:2 titl "1" with lines,\
     'memory-memory-cached_combined' using 0:2 title "2" with lines
cat 
pause -1

但是,当我得到结果时,它是从 1970 年开始的。

我正在阅读的 csv 的前 5 行;

epoch,value
1478193413.596,72910
1478193473.412,134432
1478193413.158,65449
1478193411.929,60157

所以,实际上是 2016 年 11 月。

我的脚本的哪一部分应该不同?

最佳答案

set datafile separator ","

set title "irq"
set xlabel "Date"
set ylabel "Values"
set xdata time
set timefmt "%s"
set format x "%d/%m/%Y"
set key right top
set grid

set terminal jpeg size 3600,2100 enhanced font helvetica 20
set output "irq.jpg"


plot "/irq/irq-16_combined" using 1:2 title "irq-16" with lines

我对脚本进行了一些更改,但它仍然不一致。在 100 个具有相同模式和具有相同列名称和值的相似文件的脚本中,只有一个仍然输出时间从 1970 年开始的时间。你们中有人遇到过这样的问题吗?

关于linux - 时间转换在 gnuplot 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44313665/

相关文章:

regex - Grep Regex 匹配任何内容,包括换行符

linux - ". filename"从/bin/sh 运行时找不到文件,从/bin/bash 运行;为什么?

gnuplot - gnuplot直方图: How to put values on top of bars

colors - 如何使用 Gnuplot 中格式为 `#aabbcc` 的数据列中声明的颜色为点着色?

linux - 如果禁用 IOMMU(intel VT-D),PCI 设备能否直接寻址 CPU PA

c# - 创建一个 nuget 在 linux 和 windows 之间共享

Linux 程序集 "collect2: ld returned 1 exit status"

regex - Bash:如何使用 sed 删除除字母和数字以外的所有字符?

python - Awk 比较 3 个值,第一个文件值之间的第二个文件值,两个文件之间的多列打印输出到第三个

gnuplot - 如何绘制相同的值直到它改变?