From 884df4934af6eadaa0065b700853838a32440576 Mon Sep 17 00:00:00 2001 From: Nicholas Tan Jerome Date: Fri, 17 Oct 2014 10:57:36 +0200 Subject: [PATCH 1/2] fixed a keyerror when passing a list into setBrush - https://groups.google.com/forum/#!topic/pyqtgraph/xVyCC2f7gVo Signed-off-by: Nicholas Tan Jerome --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index f1a5201d..ebff4442 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -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))) From 7356126c3d2b11e7abcd7c0b34f03dbd81d69d51 Mon Sep 17 00:00:00 2001 From: Nicholas Tan Jerome Date: Fri, 17 Oct 2014 11:18:12 +0200 Subject: [PATCH 2/2] added "mask" key check on setPen as well Signed-off-by: Nicholas Tan Jerome --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index ebff4442..584d455e 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -421,7 +421,7 @@ class ScatterPlotItem(GraphicsObject): if len(args) == 1 and (isinstance(args[0], np.ndarray) or isinstance(args[0], list)): pens = args[0] - if kargs['mask'] is not None: + if if 'mask' in kargs and kargs['mask'] is not None: pens = pens[kargs['mask']] if len(pens) != len(dataSet): raise Exception("Number of pens does not match number of points (%d != %d)" % (len(pens), len(dataSet)))