From 72a715753853267f3513cae799ccca831f4f9b29 Mon Sep 17 00:00:00 2001 From: Alexander Manakov Date: Fri, 4 Aug 2017 13:56:37 +0300 Subject: [PATCH] Added essential if. --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 597491f3..f426c91c 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -648,6 +648,9 @@ class ScatterPlotItem(GraphicsObject): d = d[mask] d2 = d2[mask] + if d.size == 0: + return (None, None) + if frac >= 1.0: self.bounds[ax] = (np.nanmin(d) - self._maxSpotWidth*0.7072, np.nanmax(d) + self._maxSpotWidth*0.7072) return self.bounds[ax]