[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: synchronization of octave with gnuplot?
From: |
Thorsten Meyer |
Subject: |
Re: synchronization of octave with gnuplot? |
Date: |
Thu, 02 Dec 2004 21:11:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 |
Dear Mike,
Mike Miller wrote:
On Thu, 2 Dec 2004, Thorsten Meyer wrote:
in an octave script I generate several gnuplot plots, export them to
postscript and do some postprocessing on the resulting eps files with
a awk script that is started via system statements from octave. Now
it seems that octave does not wait for gnuplot to finish the
individual plots. So at some point in the octave script, octave
starts the awk postprocessor on an eps file that has not been
generated yet. My workaround has been sleep statements between the
plotting and the postprocessing commands in the script. However,
depending on the number and complexity of the plots it can take up to
several seconds for gnuplot to catch up. Obviously, I would not like
to add "sleep(10)" to all my plot sequences just to make sure.
My question: is there a way to actively synchronize octave with
gnuplot, i.e. force octave to wait until gnuplot has finished a
particular plot command?
When you write "octave starts the awk postprocessor on an eps file
that has not been generated yet" do you mean that the file does not
exist or that the file is not fully generated?
Both cases happen.
It is possible to put an 'if' statement in your script to have it
either "sleep(1)" or execute the awk code depending on the existence
of a file or the existence of an ending element in a file tail.
Mike
You are right. I could have octave wait for the existence of the file.
But as soon as it exists, I would have to keep parsing it in a loop in
order to see if it is complete.
Thorsten Meyer
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------