title: Matplotlib is not recognizing the attribute set_xdata.
body: <p>In reference to <a href="https://stackoverflow.com/questions/23877371/pyqt-matplotlib-widget-live-data-updates/23883811#comment37569428_23883811">this post</a>: I have been attempting to run the following code for plotting and live updating a graph. However, I am welcomed by the following error every time I attempt to run the function: <code>AttributeError: 'list' object has no attribute 'set_xdata'</code> </p>
  
  <p>The rest of the function looks like the following:</p>
  
  <pre><code>def getData(self):
      self.data = random.gauss(10,0.1)
      self.ValueTotal.append(self.data)
      #With value total being a list instantiated as ValueTotal = []
      self.updateData()
  
  def updateData(self):
  
      if not hasattr(self, 'line'):
          # this should only be executed on the first call to updateData
          self.widget.canvas.ax.clear()
          self.widget.canvas.ax.hold(True)
          self.line = self.widget.canvas.ax.plot(self.ValueTotal,'r-')
          self.widget.canvas.ax.grid()
      else:
          # now we only modify the plotted line
          self.line.set_xdata(np.arange(len(self.ValueTotal)))
          self.line.set_ydata(self.ValueTotal)
  
      self.widget.canvas.draw()   
  </code></pre>
  
  <p>While this code originated from <a href="https://stackoverflow.com/users/2319400/sebastian">sebastian</a> and <a href="https://stackoverflow.com/users/1978467/jake-french">Jake French</a> I have not had any success implementing this.Is there something I am doing wrong? What generates this error and how can I fix?</p>
  
  <p>This is used strictly for an example and will not be copied into my code. I am simply using it for referential material and felt this would be the simplest way to communicate my problems with the community. I take no credit for the previous code.</p>