From: Forrest I. <for...@be...> - 2012-12-31 21:27:17
|
Thanks for the help, Michael. The problem is solved now. It turns out that just doing persist=0 does the job. Earlier, I said that persist=0 doesn't help, but now I tested it more carefully--I was wrong. (I had a bunch of old Gnuplot windows open, and I mistook those for new persistant windows being created.) On Sat, Dec 29, 2012 at 1:56 AM, Michael Haggerty <mh...@al...>wrote: > On 12/29/2012 05:58 AM, Forrest Iandola wrote: > > I'm trying to do the opposite -- I'm using hardcopy() to write the plots > > to file, so /I'd like to have the gnuplot window close after Python > > finishes executing/. > > > > I'm using the X11 terminal (I'm working on a Mac, and aquaterm isn't > > cooperating). > > Regardless of whether I do gp = Gnuplot.Gnuplot(*persist = 1*) or > > *persist = 0*, the old Gnuplot windows stay open, and I often end up > > with tons of open windows. > > > > I'd be /satisfied/ if we could just have the Gnuplot windows close after > > Python finishes executing. > > It'd be /even better/ if I could have Python close all figures from > > previous runs, but keep the figure open from the most recent Python > > execution. In other words, I'm looking for the Matlab `close all hidden` > > command. > > A good first step might be for you to figure out how to get the gnuplot > program itself (i.e., independent of Gnuplot.py) to do what you want. > Maybe you have to start it with different command-line options? Maybe > you have to use a different terminal setting ("gnuplot> set term > XXXXXX")? Maybe you need to set extra options when setting the terminal > ("gnuplot> set term XXXXXX FOO BAR")? > > If it's possible to get gnuplot to behave the way you want, then it is > probably possible to get Gnuplot.py to do so. Conversely, if gnuplot is > not capable of doing what you want, Gnuplot.py has no chance. > > It *could be* that the way that Gnuplot.py does hardcopies is confusing > gnuplot. (It changes the terminal selection to one of the hardcopy > terminals, re-plots the data, then reselects the standard terminal.) > Perhaps the closing then re-opening of the standard terminal is breaking > gnuplot's connection to the old terminal window. Do the old terminals > stay around even if you don't make any hardcopies? > > Michael > > -- > Michael Haggerty > mh...@al... > http://softwareswirl.blogspot.com/ > -- Forrest Iandola http://www.forrestiandola.com |