Re: [Matplotlib-users] Clearing A Figure (I Know That This Has Been Posted Before But I Does Not Work For Me)

2010-05-26 Thread Thistleryver
w/o seeing the entire code it is difficult to diagnose. Nothing looks wrong with your code. However, for full control I suggest you use the API; see examples at http://matplotlib.sourceforge.net/examples/api/index.html and take a look at the artist tutorial at

Re: [Matplotlib-users] Clearing A Figure (I Know That This Has Been Posted Before But I Does Not Work For Me)

2010-05-25 Thread John Hunter
On Tue, May 25, 2010 at 4:08 AM, Thistleryver mhar...@ec.auckland.ac.nz wrote: I am attempting to run a lot of tests automatically and generate a graph for each one.  However, at the moment, the previous graph remains on the figure and the next plot is drawn over it. I have read extensively

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread Jeff Whitaker
Christopher Barker wrote: Eric Firing wrote: Even without the automatic-redraw difference, the OO interface requires more typing, and more mental record-keeping, than the pylab interface. Yes, but I don't think that's inherent in an OO interface, it's just that the quickie

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread Christopher Barker
Eric Firing wrote: I think this may be a slippery slope. The problem is that for it to work well, there has to be a clear distinction between methods that are endpoints, requiring a redraw, and methods that will be used by other methods. For example, errorbar makes multiple calls to

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread Christopher Barker
Jeff Whitaker wrote: Chris: In the pylab interface, figure() returns a figure instance and plot(x,y) returns a list of Line2d instances. yes, but it's the axis instance that you are most likely to need! - Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread Jeff Whitaker
Christopher Barker wrote: Jeff Whitaker wrote: Chris: In the pylab interface, figure() returns a figure instance and plot(x,y) returns a list of Line2d instances. yes, but it's the axis instance that you are most likely to need! - Chris Chris: Never noticed this before, but apparently

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread Christopher Barker
Jeff Whitaker wrote: Chris: Never noticed this before, but apparently the parent axes instance is attached to the Line2d instance: from pylab import * l = plot([1,2,3]) l[0].axes matplotlib.axes.Subplot instance at 0x3240e90 cool! That could be handy. thanks, -Chris --

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread belinda thom
Hi, With the exception of ipython -pylab, noone is forcing you to import *. And on the subject, Fernando, perhaps we should support a pylab mode in ipython which doesn't dump the pylab namespace (or maybe just dumps the required figure, show, close, nx), but does the interactive backend

Re: [Matplotlib-users] clearing a figure

2007-01-11 Thread John Hunter
Christopher == Christopher Barker [EMAIL PROTECTED] writes: Christopher F1 = OOlab.Figure() F2 = OOlab.Figure() We have this: fig1 = pylab.figure() fig2 = pylab.figure() ax1 = fig.add_subplot(111) line, = ax1.plot([1,2,3]) line.set_color('green') ax1.set_title('hi mom') Yes,

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Mark Bakker
Belinda - The hold state is on by default when you use pylab. To clear a figure you use clf(). Here's a brief example: from pylab import * figure() # Not really needed, you could have typed plot right away, but here you can set some nice features like the size plot([1,2,3]) plot([2,1,2]) # Will

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Christopher Barker
Eric Firing wrote: This is the big difference between most pylab functions and the corresponding axes or figure methods that they wrap: the pylab functions automatically take care of redrawing the figure if you are in an interactive mode. Now I feel bad -- I think I encouraged Belinda to

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread John Hunter
Christopher == Christopher Barker [EMAIL PROTECTED] writes: Christopher However, it is the case that there is a lot of stuff Christopher in pylab that makes it easier to use MPL in Christopher interactive mode. I kind of think that's a shame. I Christopher don't think that there

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Christopher Barker
John Hunter wrote: It's currently implemented in pylab but could be moved up to the OO layer by doing something like class Axes: def plot(self, *args, **kwargs): ...plot something if rcParams['interactive']: self.figure.canvas.draw() or by providing some

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Eric Firing
Christopher Barker wrote: Eric Firing wrote: This is the big difference between most pylab functions and the corresponding axes or figure methods that they wrap: the pylab functions automatically take care of redrawing the figure if you are in an interactive mode. Now I feel bad -- I

Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Eric Firing
John Hunter wrote: Christopher == Christopher Barker [EMAIL PROTECTED] writes: Christopher However, it is the case that there is a lot of stuff Christopher in pylab that makes it easier to use MPL in Christopher interactive mode. I kind of think that's a shame. I Christopher

Re: [Matplotlib-users] clearing a figure

2007-01-09 Thread belinda thom
One of the reasons I'm confused is b/c when I poked around, I found a clear method: help(pylab.gcf().clear) Help on method clear in module matplotlib.figure: clear(self) method of matplotlib.figure.Figure instance Clear the figure but when I execute this on my open figure:

Re: [Matplotlib-users] clearing a figure

2007-01-09 Thread Eric Firing
belinda thom wrote: One of the reasons I'm confused is b/c when I poked around, I found a clear method: help(pylab.gcf().clear) Help on method clear in module matplotlib.figure: clear(self) method of matplotlib.figure.Figure instance Clear the figure but when I execute this