matplotlib.backend_managers¶matplotlib.backend_managers.ToolEvent(name, sender, tool, data=None)[source]¶Bases: object
Event for tool manipulation (add/remove).
matplotlib.backend_managers.ToolManager(figure=None)[source]¶Bases: object
Manager for actions triggered by user interactions (key press, toolbar clicks, ...) on a Figure.
| Attributes: |
|---|
active_toggle¶Currently toggled tools.
add_tool(self, name, tool, *args, **kwargs)[source]¶Add tool to ToolManager.
If successful, adds a new event tool_trigger_{name} where
{name} is the name of the tool; the event is fired everytime the
tool is triggered.
| Parameters: |
|
|---|
See also
matplotlib.backend_tools.ToolBaseNotes
args and kwargs get passed directly to the tools constructor.
canvas¶Canvas managed by FigureManager.
figure¶Figure that holds the canvas.
get_tool(self, name, warn=True)[source]¶Return the tool object, also accepts the actual tool for convenience.
| Parameters: |
|
|---|
get_tool_keymap(self, name)[source]¶Get the keymap associated with the specified tool.
| Parameters: |
|
|---|---|
| Returns: |
|
message_event(self, message, sender=None)[source]¶Emit a ToolManagerMessageEvent.
set_figure(self, figure, update_tools=True)[source]¶Bind the given figure to the tools.
| Parameters: |
|
|---|
toolmanager_connect(self, s, func)[source]¶Connect event with string s to func.
| Parameters: |
|
|---|
toolmanager_disconnect(self, cid)[source]¶Disconnect callback id cid.
Example usage:
cid = toolmanager.toolmanager_connect('tool_trigger_zoom', onpress)
#...later
toolmanager.toolmanager_disconnect(cid)
tools¶A dict mapping tool name -> controlled tool.
trigger_tool(self, name, sender=None, canvasevent=None, data=None)[source]¶Trigger a tool and emit the tool_trigger_{name} event.
| Parameters: |
|
|---|
matplotlib.backend_managers.ToolManagerMessageEvent(name, sender, message)[source]¶Bases: object
Event carrying messages from toolmanager.
Messages usually get displayed to the user by the toolbar.
matplotlib.backend_managers.ToolTriggerEvent(name, sender, tool, canvasevent=None, data=None)[source]¶Bases: matplotlib.backend_managers.ToolEvent
Event to inform that a tool has been triggered.