On 11/18/11, Andrew Norman <anorman728 at gmail.com> wrote:
> It took me awhile to condense my problem down to something quick and easy
> to explain. Using the draw package with multiplot_mode(screen) and
> set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function
>
> b(k):=
> for j:-10 thru 10 do
> draw2d( points( [ [ j,k ] ] ));
>
> It should (and it does) create a line of points along the line y=k. But if
> I then evaluate
>
> for k:-10 thru 10 do b(k);
>
> Then it works (mostly) for the first couple of lines, but then it skips
> almost all of the points.
My first guess (emphasis on guess) is that this is the result of a
race condition: many plotting commands write to temporary files
and then those files are processed by Gnuplot. Maybe the output
from one iteration is clobbering another before Gnuplot has a
chance to read it? What happens if you put in a delay, e.g. read();
(then you have to enter something like "0;" to continue).
There might be a way to tell draw to pipe the data directly to Gnuplot
without using a file. I don't know how to do that.
best
Robert Dodier