title: How to speed up real time plotting in pyqtgraph
body: <p>In short, I'm trying to find a faster way to plot real time data coming through a serial input. The data looks like a coordinate (x,y) and about 40 are coming in each second. The stream will store the data in a array, using x as the index and setting y as the value for it. This portion is being threaded. While the stream can read in data immediatley, the pyqtgraph library isn't able to keep up with this speed.</p>
  
  <p>Here's the portion of the code where I am plotting the data. The distances and theta variables are arrays with 6400 indexes. They have been transformed into polar values and plotted with each iteration. I added a delay there just to help keep it real-time, though it's only a temporary solution.</p>
  
  <pre class="lang-py prettyprint-override"><code>while True:
      x = distances * np.cos(theta)
      y = distances * np.sin(theta)
      plot.plot(x, y, pen=None, symbol='o', clear=True)
      pg.QtGui.QApplication.processEvents()
  
  
      #sleep(0.025)
  </code></pre>
  
  <p>While it's going the way I expect it to, it's not able to plot the most recent data from the serial input. It's easily several seconds behind from the most recent reads, probably because it can not plot 6400 points every 1/40 of a second. I'm wondering if there's a way to only update 1 point rather than having to re-plot the entire scatter every time in pyqtgraph. </p>
  
  <p>It may be possible to plot based on point, but if so, is there a way to keep track of each individual point? There should be no point that shares the same angle value and have different distances, and should essentially overwrite it.</p>
  
  <p>I'm also wondering if there are other graphing animation libraries out there that may be a possible solution worth considering.</p>
  
  <p>This is what it looks like, if you're wondering: </p>
  
  <p><a href="https://i.stack.imgur.com/CldTY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CldTY.png" alt="enter image description here"></a></p>