fixed a keyerror when passing a list into setBrush

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

Signed-off-by: Nicholas Tan Jerome <nicholas.jerome@kit.edu>
This commit is contained in:
Nicholas Tan Jerome 2014-10-17 10:57:36 +02:00
parent 5309483a60
commit 884df4934a

View File

@ -443,7 +443,7 @@ class ScatterPlotItem(GraphicsObject):
if len(args) == 1 and (isinstance(args[0], np.ndarray) or isinstance(args[0], list)):
brushes = args[0]
if kargs['mask'] is not None:
if 'mask' in kargs and kargs['mask'] is not None:
brushes = brushes[kargs['mask']]
if len(brushes) != len(dataSet):
raise Exception("Number of brushes does not match number of points (%d != %d)" % (len(brushes), len(dataSet)))