From dbcdf7ec91e4b7b015d2f7be35497e868f0d57c3 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Tue, 27 Jul 2010 00:39:13 -0400 Subject: [PATCH] little fix --plots may contain nans now --- graphicsItems.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graphicsItems.py b/graphicsItems.py index a9f298d4..eff3cda1 100644 --- a/graphicsItems.py +++ b/graphicsItems.py @@ -376,8 +376,9 @@ class PlotCurveItem(GraphicsObject): if self.xData is None: return (None, None) if self.xDisp is None: - x = self.xData - y = self.yData + nanMask = isnan(self.xData) | isnan(self.yData) + x = self.xData[~nanMask] + y = self.yData[~nanMask] ds = self.opts['downsample'] if ds > 1: x = x[::ds] @@ -592,6 +593,8 @@ class PlotCurveItem(GraphicsObject): xmax = x.max() + pixels[0].x() * lineWidth ymin = y.min() - abs(pixels[1].y()) * lineWidth ymax = y.max() + abs(pixels[1].y()) * lineWidth + + return QtCore.QRectF(xmin, ymin, xmax-xmin, ymax-ymin) def paint(self, p, opt, widget):