matplotlib.backend_tools
¶Abstract base classes define the primitives for Tools.
These tools are used by matplotlib.backend_managers.ToolManager
ToolBase
ToolToggleBase
matplotlib.backend_managers.ToolManager
matplotlib.backend_tools.
AxisScaleBase
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolToggleBase
Base Tool to toggle between linear and logarithmic
disable
(event)[source]¶Disable the toggle tool
trigger
call this method when toggled
is True.
This can happen in different circumstances
matplotlib.backend_managers.ToolManager.trigger_tool
ToolToggleBase
derived tool is triggered
(from the same ToolManager
)matplotlib.backend_tools.
ConfigureSubplotsBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Base tool for the configuration of subplots
description
= 'Configure subplots'¶image
= 'subplots'¶matplotlib.backend_tools.
Cursors
[source]¶Bases: object
Simple namespace for cursor reference
HAND
= 0¶MOVE
= 3¶POINTER
= 1¶SELECT_REGION
= 2¶WAIT
= 4¶matplotlib.backend_tools.
RubberbandBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Draw and remove rubberband
trigger
(sender, event, data)[source]¶Call draw_rubberband
or remove_rubberband
based on data
matplotlib.backend_tools.
SaveFigureBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Base tool for figure saving
default_keymap
= ['s', 'ctrl+s']¶description
= 'Save the figure'¶image
= 'filesave'¶matplotlib.backend_tools.
SetCursorBase
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolBase
Change to the current cursor while inaxes
This tool, keeps track of all ToolToggleBase
derived tools, and calls
set_cursor when a tool gets triggered
matplotlib.backend_tools.
ToolBack
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ViewsPositionsBase
Move back up the view lim stack
default_keymap
= ['left', 'c', 'backspace']¶description
= 'Back to previous view'¶image
= 'back'¶matplotlib.backend_tools.
ToolBase
(toolmanager, name)[source]¶Bases: object
Base tool class
A base tool, only implements trigger
method or not method at all.
The tool is instantiated by matplotlib.backend_managers.ToolManager
Attributes: |
|
---|
canvas
¶default_keymap
= None¶Keymap to associate with this tool
String: List of comma separated keys that will be used to call this tool when the keypress event of self.figure.canvas is emitted
description
= None¶Description of the Tool
String: If the Tool is included in the Toolbar this text is used as a Tooltip
destroy
()[source]¶Destroy the tool
This method is called when the tool is removed by
matplotlib.backend_managers.ToolManager.remove_tool
figure
¶image
= None¶Filename of the image
String: Filename of the image to use in the toolbar. If None, the
name
is used as a label in the toolbar button
name
¶Tool Id
toolmanager
¶trigger
(sender, event, data=None)[source]¶Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ToolCopyToClipboardBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Tool to copy the figure to the clipboard
default_keymap
= ['ctrl+c', 'cmd+c']¶description
= 'Copy the canvas figure to clipboard'¶trigger
(*args, **kwargs)[source]¶Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ToolCursorPosition
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolBase
Send message with the current pointer position
This tool runs in the background reporting the position of the cursor
Bases: matplotlib.backend_tools.ToolBase
Tool to enable all axes for toolmanager interaction
Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
Bases: matplotlib.backend_tools.ToolBase
Tool to enable a specific axes for toolmanager interaction
Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ToolForward
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ViewsPositionsBase
Move forward in the view lim stack
default_keymap
= ['right', 'v']¶description
= 'Forward to next view'¶image
= 'forward'¶matplotlib.backend_tools.
ToolFullScreen
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolToggleBase
Tool to toggle full screen
default_keymap
= ['f', 'ctrl+f']¶description
= 'Toggle fullscreen mode'¶disable
(event)[source]¶Disable the toggle tool
trigger
call this method when toggled
is True.
This can happen in different circumstances
matplotlib.backend_managers.ToolManager.trigger_tool
ToolToggleBase
derived tool is triggered
(from the same ToolManager
)matplotlib.backend_tools.
ToolGrid
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools._ToolGridBase
Tool to toggle the major grids of the figure
default_keymap
= ['g']¶description
= 'Toggle major grids'¶matplotlib.backend_tools.
ToolHelpBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
default_keymap
= ['f1']¶description
= 'Print tool list, shortcuts and description'¶format_shortcut
(key_sequence)[source]¶Converts a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
image
= 'help.png'¶matplotlib.backend_tools.
ToolHome
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ViewsPositionsBase
Restore the original view lim
default_keymap
= ['h', 'r', 'home']¶description
= 'Reset original view'¶image
= 'home'¶matplotlib.backend_tools.
ToolMinorGrid
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools._ToolGridBase
Tool to toggle the major and minor grids of the figure
default_keymap
= ['G']¶description
= 'Toggle major and minor grids'¶matplotlib.backend_tools.
ToolPan
(*args)[source]¶Bases: matplotlib.backend_tools.ZoomPanBase
Pan axes with left mouse, zoom with right
cursor
= 3¶default_keymap
= ['p']¶description
= 'Pan axes with left mouse, zoom with right'¶image
= 'move'¶radio_group
= 'default'¶matplotlib.backend_tools.
ToolQuit
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Tool to call the figure manager destroy method
default_keymap
= ['ctrl+w', 'cmd+w', 'q']¶description
= 'Quit the figure'¶trigger
(sender, event, data=None)[source]¶Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ToolQuitAll
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Tool to call the figure manager destroy method
default_keymap
= ['W', 'cmd+W', 'Q']¶description
= 'Quit all figures'¶trigger
(sender, event, data=None)[source]¶Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ToolToggleBase
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolBase
Toggleable tool
Every time it is triggered, it switches between enable and disable
Parameters: |
|
---|
cursor
= None¶Cursor to use when the tool is active
default_toggled
= False¶Default of toggled state
disable
(event=None)[source]¶Disable the toggle tool
trigger
call this method when toggled
is True.
This can happen in different circumstances
matplotlib.backend_managers.ToolManager.trigger_tool
ToolToggleBase
derived tool is triggered
(from the same ToolManager
)radio_group
= None¶Attribute to group 'radio' like tools (mutually exclusive)
String that identifies the group or None if not belonging to a group
toggled
¶State of the toggled tool
matplotlib.backend_tools.
ToolViewsPositions
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.ToolBase
Auxiliary Tool to handle changes in views and positions
Runs in the background and should get used by all the tools that need to access the figure's history of views and positions, e.g.
push_current
(figure=None)[source]¶Push the current view limits and position onto their respective stacks
matplotlib.backend_tools.
ToolXScale
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the X axis
default_keymap
= ['k', 'L']¶description
= 'Toggle scale X axis'¶matplotlib.backend_tools.
ToolYScale
(*args, **kwargs)[source]¶Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the Y axis
default_keymap
= ['l']¶description
= 'Toggle scale Y axis'¶matplotlib.backend_tools.
ToolZoom
(*args)[source]¶Bases: matplotlib.backend_tools.ZoomPanBase
Zoom to rectangle
cursor
= 2¶default_keymap
= ['o']¶description
= 'Zoom to rectangle'¶image
= 'zoom_to_rect'¶radio_group
= 'default'¶matplotlib.backend_tools.
ViewsPositionsBase
(toolmanager, name)[source]¶Bases: matplotlib.backend_tools.ToolBase
Base class for ToolHome
, ToolBack
and ToolForward
trigger
(sender, event, data=None)[source]¶Called when this tool gets used
This method is called by
matplotlib.backend_managers.ToolManager.trigger_tool
Parameters: |
|
---|
matplotlib.backend_tools.
ZoomPanBase
(*args)[source]¶matplotlib.backend_tools.
add_tools_to_container
(container, tools=[['navigation', ['home', 'back', 'forward']], ['zoompan', ['pan', 'zoom', 'subplots']], ['io', ['save', 'help']]])[source]¶Add multiple tools to the container.
Parameters: |
|
---|
matplotlib.backend_tools.
add_tools_to_manager
(toolmanager, tools={'allnav': <class 'matplotlib.backend_tools.ToolEnableAllNavigation'>, 'back': <class 'matplotlib.backend_tools.ToolBack'>, 'copy': 'ToolCopyToClipboard', 'cursor': 'ToolSetCursor', 'forward': <class 'matplotlib.backend_tools.ToolForward'>, 'fullscreen': <class 'matplotlib.backend_tools.ToolFullScreen'>, 'grid': <class 'matplotlib.backend_tools.ToolGrid'>, 'grid_minor': <class 'matplotlib.backend_tools.ToolMinorGrid'>, 'help': 'ToolHelp', 'home': <class 'matplotlib.backend_tools.ToolHome'>, 'nav': <class 'matplotlib.backend_tools.ToolEnableNavigation'>, 'pan': <class 'matplotlib.backend_tools.ToolPan'>, 'position': <class 'matplotlib.backend_tools.ToolCursorPosition'>, 'quit': <class 'matplotlib.backend_tools.ToolQuit'>, 'quit_all': <class 'matplotlib.backend_tools.ToolQuitAll'>, 'rubberband': 'ToolRubberband', 'save': 'ToolSaveFigure', 'subplots': 'ToolConfigureSubplots', 'viewpos': <class 'matplotlib.backend_tools.ToolViewsPositions'>, 'xscale': <class 'matplotlib.backend_tools.ToolXScale'>, 'yscale': <class 'matplotlib.backend_tools.ToolYScale'>, 'zoom': <class 'matplotlib.backend_tools.ToolZoom'>})[source]¶Add multiple tools to ToolManager
Parameters: |
|
---|
matplotlib.backend_tools.
default_toolbar_tools
= [['navigation', ['home', 'back', 'forward']], ['zoompan', ['pan', 'zoom', 'subplots']], ['io', ['save', 'help']]]¶Default tools in the toolbar
matplotlib.backend_tools.
default_tools
= {'allnav': <class 'matplotlib.backend_tools.ToolEnableAllNavigation'>, 'back': <class 'matplotlib.backend_tools.ToolBack'>, 'copy': 'ToolCopyToClipboard', 'cursor': 'ToolSetCursor', 'forward': <class 'matplotlib.backend_tools.ToolForward'>, 'fullscreen': <class 'matplotlib.backend_tools.ToolFullScreen'>, 'grid': <class 'matplotlib.backend_tools.ToolGrid'>, 'grid_minor': <class 'matplotlib.backend_tools.ToolMinorGrid'>, 'help': 'ToolHelp', 'home': <class 'matplotlib.backend_tools.ToolHome'>, 'nav': <class 'matplotlib.backend_tools.ToolEnableNavigation'>, 'pan': <class 'matplotlib.backend_tools.ToolPan'>, 'position': <class 'matplotlib.backend_tools.ToolCursorPosition'>, 'quit': <class 'matplotlib.backend_tools.ToolQuit'>, 'quit_all': <class 'matplotlib.backend_tools.ToolQuitAll'>, 'rubberband': 'ToolRubberband', 'save': 'ToolSaveFigure', 'subplots': 'ToolConfigureSubplots', 'viewpos': <class 'matplotlib.backend_tools.ToolViewsPositions'>, 'xscale': <class 'matplotlib.backend_tools.ToolXScale'>, 'yscale': <class 'matplotlib.backend_tools.ToolYScale'>, 'zoom': <class 'matplotlib.backend_tools.ToolZoom'>}¶Default tools