Skip to content

Commit 11cc44f

Browse files
committed
toggle tools for example
1 parent 07d30a6 commit 11cc44f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/user_interfaces/multifigure.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
matplotlib.use('GTK3AGG')
44
# matplotlib.rcParams['backend.multifigure'] = False
55
matplotlib.rcParams['toolbar'] = 'toolmanager'
6-
from matplotlib.backend_tools import ToolBase
6+
from matplotlib.backend_tools import ToolToggleBase
77

88

99
from matplotlib.figure import Figure
1010
from matplotlib.backend_managers import FigureManager
1111

1212

13-
class t1(ToolBase):
13+
class t1(ToolToggleBase):
14+
radio_group = 'multifigure'
1415
description = "change canvas"
1516
def __init__(self, *args, **kwargs):
1617
self.mfigure = kwargs.pop('figure')
17-
ToolBase.__init__(self, *args, **kwargs)
18+
ToolToggleBase.__init__(self, *args, **kwargs)
1819

19-
def trigger(self, *args, **kwargs):
20+
def enable(self, *args, **kwargs):
2021
self.toolmanager.manager.figure = self.mfigure
2122

2223

0 commit comments

Comments
 (0)