Commit 884df493 authored by Nicholas Tan Jerome's avatar Nicholas Tan Jerome
Browse files

fixed a keyerror when passing a list into setBrush

- https://groups.google.com/forum/#!topic/pyqtgraph/xVyCC2f7gVo

Signed-off-by: default avatarNicholas Tan Jerome <nicholas.jerome@kit.edu>
parent 5309483a
...@@ -443,7 +443,7 @@ class ScatterPlotItem(GraphicsObject): ...@@ -443,7 +443,7 @@ class ScatterPlotItem(GraphicsObject):
if len(args) == 1 and (isinstance(args[0], np.ndarray) or isinstance(args[0], list)): if len(args) == 1 and (isinstance(args[0], np.ndarray) or isinstance(args[0], list)):
brushes = args[0] brushes = args[0]
if kargs['mask'] is not None: if 'mask' in kargs and kargs['mask'] is not None:
brushes = brushes[kargs['mask']] brushes = brushes[kargs['mask']]
if len(brushes) != len(dataSet): if len(brushes) != len(dataSet):
raise Exception("Number of brushes does not match number of points (%d != %d)" % (len(brushes), len(dataSet))) raise Exception("Number of brushes does not match number of points (%d != %d)" % (len(brushes), len(dataSet)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment