Live Data Monitor: PyQtGraph

牧云@^-^@ 提交于 2019-12-03 08:20:55

To make a plot scroll, you have three options:

  1. Scroll the raw data and re-plot (see numpy.roll)

    curve = plotItem.plot(data)
    data = np.roll(data, 1)  # scroll data
    curve.setData(data)      # re-plot
    
  2. Move the plot curve so that it slides across the view:

    curve = plotItem.plot(data)
    curve.setPos(x, 0)  # Move the curve
    
  3. Move the view region such that the plot curve appears to scroll

    curve = plotItem.plot(data)
    plotItem.setXRange(x1, x2)  # Move the view
    

The scrolling-plots example (currently only in the development version) demonstrates each of these:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!