[SciPy-user] multiple windows in gplt

krivilli at unberwoot.net krivilli at unberwoot.net
Thu Oct 14 15:25:16 CDT 2004


HI,

-Maybe what u're looking for is gplt.hold('on')

Chris Fonnesbeck wrote:
> 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.

(...)

> Here is a sample of my plotting method, which uses
> gplt.plot:
>
>     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(data)
>
>             'Plot options'
>             grid('off')
>             xtitle(xlab)
>             ytitle(ylab)
>
>             'Save to file'
>             output("%s%s.png" % (name,suffix),'png')
>             #close()
>
>         else:
>             '... otherwise plot recursively'
>
>             tdata = swapaxes(data,0,1)
>
>             for i in range(len(tdata)):
>                 self.time_series(tdata[i],name+'_'+str(i),xlab,ylab,suffix)
>



regards,

-- roberto (krivilli)



More information about the SciPy-user mailing list