Problem with redrawing of plots

with the following source code, in which show_function is called after a key
event, I have 2 problems :-/:

1) each new drawing (i.e. new call of show_function) leads to a indermediate
redrawing of the previous plots, making the program slow

2) the 'button_press_event', which prints xdata/ydata, always prints the
coordinates of the first plot (so as if the axes are not updated by calling

Any ideas? :working:

Thanks in advance!


class CanvasFrame(wx.Frame):
  def __init__(self, ):

def show_function(self,xname,x,yname,y,bestbkgr,bestprm,filename,numscan):
    from pylab import
                self.figure = figure()
                self.axes = self.figure.add_subplot(111)
    self.figure_canvas = FigureCanvas(self, -1, self.figure)
    self.sizer = wx.BoxSizer(wx.VERTICAL)
    self.sizer.Add(self.figure_canvas, 1, wx.EXPAND|wx.CENTER|wx.GROW)



View this message in context:
Sent from the matplotlib - users mailing list archive at