Fix errors getting bounds on nanny data

This commit is contained in:
Luke Campagnola 2017-07-14 15:10:16 -07:00
parent e87eaa652d
commit d343eb044d

View File

@ -132,6 +132,8 @@ class PlotCurveItem(GraphicsObject):
if any(np.isinf(b)): if any(np.isinf(b)):
mask = np.isfinite(d) mask = np.isfinite(d)
d = d[mask] d = d[mask]
if len(d) == 0:
return (None, None)
b = (d.min(), d.max()) b = (d.min(), d.max())
elif frac <= 0.0: elif frac <= 0.0:
@ -173,7 +175,7 @@ class PlotCurveItem(GraphicsObject):
if self._boundingRect is None: if self._boundingRect is None:
(xmn, xmx) = self.dataBounds(ax=0) (xmn, xmx) = self.dataBounds(ax=0)
(ymn, ymx) = self.dataBounds(ax=1) (ymn, ymx) = self.dataBounds(ax=1)
if xmn is None: if xmn is None or ymn is None:
return QtCore.QRectF() return QtCore.QRectF()
px = py = 0.0 px = py = 0.0