1

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)
apogalacticon
  • 709
  • 1
  • 9
  • 19

1 Answers1

2

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.

Luke
  • 11,374
  • 2
  • 48
  • 61