title: Realtime plot with pyqtgraph
body: <p>I have a problem regarding real-time plotting with pyqtgraph. I want the plot to update itself every 100 items collected from serial input, but the curve shows only once, after gathering the data is finished. Debugging print "boo" gets printed to console after every 100 items, but <code>updatePlot()</code> seems to be called only while ending the loop. This is my code:</p>
  
  <pre><code>class EKG(QtGui.QMainWindow, out.Ui_MainWindow):
  
      def __init__(self):
          super(self.__class__, self).__init__()
          self.setupUi(self)
          self.collectedData = []
          self.dataPlot.showGrid(x=True, y=True, alpha=0.6)
          self.plt = self.dataPlot.plot(pen='m', antialias=True)
          self.port = "COM9"
          self.actionZako_cz.triggered.connect(self.close_window)
          self.startBtn.clicked.connect(self.collectData)
  
      def getTime(self):
          return int(self.timeBox.toPlainText())
  
      def updatePlot(self):
          self.plt.setData(self.collectedData)
  
      def collectData(self, howLong):
          howLong = self.getTime()
          self.collectedData = []
          serialData = serial.Serial(self.port, 57600)
          t_end = time.time() + howLong
          while time.time() &lt; t_end:
              try:
                  self.collectedData.append(int(serialData.readline().strip()))
              except ValueError:
                  pass
              if len(self.collectedData) % 100 == 0:
                  print "boo"
                  self.updatePlot()
          serialData.close()
  </code></pre>
  
  <p>I would be grateful for any advice; it's the first time i'm using pyqtgraph and I haven't got the hang of it yet...</p>