|
From: Pedro J. C. <car...@qt...> - 2012-06-27 11:33:33
|
Dear Users and Developers
I am trying to use the "do for" to plot a large set of data, but I
have two problems that may be a feature rather than a bug.
1. I cannot call a shell inside a loop:
N=100
do for [i = 0:N-1]{
! do_something_external
plot "output4plot.res" index i u 1:9 t "" w p pt 6 ps 1.5 lc rgb "red"
}
Is this a feature or a bug?
2. Now the help... closely related with the previous point. How can I
pass the variable i to an external script. The point is to use awk to
pick up the ith-line of an auxiliary file. I did the most strange way
and can only gets the last line (the script is working ok outside
gnuplot):
N=100
do for [i = 0:N-1]{
set table "out.res"
print i
unset table
set label 1 "`line=$(cat out.res); head -n $line labels4plot.res |
tail -n 1 | gawk '{print $1,$2,$4}'`" at graph 0.9,graph 0.9 right
plot "output4plot.res" index i u 1:9 t "" w p pt 6 ps 1.5 lc rgb "red"
}
Thanks for the help
Pedro
|