such as the code below. I don't know what to do at all QAQ
In official documents I only found the method of exporting static plot, and I can't find more information on the internet .
It seems that pyqtgraph is deeply relevent with QT. But I am not familiar with that.
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('Scrolling Plots Mode 1')
p1 = win.addPlot()
data1 = np.random.normal(size=300)
curve1 = p1.plot(data1)
def update1():
global data1, ptr1
data1[:-1] = data1[1:] # shift data in the array one sample left
# (see also: np.roll)
data1[-1] = np.random.normal()
curve1.setData(data1)
timer = pg.QtCore.QTimer()
timer.timeout.connect(update1)
timer.start(50)
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()