I want to export a pyqtgraph to a video. Is there any easy way to do this? The plot is not much different from this example except it contains about 10000 frames:
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Basic plotting examples")
win.resize(1000,600)
pg.setConfigOptions(antialias=True)
p6 = win.addPlot(title="0")
curve = p6.plot(pen='y')
data = np.random.normal(size=(10,1000))
ptr = 0
def update():
global curve, data, ptr, p6
data_ptr = ptr%10
p6.setTitle("%d" % data_ptr)
curve.setData(data[data_ptr])
if ptr == 0:
p6.enableAutoRange('xy', False)
ptr += 1
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(50)