[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wait for gnuplot to finish plotting before continuing
From: |
Sergei Steshenko |
Subject: |
Re: Wait for gnuplot to finish plotting before continuing |
Date: |
Fri, 16 May 2008 23:22:01 -0700 (PDT) |
--- Tim Hessint <address@hidden> wrote:
> Hi,
>
> I need to plot inside a loop so I can see a plot evolving over time. The old
> octave would wait for plotting to finish before moving on to the next
> command,
> but octave-3 doesn't wait for the plot to finish. The loop goes faster than
> gnuplot can plot so I don't see anything except for the last plot. For
> example, try
>
> for i = 1:10
> plot(1:i)
> i
> end
>
> and you will only see it count to 10 and then plot 1:10 instead of plotting
> 1:1,
> 1:2, 1:3, etcetera. I can insert sleep(1) commands to make it work but this
> is a
> poor solution.
>
> So basically I'd like to tell octave to wait for gnuplot to finish before
> continuing.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
Actually, 'octave' waits for 'gnuplot' to complete - but to complete receiving
data.
The problem/issue is that 'octave' sends data to 'gnuplot' through pipe, and
from octave's
point of view it's done with 'gnuplot' when the last data byte is sent to the
pipe.
'gnuplot' meanwhile continues to plot.
You can probably achieve your goal by doing
plot(<whatever>); title(sprintf("i=%d", i));
, i.e. you'll see the 'i' value on the plot window after plotting is really
complete.
Regards,
Sergei.
Applications From Scratch: http://appsfromscratch.berlios.de/