From ad20103ccca980dbef23987bfed5406dc66d91a0 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sun, 17 Mar 2013 14:26:23 -0400 Subject: [PATCH] Check for length=0 arrays when using autoVisible --- pyqtgraph/graphicsItems/PlotCurveItem.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index c5a8ec3f..d707a347 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -112,7 +112,10 @@ class PlotCurveItem(GraphicsObject): if orthoRange is not None: mask = (d2 >= orthoRange[0]) * (d2 <= orthoRange[1]) d = d[mask] - d2 = d2[mask] + #d2 = d2[mask] + + if len(d) == 0: + return (None, None) ## Get min/max (or percentiles) of the requested data range if frac >= 1.0: