gpt4 book ai didi

gnuplot : plotting data from multiple input files in a single graph

转载 作者:行者123 更新时间:2023-12-03 05:15:00 24 4
gpt4 key购买 nike

我正在尝试使用 gnuplot 绘制图表。我有六个文本文件。每个文本文件包含两列。第一列表示以秒为单位的时间( float )。第二个是序列号。我想在单个图表中绘制所有六个文件的时间与序列号的图表。我正在使用这个文件来做到这一点。

set terminal png
set output 'akamai.png'

set xdata time
set timefmt "%S"
set xlabel "time"

set autoscale

set ylabel "highest seq number"
set format y "%s"

set title "seq number over time"
set key reverse Left outside
set grid

set style data linespoints

plot "print_1012720" using 1:2 title "Flow 1", \
plot "print_1058167" using 1:2 title "Flow 2", \
plot "print_193548" using 1:2 title "Flow 3", \
plot "print_401125" using 1:2 title "Flow 4", \
plot "print_401275" using 1:2 title "Flow 5", \
plot "print_401276" using 1:2 title "Flow 6"

我的文件在哪里:

  • print_1012720
  • print_1058167
  • print_193548
  • print_401125
  • print_401275
  • print_401276

它给出了一个奇怪的错误,如下所示:

"plot.plt", line 24: undefined variable: plot

我做错了什么吗?是否可以在同一个图表中绘制来自不同文件的输入数据?

最佳答案

你已经很接近了!

改变

plot "print_1012720" using 1:2 title "Flow 1", \
plot "print_1058167" using 1:2 title "Flow 2", \
plot "print_193548" using 1:2 title "Flow 3", \
plot "print_401125" using 1:2 title "Flow 4", \
plot "print_401275" using 1:2 title "Flow 5", \
plot "print_401276" using 1:2 title "Flow 6"

plot "print_1012720" using 1:2 title "Flow 1", \
"print_1058167" using 1:2 title "Flow 2", \
"print_193548" using 1:2 title "Flow 3", \
"print_401125" using 1:2 title "Flow 4", \
"print_401275" using 1:2 title "Flow 5", \
"print_401276" using 1:2 title "Flow 6"

出现该错误是因为 gnuplot 试图将单词“plot”解释为要绘图的文件名,但您尚未将任何字符串分配给名为“plot”的变量(这很好 - 这会非常令人困惑)。

关于gnuplot : plotting data from multiple input files in a single graph,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11092608/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com