嗨,我正在使用 gnuplot 创建大量图表。为了节省自己的工作,我编写了一个脚本来尝试绘制所有可能的图表。
#!/usr/bin/gnuplot
reset
is_missing(x)=system("./ismissing.sh ".x)
set terminal post eps enhanced color
set key inside right top vertical Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
set grid
models="Cebeci-Smith Baldwin-Lomax Spalart-Allmaras Launder-Sharma Chien"
files="./CebeciOut/ ./BaldwinOut/ ./SpalartOut/ ./LaunderOut/ ./ChienOut/"
xgrid="35000 70000 140000 280000 560000"
# Plot grid convergence Spalart
do for [f=1:words(files)]{
set output sprintf('%s%s',word(files,f),'ZPGGridConvergence.eps')
set title sprintf("%s%s",word(models,f), " ZPG Grid Convergence")
set xlabel "N_y"
set ylabel "C_f Final"
print f
do for [i=1:words(xgrid)]{
filename=sprintf("%s%s%s%s",word(files,f),'yconv_',word(xgrid,i),"x")
if(is_missing(filename)==0){
plot filename using 1:2 title sprintf("%s%s",word(xgrid,i), " X Gridpoints") with linespoints
}
}
}
不幸的是,我遇到了一个问题,在一次完整的迭代之后,脚本失败了,即尽管第一个情节成功完成,但 f 从未变为 2。给出的错误是
cannot open file; output not changed
line 25: util.c: No such file or directory
我还没有设法破译。任何帮助将非常感激。鉴于我尚未创建绘图,还有一种方法可以在此循环中使用 replot。谢谢