Merge pull request #417 from termim/PlotDataItem_clear

In PlotDataItem.clear() use corresponding curve.clear() and scatter.clear()
This commit is contained in:
Ogi Moore 2019-05-23 21:52:50 -07:00 committed by GitHub
commit 4a76fff11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -630,8 +630,8 @@ 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

View File

@ -58,3 +58,9 @@ def test_clear():
assert pdi.xData == None
assert pdi.yData == None
def test_clear_in_step_mode():
w = pg.PlotWidget()
c = pg.PlotDataItem([1,4,2,3], [5,7,6], stepMode=True)
w.addItem(c)
c.clear()