From 001d91c2f2b2aea66b0259590373f29db5dbec5c Mon Sep 17 00:00:00 2001 From: Ogi Date: Thu, 11 Jun 2020 22:56:20 -0700 Subject: [PATCH] Implement PR160 - clear current SpotItems --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 5bbdffe7..63dc61cb 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -379,6 +379,9 @@ class ScatterPlotItem(GraphicsObject): kargs['y'] = [] numPts = 0 + ## Clear current SpotItems since the data references they contain will no longer be current + self.data['item'][...] = None + ## Extend record array oldData = self.data self.data = np.empty(len(oldData)+numPts, dtype=self.data.dtype)