So I managed to get this working but its incredibly slow on large data
sets. Is there a better way to do this?
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
import numpy as np
win = pg.GraphicsWindow()
p1 = win.addPlot()
values = [10,50,8,64,45,9,6,12,6,43,3,7,33,67,82,42,12,7,40,8]
for i in range(len(values)-1):
if values[i]>values[i+1]:
p1.plot([i,i+1],values[i:i+2], pen=(255,0,0))
else:
p1.plot([i,i+1],values[i:i+2], pen=(0,255,0))
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/f472ca00-e631-4051-b852-4f7ddbf0acea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.