Pyqtgraph only allows you to draw in real time, quickly drawing new chart data. How to achieve a real-time schedule is highly dependent on the details and control flow in your application.
The most common ways are:
Graph data in a loop that calls QApplication.processEvents ().
pw = pg.plot() while True: ... pw.plot(x, y, clear=True) pg.QtGui.QApplication.processEvents()
Use QTimer to repeatedly call a function that updates the schedule.
pw = pg.plot() timer = pg.QtCore.QTimer() def update(): pw.plot(x, y, clear=True) timer.timeout.connect(update) timer.start(16)
source share