From b13062f081464d6950990d7e3add969e43e7d934 Mon Sep 17 00:00:00 2001 From: Mikhail Terekhov Date: Wed, 14 Dec 2016 22:39:39 -0500 Subject: [PATCH] In PlotDataItem.clear() use corresponding curve.clear() and scatter.clear() Otherwise when stepMode is True curve.setData([]) causes exception: "len(X) must be len(Y)+1 ..." --- pyqtgraph/graphicsItems/PlotDataItem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/graphicsItems/PlotDataItem.py b/pyqtgraph/graphicsItems/PlotDataItem.py index 2faa9ac1..1bf48f5d 100644 --- a/pyqtgraph/graphicsItems/PlotDataItem.py +++ b/pyqtgraph/graphicsItems/PlotDataItem.py @@ -627,9 +627,9 @@ class PlotDataItem(GraphicsObject): #self.yClean = None self.xDisp = None self.yDisp = None - self.curve.setData([]) - self.scatter.setData([]) - + self.curve.clear() + self.scatter.clear() + def appendData(self, *args, **kargs): pass