【问题标题】:gnuplot replot multiple files to one plotgnuplot 将多个文件重新绘制到一个图上
【发布时间】:2014-06-17 13:25:51
【问题描述】:

我有 100 个具有相同 (x,y) 格式的数据集的文件,我正在尝试使用脚本 将所有数据绘制/重新绘制到一个 gnuplot 图。我有一个 gnuplot 脚本可以正确打开并绘制第一个文件,但其余 99 个文件没有重新绘制到同一个图表,即使这些文件似乎已正确打开。 我的主脚本如下所示:

# template.gnuplot
i = 1
j = 40000 
n = 100
set terminal postscript enh color 24 
load "loop.plt"

loop.plt 看起来像这样:

filename = "".j."_mod.int"
plotfile = "graph.eps"
print filename." ".plotfile
set output plotfile
if (i == 1) plot filename u 1:2  w lp; else replot filename u 1:2 w p
rep
set output
i=i+1
j=i*40000
if (i <= n) reread

谁能告诉我我的 if / else 语法是否正确?将数据附加到第一个图的最佳方法是什么? 感谢您的任何建议!

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    我从您那里获取您的文件名为40000_mod.int80000_mod.int 等的代码。试试:

    plot for [j = 40000:4000000:40000] "".j."_mod.int" u 1:2 w lp
    

    【讨论】:

    • 谢谢,很有帮助!所以现在我有 plotfile = "graph.eps" set output plotfile filename(n) = sprintf("%d_mod.int", n) plot for [i = 400000:4000000:400000] filename(i) u 1:2 title sprintf("%d", i) w lp
    猜你喜欢
    • 2015-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多