File "d:\python36-32\lib\site-packages\pyqtgraph\graphicsItems\CurvePoint.py", line 64, in event
index = (len(x)-1) * np.clip(pos, 0.0, 1.0)
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "d:\python36-32\lib\site-packages\pyqtgraph\graphicsItems\CurvePoint.py", line 74, in event
i1 = np.clip(index-1, 0, len(x)-1)
TypeError: object of type 'NoneType' has no len()
import pyqtgraph as pg
import numpy as np
t = 0
walk = 0
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
win = pg.GraphicsWindow()
win.setWindowTitle('pyqtgraph example: Scrolling Plots')
win.nextRow()
p3 = win.addPlot()
p3.setDownsampling(mode='peak')
p3.setClipToView(True)
p3.setRange(xRange=[-10000, 0])
p3.setLimits(xMax=0)
curve3 = p3.plot(pen=None, symbol='o', symbolPen=None, symbolSize=2, symbolBrush=(102, 000, 000, 255))
curvePoint = pg.CurvePoint(curve3)
arrow2 = pg.ArrowItem(angle=310)
arrow2.setParentItem(curvePoint)
data3 = deque()
def randomWalk():
global t, walk
t = np.random.randint(-1,2)
walk += t
return walk
def update2():
global data3, curvePoint
data3.append( randomWalk() )
if len(data3) <= 10000:
curve3.setData(data3)
curve3.setPos(-10000, 0)
curvePoint.setPos( len(data3) )
else:
data3.popleft()
curve3.setData(data3)
curve3.setPos(-10000, 0)
curvePoint.setPos( len(data3) )
def update():
update2()
timer = pg.QtCore.QTimer()
timer.timeout.connect(update)
timer.start(1)
--
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 pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/819d65af-94b9-477a-ad35-66ace730e472%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.