diff --git a/CHANGELOG b/CHANGELOG index fd48d5b2..41f63e9d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,8 @@ pyqtgraph-0.9.9 [unreleased] - fixed ImageItem handling of rgb images - fixed makeARGB re-ordering of color channels - fixed unicode usage in AxisItem tick strings + - fixed PlotCurveItem generating exceptions when data has length=0 + - fixed ImageView.setImage only working once pyqtgraph-0.9.8 2013-11-24 diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index b2beaa99..ea337100 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -393,16 +393,18 @@ class PlotCurveItem(GraphicsObject): if self.path is None: x,y = self.getData() if x is None or len(x) == 0 or y is None or len(y) == 0: - return QtGui.QPainterPath() - self.path = self.generatePath(*self.getData()) + self.path = QtGui.QPainterPath() + else: + self.path = self.generatePath(*self.getData()) self.fillPath = None self._mouseShape = None + return self.path @debug.warnOnException ## raising an exception here causes crash def paint(self, p, opt, widget): profiler = debug.Profiler() - if self.xData is None: + if self.xData is None or len(self.xData) == 0: return if HAVE_OPENGL and getConfigOption('enableExperimental') and isinstance(widget, QtOpenGL.QGLWidget): diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index d4458a0e..c50a54c0 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -198,6 +198,7 @@ class ImageView(QtGui.QWidget): if not isinstance(img, np.ndarray): raise Exception("Image must be specified as ndarray.") self.image = img + self.imageDisp = None if xvals is not None: self.tVals = xvals