Merge pull request #417 from termim/PlotDataItem_clear
In PlotDataItem.clear() use corresponding curve.clear() and scatter.clear()
This commit is contained in:
commit
4a76fff11a
@ -630,8 +630,8 @@ class PlotDataItem(GraphicsObject):
|
|||||||
#self.yClean = None
|
#self.yClean = None
|
||||||
self.xDisp = None
|
self.xDisp = None
|
||||||
self.yDisp = None
|
self.yDisp = None
|
||||||
self.curve.setData([])
|
self.curve.clear()
|
||||||
self.scatter.setData([])
|
self.scatter.clear()
|
||||||
|
|
||||||
def appendData(self, *args, **kargs):
|
def appendData(self, *args, **kargs):
|
||||||
pass
|
pass
|
||||||
|
@ -58,3 +58,9 @@ def test_clear():
|
|||||||
|
|
||||||
assert pdi.xData == None
|
assert pdi.xData == None
|
||||||
assert pdi.yData == 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()
|
||||||
|
Loading…
Reference in New Issue
Block a user