matplot zoomout/draw()


im currently working on data analysis with matplotlib/numpy/scipy,
my programm plots data with plot() and waits for input commands via __call__
with the x key it is possible to save data points and plot them into the
the r key can be used to remove points from data/figure,.

the programm works quite good so far, except if i want to remove a data
i turned of self.dataplot.set_autoscale_on(False), to avoid that there is a
zoom out when i save/remove data points.
the problem is that this just works if i save an new point, if i want to
remove a point via "r" the figure zooms out
each time altough the autoscale is on False ....

here a short part of my source code:

  def __call__(self, event):
    if event.key == "x":
      self.N = self.N + 1
      plt.axvline(event.xdata, ymin=0, ymax=600, linestyle="--")
      rest = event.xdata % 4.0e-7
      index = int((event.xdata-rest)/4.0e-7-1)
      if (self.N%2 == 0) and self.N <17:
        p1, p2 = self.x[len(self.x)-2],self.x[len(self.x)-1]
        if p1>p2:
          p1, p2 = p2, p1
      plt.xlabel('N = '+str(self.N))
    elif event.key == "r":
      if (self.remove == True) or (self.N>16):
        if self.history[len(self.history)-1]==True:
          del self.dataplot.lines[len(self.dataplot.lines)-1]
        elif self.history[len(self.history)-1]==False:
          self.N = self.N-1
          plt.xlabel('N = '+str(self.N))
          del self.dataplot.lines[len(self.dataplot.lines)-1]
          del self.dataplot.lines[len(self.dataplot.lines)-1]

        plt.xlabel('N = '+str(self.N))

i hope somebody can help me


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