1

I would like to plot data points included inside a script file. This should be done multiple times (plotting to different files). Therefore, I am using a do-for-loop.

This loop let's Gnuplot freeze on excution. Could you please hint me to the cause?

This is my MWE:

reset
set autoscale

do for [index=1:1] {
plot "-" with lines ls 2 notitle
0.500 5
1.000 6
1.500 7
e
}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Daniel
  • 13
  • 2
  • related: http://stackoverflow.com/questions/14946530/loop-structure-inside-gnuplot. Just a wag since I don't have v4.6 but it could be the inline data is not supported within a loop, try putting the data in a separate file. – agentp Sep 11 '14 at 16:01

1 Answers1

1

Yes, seems like the combination of do for with inline data isn't supported. It also wouldn't be very convenient, since this would require a separate data block for every iteration like in

set style data linespoints
plot '-' using 1:2, '-' using 1:3
1 2 3
4 5 6
e
1 2 3
4 5 6
e

With version 5.0 inline data blocks were introduced which allow reusing inline data:

$data <<EOD
1 2 3
4 5 6
EOD
do for [i=2:3] {
    plot $data using 1:i w l
    pause -1
}
Christoph
  • 47,569
  • 8
  • 87
  • 187