Skip to content

Commit

Permalink
toggle tools for example
Browse files Browse the repository at this point in the history
  • Loading branch information
fariza committed May 15, 2015
1 parent 07d30a6 commit 11cc44f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/user_interfaces/multifigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
matplotlib.use('GTK3AGG')
# matplotlib.rcParams['backend.multifigure'] = False
matplotlib.rcParams['toolbar'] = 'toolmanager'
from matplotlib.backend_tools import ToolBase
from matplotlib.backend_tools import ToolToggleBase


from matplotlib.figure import Figure
from matplotlib.backend_managers import FigureManager


class t1(ToolBase):
class t1(ToolToggleBase):
radio_group = 'multifigure'
description = "change canvas"
def __init__(self, *args, **kwargs):
self.mfigure = kwargs.pop('figure')
ToolBase.__init__(self, *args, **kwargs)
ToolToggleBase.__init__(self, *args, **kwargs)

def trigger(self, *args, **kwargs):
def enable(self, *args, **kwargs):
self.toolmanager.manager.figure = self.mfigure


Expand Down

0 comments on commit 11cc44f

Please sign in to comment.