Gnuplot读取UNIX时间戳。

20

我有一个以这种格式存储数据的文件:

1351649601.045 421 2945
1351649601.684 1036 28591
1351649603.310 128 1620
1351649603.413 93 0
1351649603.375 132 1762
1351649603.318 218 1761
1351649603.434 412 176
1351649603.441 520 5780
1351649603.480 565 11070
1351649603.556 644 11535


gnuplot> set term png
Terminal type set to 'png'
gnuplot> set output "output.png"
gnuplot> plot "data.txt" using 1:2 with lines

然而,gnuplot无法正确读取该日期。你有什么想法吗?

已解决:

set term png xffffff
set output "output.png"
set size 17,17
set title "HTTP payload size and response time"
set style data fsteps
set xlabel "Date"
set timefmt "%s"
set format x "%m/%d/%Y %H:%M:%S"
set xdata time
set ylabel "Payload/Response time"
set grid
set key left
plot 'response' usi 1:2 with linespoints

OP请取消接受错误的答案,并告诉我们您是如何解决这个问题的。 - Lightness Races in Orbit
1
“set xdata time” 这行代码是必不可少的。 - geekQ
1个回答

20

抱歉,似乎无法删除。原本想要建议:

set xdata time
set timefmt "%s"
set format x "%m/%d/%Y %H:%M:%S"
plot "file.txt" using 1:2 with linespoints

但是它截断了小数并且从线条上删除了点。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接