MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_figure

Method set_figure

lib/matplotlib/backend_managers.py:78–96  ·  view source on GitHub ↗

Bind the given figure to the tools. Parameters ---------- figure : `.Figure` update_tools : bool, default: True Force tools to update figure.

(self, figure, update_tools=True)

Source from the content-addressed store, hash-verified

76 self.set_figure(figure)
77
78 def set_figure(self, figure, update_tools=True):
79 """
80 Bind the given figure to the tools.
81
82 Parameters
83 ----------
84 figure : `.Figure`
85 update_tools : bool, default: True
86 Force tools to update figure.
87 """
88 if self._key_press_handler_id:
89 self.canvas.mpl_disconnect(self._key_press_handler_id)
90 self._figure = figure
91 if figure:
92 self._key_press_handler_id = self.canvas.mpl_connect(
93 'key_press_event', self._key_press)
94 if update_tools:
95 for tool in self._tools.values():
96 tool.figure = figure
97
98 def toolmanager_connect(self, s, func):
99 """

Callers 3

__init__Method · 0.95
figureMethod · 0.95
add_toolMethod · 0.45

Calls 3

mpl_disconnectMethod · 0.80
mpl_connectMethod · 0.80
valuesMethod · 0.80

Tested by

no test coverage detected