From: Michael H. <mh...@al...> - 2006-11-09 21:51:10
|
Conor Robinson wrote: > I'm generating thousands of plots, which I'm storing as ps files as > records of different trials. For example: > > #plot my data > g2.plot(r22, r2, r21) > > #save results of a trial > g2.hardcopy(trial+'/result.ps', enhanced=1, color=1) > > What I would like to do is complete the plot in g2, but suppress the > visual output and just save a hardcopy to view later if need be. > Eventually, as expected, AquaTerm will crash as I keep displaying the > numerous plots. Is there a way to implement this? To prevent the terminal output, I think you could use the 'unknown' terminal type (which appears to send output to nirvana): import gp, Gnuplot # Set the term value that is restored after a hardcopy: gp.GnuplotOpts.default_term = 'unknown' g = Gnuplot.Gnuplot() # Set the initial term value: g('set term unknown') ... If you are very worried about efficiency, though, you can't really use the hardcopy() method at all because it causes the data to be processed twice (once for 'unknown' then once for your desired hardcopy output device). If that is a problem, you probably want to set the terminal and output file manually before plotting anything. Michael |