Reputation: 11
Can I plot multiple channels with different colors in pyqtgraph with ArrayToQPath?
path = pg.arrayToQPath(xdata.flatten(), ydata.flatten(), conn.flatten())
item = QtGui.QGraphicsPathItem(path)
item.setPen(pg.mkPen('w'))
plt.addItem(item)
Upvotes: 1
Views: 2524
Reputation: 11644
QGraphicsPathItem
only supports drawing with a single color, so unfortunately it is necessary to create one item per color. For example, see examples/MultiPlotSpeedTest.py
.
If this is not fast enough for you, consider using an OpenGL-based vis. library. VisPy has an example of this in examples/demo/gloo/realtime_signals.py
.
Upvotes: 2