|
From: John H. <jd...@gm...> - 2008-12-15 16:21:04
|
On Mon, Dec 15, 2008 at 9:44 AM, John Hunter <jd...@gm...> wrote:
> By default matplotlib overplots, so every time you call plot a new
> line is added to the canvas. You can turn this behavior off using the
> hold method
Sorry, on second look it appears you have a more serious problem.
Typically you want to create your figure and canvas just once and add
it to your GUI. And then when the user clicks plot, just draw to the
existing axes
def __init__():
self.figure = some code
self.canvas = some code
self.axes = some code
def onclick(self):
self.axes.cla() # clear if you want
self.axes.plot(something)
Ie, you want to reuse the same figure/canvas/axes instead of
recreating them all the time
|