[SciPy-user] multiple windows in gplt

Chris Fonnesbeck fonnesbeck at gmail.com
Thu Oct 14 09:08:25 CDT 2004

My Markov chain Monte Carlo code calls gplt.plot repeatedly to
generate histograms and traces of simulated values. However, rather
than re-use the sample gnuplot window, it generates a new frame for
each plot it produces, often leaving my screen cluttered with hundreds
of plots for more complicated models. I have tried removing the
gplt.close() statement in my plotting routine, but then the single
window generated does not refresh with each new plot; the initial plot
remains displayed until the end of the simulation. I know that if I
call plot repeatedly from an interactive python session, subsequent
plots are displayed properly in the same frame. Any ideas what may be
causing this? Here is a sample of my plotting method, which uses

    def time_series(self,data,name,xlab='Time',ylab='Value',suffix='',same_axes=True):
        'Internal plotting specification for handling nested arrays'
        'If there is only one data array, go ahead and plot it ... '
        if len(shape(data))==1 or same_axes:

            print 'Plotting',name

            'Plot options'

            'Save to file'
            output("%s%s.png" % (name,suffix),'png')

            '... otherwise plot recursively'

            tdata = swapaxes(data,0,1)

            for i in range(len(tdata)):

More information about the SciPy-user mailing list