Nested loops in gnuplot and postscript terminal -



Nested loops in gnuplot and postscript terminal -

i using gnuplot postscript eps terminal, script:

set terminal postscript eps enhanced solid "helvetica" 14 set output "gamma_off_real.ps" set title 'l=4, n_{up}=n_{dw}=2, u=1.0 hf, step, v_0=1, ntimestep=400, tinterval=10' set xlabel 'time' set ylabel 're({/symbol g}_{ij})' set yrange [-0.5:1] [j=1:(nsit-1)] {do [i=1:(nsit-j)] {plot 'time/fort.99' u (column(1)):(column((i-1)*nsit+i+j+1)) w l lt 1 lc ((-((j-1)*j)/2+(j-1)*nsit)+i+nsit) lw 3 t sprintf('re({/symbol g}_{%i%i})',i,i+j)}}

i utilize 2 nested loops @ end in .ps file have more 1 pages each 1 curve. should alter have curves in same plot?

you must utilize syntax plot ..., can nested:

plot [j=1:(nsit-1)] [i=1:(nsit-j)] 'time/fort.99' u ...

update: doesn't work, in plot ... for construction sec index cannot depend on first one. next plots 3 curves instead of six:

plot [j=1:3] [i=1:j] i*x + j

some ugly next work:

s = '' [j=1:(nsit-1)] { [i=1:(nsit-j)] { s = s . sprintf('%d %d ', i, j) }} i(w) = int(word(s, 2*w - 1)) j(w) = int(word(s, 2*w)) plot [w=1:words(s)/2] 'time/fort.99' u (column(1)):(column((i(w)-1)*nsit+i(w)+j(w)+1)) w l lt 1 lc ((-((j(w)-1)*j(w))/2+(j(w)-1)*nsit)+i(w)+nsit) lw 3 t sprintf('re({/symbol g}_{%i%i})',i(w),i(w)+j(w))}}

gnuplot

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -