Gnuplot nested do loop and plotting on the same graph -


hi i'm using gnuplot create large number of graphs. save myself work i've written script tries plot possible graphs.

#!/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 [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     [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") linespoints         }     } } 

unfortunately have problem, after 1 full iteration script fails, ie f never made 2 despite first plots completing successfully. error given

cannot open file; output not changed line 25: util.c: no such file or directory 

which haven't managed decipher. appreciated. there way use replot in loop given haven't created plot. thanks

"files" dirs in code.

if want place output in subdir, make sure exists , writable.

gnuplot cannot create subdirs automatically. can add system("mkdir -p ".word(files,f)) ( on linux/unix) in code create directory if needed.


Comments