From d343eb044de8decf2e07ca6b9ed851398ee763e0 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Fri, 14 Jul 2017 15:10:16 -0700 Subject: [PATCH] Fix errors getting bounds on nanny data --- pyqtgraph/graphicsItems/PlotCurveItem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index d66a8a99..fac9ee57 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -132,6 +132,8 @@ class PlotCurveItem(GraphicsObject): if any(np.isinf(b)): mask = np.isfinite(d) d = d[mask] + if len(d) == 0: + return (None, None) b = (d.min(), d.max()) elif frac <= 0.0: @@ -173,7 +175,7 @@ class PlotCurveItem(GraphicsObject): if self._boundingRect is None: (xmn, xmx) = self.dataBounds(ax=0) (ymn, ymx) = self.dataBounds(ax=1) - if xmn is None: + if xmn is None or ymn is None: return QtCore.QRectF() px = py = 0.0