title: Live Plotting using pyqtgraph
body: <p>I wish to read data from a spectrometer and plot a frequency vs intensity graph inside a PyQt5 Gui, I have done all other stuff and the following code plots a graph:</p>
  
  <pre><code>plot1 = pg.PlotWidget()
  plot2 =pg.PlotWidget()
  layout.addWidget(plot1,2,3,15,10)
  layout.addWidget(plot2,100,3,5,10)
  
  
  sptdll.getFrame(byref(spectra),0xFFFF)  #this is just that my program takes data from a dll file
  b = np.frombuffer(spectra, dtype=np.uint16)
  
  plot1.plot(data,b[0:3653],pen='g')      # data is my x axis array, and b is y axis
  </code></pre>
  
  <p>Now my problem I want this graph to run live, that is change with time, I was able to do that in matplotlib as follows:</p>
  
  <pre><code>fig = plt.figure()
  ax1 = fig.add_subplot(1,1,1)
  
  def animate(i):
      sptdll.getFrame(byref(spectra),0xFFFF)
      b = np.frombuffer(spectra, dtype=np.uint16)
      ax1.clear()
      ax1.plot(data,b[0:3653])
  
  
  ani = animation.FuncAnimation(fig, animate, interval=10)
  
  plt.show()
  </code></pre>
  
  <p>but since i want to do the same with pyqtgraph inside my GUI; can somebody help, I am attaching the current screenshot of my GUI.</p>
  
  <p>Image of Gui, I need the green graph to go live.</p>
  
  <p><img src="https://i.stack.imgur.com/4TFd8.png" alt=""></p>