From: Michael H. <mh...@al...> - 2011-08-22 08:46:19
|
On 08/18/2011 05:31 PM, Ken Smith wrote: > Apologies in advance if there's an FAQ, but I can't find it... (Feel > free to point it out to me...) There is a FAQ.txt in the Gnuplot.py distribution. The first FAQ question is closely related to your problem. > The problem is that (presumably because of threading) Gnuplot.py is > sometimes not completing its work before I attempt to convert the > plot. Hence ImageMagic complains about missing postscript files - or > the postscript files are incomplete when conversion starts. > > Is there a way to turn threading/FIFOs OFF? Or is there a way I can > use "join" to force my python program to WAIT for the plot to be > completed before attempting to convert it? The problem is not so much the multithreading in Gnuplot.py (which anyway should be turned off if your turn off the use of FIFOs) but rather the fact that a separate process (the gnuplot program) is doing the real work. I believe that if you close() the Gnuplot object explicitly then it will wait for gnuplot to finish (though of course you will have to create a new Gnuplot object if you want to do more work afterwards): g = Gnuplot.Gnuplot() # Use g to plot what you want g.close() # At this point I think that all of the gnuplot output should be # done. Please try this out and tell us if it works. Michael -- Michael Haggerty mh...@al... http://softwareswirl.blogspot.com/ |