title: Python update the plot limits and multiple lines in the plot
body: <p>I have some problems the first one is that I can't update the plot limits of the y axis and the second is that I want to see 6 lines from each sensor, as you can see in the picture I see only one if I make some changes I see all the sensors variations in one line </p>
  
  <p>here is the code where I create the plot and a picture of this:</p>
  
  <ul>
  <li><p><a href="http://i.imgur.com/ogFoMDJ.png?1" rel="nofollow">http://i.imgur.com/ogFoMDJ.png?1</a></p>
  
  <pre><code># Flag variables
  self.isLogging = False
  
  # Create data buffers
  self.N = 70
  self.n = range(self.N)
  self.M = 6 # just one lead - i.e. 1 number per sample
  self.x = 0 * numpy.ones(self.N, numpy.int)
  
  # Data logging file
  self.f = 0
  
  # Create plot area and axes
  self.x_max = 500
  self.x_min = 330
  self.fig = Figure(facecolor='#e4e4e4')
  self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
  self.canvas.SetPosition((330,50))
  self.canvas.SetSize((550,280))
  self.ax = self.fig.add_axes([0.08,0.1,0.86,0.8])
  self.ax.autoscale(False)
  self.ax.set_xlim(0, self.N - 1)
  self.ax.set_ylim(self.x_min, self.x_max)
  self.ax.plot(self.n,self.x)
  
  # Filter taps
  self.taps = [0, 0, 0]
  
  # Create timer to read incoming data and scroll plot
  self.timer = wx.Timer(self)
  self.Bind(wx.EVT_TIMER, self.GetSample, self.timer)
  </code></pre></li>
  </ul>
  
  <p>And here is where I grab the data and I try to update the limits of the plot</p>
  
  <pre><code>    if len(sample_string) != 6:
  
          sample_string = sample_string[0:-1]
          self.taps[1:3] = self.taps[0:2]
          self.taps[0] = int(array[1])
          #value = 0.5 * self.taps[0] + 0.5 * self.taps[2]
          value = self.taps[0]
          self.x[0:self.N-1] = self.x[1:]
          self.x[self.N-1] = value
          # print sample to data logging file
          if self.f != 0:
              self.f.write(str(value))
              self.f.write("\n")
  
          # update plot limits
          maxval = max(self.x[:])
          minval = min(self.x[:])
          self.x_max += ((maxval + 10) - self.x_max) / 100.0
          self.x_min -= (self.x_min - (minval - 10)) / 100.0
  
      # Update plot
      self.ax.cla()
      self.ax.autoscale(False)
      self.ax.set_xlim(0, self.N - 1)
      self.ax.set_ylim(self.x_min, self.x_max)
      self.ax.plot(self.n, self.x)
      self.canvas.draw() 
  
      if b7 == True:
          self.textctrl0.Clear()
          self.textctrl0.AppendText(array[1])
          self.textctrl1.Clear()
          self.textctrl1.AppendText(array[2])
          self.textctrl2.Clear()
          self.textctrl2.AppendText(array[3])   
          self.textctrl3.Clear()
          self.textctrl3.AppendText(array[4])
          self.textctrl4.Clear()
          self.textctrl4.AppendText(array[5])
          self.textctrl5.Clear()
          self.textctrl5.AppendText(array[6])
          b7=False
  </code></pre>
  
  <p>p.s I removed the faulty code where I tried to add the other sensors,here is only the working code for the one sensor plot..</p>