- work on ShapeCollectionLegacy
This commit is contained in:
@@ -648,9 +648,8 @@ class MplCursor(Cursor):
|
||||
|
||||
class ShapeCollectionLegacy():
|
||||
|
||||
def __init__(self, obj):
|
||||
def __init__(self):
|
||||
self._shapes = []
|
||||
self.setup_axes(obj=obj)
|
||||
|
||||
def add(self, shape):
|
||||
try:
|
||||
@@ -668,17 +667,4 @@ class ShapeCollectionLegacy():
|
||||
def redraw(self):
|
||||
pass
|
||||
|
||||
def setup_axes(self, obj):
|
||||
# Axes must exist and be attached to canvas.
|
||||
if obj.axes is None or obj.axes not in obj.app.plotcanvas.figure.axes:
|
||||
obj.axes = obj.app.plotcanvas.new_axes(obj.options['name'])
|
||||
|
||||
if not obj.options["plot"]:
|
||||
obj.axes.cla()
|
||||
obj.app.plotcanvas.auto_adjust_axes()
|
||||
return False
|
||||
|
||||
# Clear axes or we will plot on top of them.
|
||||
obj.axes.cla() # TODO: Thread safe?
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user