From: Andreas T. <ti...@rk...> - 2002-12-10 12:34:11
|
Hello, is there any possibility to ensure that an output file will be created immediately after calling the plot method? My problem is the following: g = Gnuplot.Gnuplot(debug=1) g.xlabel('x') g.ylabel('y') g('set terminal postscript eps color solid "Helvetica" 24') g('set output "tmp.eps"') g.plot(X) p = os.popen('/usr/bin/convert tmp.eps png:-', 'r') img = Binary(p.read()) p.close() This EPS to PNG conversion is done for several reasons. One of these reasons are better fonts compared to direct PNG output. Unfortunately it is not sure that the file tmp.eps exists at this time. I have a randomly effect that it is missing if I go through a loop of about 30 iterations (each creating different images). I guess this has something to do with syncronisation and I wonder if I could flush a certain buffer to ensure that the file is written. Any hints? Andreas. |