code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
matplotlib matplotlib.backend_tools matplotlib.backend\_tools
=========================
Abstract base classes define the primitives for Tools. These tools are used by [`matplotlib.backend_managers.ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")
[`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Simple stateless tool
[`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase")
Tool that has two states, only one Toggle tool can be active at any given time for the same [`matplotlib.backend_managers.ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")
*class*matplotlib.backend\_tools.AxisScaleBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L444-L458)
Bases: [`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase")
Base Tool to toggle between linear and logarithmic.
disable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L456-L458)
Disable the toggle tool.
[`trigger`](#matplotlib.backend_tools.AxisScaleBase.trigger "matplotlib.backend_tools.AxisScaleBase.trigger") call this method when `toggled` is True.
This can happen in different circumstances.
* Click on the toolbar tool button.
* Call to [`matplotlib.backend_managers.ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
* Another [`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase") derived tool is triggered (from the same [`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")).
enable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L452-L454)
Enable the toggle tool.
[`trigger`](#matplotlib.backend_tools.AxisScaleBase.trigger "matplotlib.backend_tools.AxisScaleBase.trigger") calls this method when `toggled` is False.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L447-L450)
Calls [`enable`](#matplotlib.backend_tools.AxisScaleBase.enable "matplotlib.backend_tools.AxisScaleBase.enable") or [`disable`](#matplotlib.backend_tools.AxisScaleBase.disable "matplotlib.backend_tools.AxisScaleBase.disable") based on `toggled` value.
*class*matplotlib.backend\_tools.ConfigureSubplotsBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L651-L655)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Base tool for the configuration of subplots.
description*='Configure subplots'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='subplots'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.Cursors(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L29-L37)
Bases: [`IntEnum`](https://docs.python.org/3/library/enum.html#enum.IntEnum "(in Python v3.10)")
Backend-independent cursor types.
HAND*=2*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
MOVE*=4*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
POINTER*=1*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
RESIZE\_HORIZONTAL*=6*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
RESIZE\_VERTICAL*=7*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
SELECT\_REGION*=3*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
WAIT*=5*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
*class*matplotlib.backend\_tools.RubberbandBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L356-L381)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Draw and remove a rubberband.
draw\_rubberband(*\*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L367-L373)
Draw rubberband.
This method must get implemented per backend.
remove\_rubberband()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L375-L381)
Remove rubberband.
This method should get implemented per backend.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L358-L365)
Call [`draw_rubberband`](#matplotlib.backend_tools.RubberbandBase.draw_rubberband "matplotlib.backend_tools.RubberbandBase.draw_rubberband") or [`remove_rubberband`](#matplotlib.backend_tools.RubberbandBase.remove_rubberband "matplotlib.backend_tools.RubberbandBase.remove_rubberband") based on data.
*class*matplotlib.backend\_tools.SaveFigureBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L658-L663)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Base tool for figure saving.
*property*default\_keymap
description*='Save the figure'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='filesave'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.SetCursorBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L255-L318)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Change to the current cursor while inaxes.
This tool, keeps track of all [`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase") derived tools, and calls [`set_cursor`](#matplotlib.backend_tools.SetCursorBase.set_cursor "matplotlib.backend_tools.SetCursorBase.set_cursor") when a tool gets triggered.
set\_cursor(*cursor*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L313-L318)
[*Deprecated*] Set the cursor.
#### Notes
Deprecated since version 3.5: Use [`FigureCanvasBase.set_cursor`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.set_cursor "matplotlib.backend_bases.FigureCanvasBase.set_cursor") instead.
set\_figure(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L274-L280)
*class*matplotlib.backend\_tools.ToolBack(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L633-L639)
Bases: [`ViewsPositionsBase`](#matplotlib.backend_tools.ViewsPositionsBase "matplotlib.backend_tools.ViewsPositionsBase")
Move back up the view limits stack.
*property*default\_keymap
description*='Back to previous view'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='back'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.ToolBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L73-L165)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Base tool class.
A base tool, only implements [`trigger`](#matplotlib.backend_tools.ToolBase.trigger "matplotlib.backend_tools.ToolBase.trigger") method or no method at all. The tool is instantiated by [`matplotlib.backend_managers.ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager").
*property*canvas
The canvas of the figure affected by this tool, or None.
default\_keymap*=None*
Keymap to associate with this tool.
`list[str]`: List of keys that will trigger this tool when a keypress event is emitted on `self.figure.canvas`. Note that this attribute is looked up on the instance, and can therefore be a property (this is used e.g. by the built-in tools to load the rcParams at instantiation time).
description*=None*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
destroy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L158-L165)
[*Deprecated*] Destroy the tool.
This method is called by [`ToolManager.remove_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.remove_tool "matplotlib.backend_managers.ToolManager.remove_tool").
#### Notes
Deprecated since version 3.6: Use tool\_removed\_event instead.
*property*figure
The Figure affected by this tool, or None.
image*=None*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*property*name
The tool id (str, must be unique among tools of a tool manager).
set\_figure(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L126-L128)
*property*toolmanager
The [`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager") that controls this tool.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L141-L156)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolCopyToClipboardBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L958-L966)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to copy the figure to the clipboard.
*property*default\_keymap
description*='Copy the canvas figure to clipboard'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L964-L966)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolCursorPosition(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L326-L353)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Send message with the current pointer position.
This tool runs in the background reporting the position of the cursor.
send\_message(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L344-L353)
Call [`matplotlib.backend_managers.ToolManager.message_event`](backend_managers_api#matplotlib.backend_managers.ToolManager.message_event "matplotlib.backend_managers.ToolManager.message_event").
set\_figure(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L336-L342)
*class*matplotlib.backend\_tools.ToolForward(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L642-L648)
Bases: [`ViewsPositionsBase`](#matplotlib.backend_tools.ViewsPositionsBase "matplotlib.backend_tools.ViewsPositionsBase")
Move forward in the view lim stack.
*property*default\_keymap
description*='Forward to next view'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='forward'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.ToolFullScreen(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L434-L441)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to toggle full screen.
*property*default\_keymap
description*='Toggle fullscreen mode'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L440-L441)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolGrid(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L404-L416)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to toggle the major grids of the figure.
*property*default\_keymap
description*='Toggle major grids'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L410-L416)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolHelpBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L920-L955)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
*property*default\_keymap
description*='Print tool list, shortcuts and description'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
*static*format\_shortcut(*key\_sequence*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L925-L932)
Convert 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'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.ToolHome(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L624-L630)
Bases: [`ViewsPositionsBase`](#matplotlib.backend_tools.ViewsPositionsBase "matplotlib.backend_tools.ViewsPositionsBase")
Restore the original view limits.
*property*default\_keymap
description*='Reset original view'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='home'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
*class*matplotlib.backend\_tools.ToolMinorGrid(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L419-L431)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to toggle the major and minor grids of the figure.
*property*default\_keymap
description*='Toggle major and minor grids'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L425-L431)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolPan(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L854-L917)
Bases: [`ZoomPanBase`](#matplotlib.backend_tools.ZoomPanBase "matplotlib.backend_tools.ZoomPanBase")
Pan axes with left mouse, zoom with right.
cursor*=4*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
Cursor to use when the tool is active.
*property*default\_keymap
description*='Pan axes with left mouse, zoom with right'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='move'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
radio\_group*='default'*
Attribute to group 'radio' like tools (mutually exclusive).
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") that identifies the group or **None** if not belonging to a group.
*class*matplotlib.backend\_tools.ToolQuit(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L384-L391)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to call the figure manager destroy method.
*property*default\_keymap
description*='Quit the figure'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L390-L391)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ToolQuitAll(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L394-L401)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Tool to call the figure manager destroy method.
*property*default\_keymap
description*='Quit all figures'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L400-L401)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
matplotlib.backend\_tools.ToolSetCursor[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L255-L318)
alias of [`SetCursorBase`](#matplotlib.backend_tools.SetCursorBase "matplotlib.backend_tools.SetCursorBase")
*class*matplotlib.backend\_tools.ToolToggleBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L168-L252)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Toggleable tool.
Every time it is triggered, it switches between enable and disable.
Parameters:
**``\*args``**
Variable length argument to be used by the Tool.
**``\*\*kwargs``**
[`toggled`](#matplotlib.backend_tools.ToolToggleBase.toggled "matplotlib.backend_tools.ToolToggleBase.toggled") if present and True, sets the initial state of the Tool Arbitrary keyword arguments to be consumed by the Tool
cursor*=None*
Cursor to use when the tool is active.
default\_toggled*=False*
Default of toggled state.
disable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L216-L229)
Disable the toggle tool.
[`trigger`](#matplotlib.backend_tools.ToolToggleBase.trigger "matplotlib.backend_tools.ToolToggleBase.trigger") call this method when [`toggled`](#matplotlib.backend_tools.ToolToggleBase.toggled "matplotlib.backend_tools.ToolToggleBase.toggled") is True.
This can happen in different circumstances.
* Click on the toolbar tool button.
* Call to [`matplotlib.backend_managers.ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
* Another [`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase") derived tool is triggered (from the same [`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")).
enable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L208-L214)
Enable the toggle tool.
[`trigger`](#matplotlib.backend_tools.ToolToggleBase.trigger "matplotlib.backend_tools.ToolToggleBase.trigger") calls this method when [`toggled`](#matplotlib.backend_tools.ToolToggleBase.toggled "matplotlib.backend_tools.ToolToggleBase.toggled") is False.
radio\_group*=None*
Attribute to group 'radio' like tools (mutually exclusive).
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") that identifies the group or **None** if not belonging to a group.
set\_figure(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L236-L252)
*property*toggled
State of the toggled tool.
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L200-L206)
Calls [`enable`](#matplotlib.backend_tools.ToolToggleBase.enable "matplotlib.backend_tools.ToolToggleBase.enable") or [`disable`](#matplotlib.backend_tools.ToolToggleBase.disable "matplotlib.backend_tools.ToolToggleBase.disable") based on [`toggled`](#matplotlib.backend_tools.ToolToggleBase.toggled "matplotlib.backend_tools.ToolToggleBase.toggled") value.
*class*matplotlib.backend\_tools.ToolViewsPositions(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L481-L609)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "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.
* [`ToolZoom`](#matplotlib.backend_tools.ToolZoom "matplotlib.backend_tools.ToolZoom")
* [`ToolPan`](#matplotlib.backend_tools.ToolPan "matplotlib.backend_tools.ToolPan")
* [`ToolHome`](#matplotlib.backend_tools.ToolHome "matplotlib.backend_tools.ToolHome")
* [`ToolBack`](#matplotlib.backend_tools.ToolBack "matplotlib.backend_tools.ToolBack")
* [`ToolForward`](#matplotlib.backend_tools.ToolForward "matplotlib.backend_tools.ToolForward")
add\_figure(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L501-L511)
Add the current figure to the stack of views and positions.
back()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L601-L604)
Back one step in the stack of views and positions.
clear(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L513-L519)
Reset the axes stack.
forward()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L606-L609)
Forward one step in the stack of views and positions.
home()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L596-L599)
Recall the first view and position from the stack.
push\_current(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L552-L564)
Push the current view limits and position onto their respective stacks.
update\_home\_views(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L584-L594)
Make sure that `self.home_views` has an entry for all axes present in the figure.
update\_view()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L521-L550)
Update the view limits and position for each axes from the current stack position. If any axes are present in the figure that aren't in the current stack position, use the home view limits for those axes and don't update *any* positions.
*class*matplotlib.backend\_tools.ToolXScale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L471-L478)
Bases: [`AxisScaleBase`](#matplotlib.backend_tools.AxisScaleBase "matplotlib.backend_tools.AxisScaleBase")
Tool to toggle between linear and logarithmic scales on the X axis.
*property*default\_keymap
description*='Toggle scale X axis'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
set\_scale(*ax*, *scale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L477-L478)
*class*matplotlib.backend\_tools.ToolYScale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L461-L468)
Bases: [`AxisScaleBase`](#matplotlib.backend_tools.AxisScaleBase "matplotlib.backend_tools.AxisScaleBase")
Tool to toggle between linear and logarithmic scales on the Y axis.
*property*default\_keymap
description*='Toggle scale Y axis'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
set\_scale(*ax*, *scale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L467-L468)
*class*matplotlib.backend\_tools.ToolZoom(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L733-L851)
Bases: [`ZoomPanBase`](#matplotlib.backend_tools.ZoomPanBase "matplotlib.backend_tools.ZoomPanBase")
A Tool for zooming using a rectangle selector.
cursor*=3*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py)
Cursor to use when the tool is active.
*property*default\_keymap
description*='Zoom to rectangle'*
Description of the Tool.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Tooltip used if the Tool is included in a Toolbar.
image*='zoom\_to\_rect'*
Filename of the image.
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"): Filename of the image to use in a Toolbar. If None, the *name* is used as a label in the toolbar button.
radio\_group*='default'*
Attribute to group 'radio' like tools (mutually exclusive).
[`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") that identifies the group or **None** if not belonging to a group.
*class*matplotlib.backend\_tools.ViewsPositionsBase(*toolmanager*, *name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L612-L621)
Bases: [`ToolBase`](#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Base class for [`ToolHome`](#matplotlib.backend_tools.ToolHome "matplotlib.backend_tools.ToolHome"), [`ToolBack`](#matplotlib.backend_tools.ToolBack "matplotlib.backend_tools.ToolBack") and [`ToolForward`](#matplotlib.backend_tools.ToolForward "matplotlib.backend_tools.ToolForward").
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L617-L621)
Called when this tool gets used.
This method is called by [`ToolManager.trigger_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.trigger_tool "matplotlib.backend_managers.ToolManager.trigger_tool").
Parameters:
**event**[`Event`](backend_bases_api#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The canvas event that caused this tool to be called.
**sender**object
Object that requested the tool to be triggered.
**data**object
Extra data.
*class*matplotlib.backend\_tools.ZoomPanBase(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L666-L730)
Bases: [`ToolToggleBase`](#matplotlib.backend_tools.ToolToggleBase "matplotlib.backend_tools.ToolToggleBase")
Base class for [`ToolZoom`](#matplotlib.backend_tools.ToolZoom "matplotlib.backend_tools.ToolZoom") and [`ToolPan`](#matplotlib.backend_tools.ToolPan "matplotlib.backend_tools.ToolPan").
disable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L689-L695)
Release the canvas and disconnect press/release events.
enable(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L679-L687)
Connect press/release events and lock the canvas.
scroll\_zoom(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L704-L730)
trigger(*sender*, *event*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L697-L702)
Calls [`enable`](#matplotlib.backend_tools.ZoomPanBase.enable "matplotlib.backend_tools.ZoomPanBase.enable") or [`disable`](#matplotlib.backend_tools.ZoomPanBase.disable "matplotlib.backend_tools.ZoomPanBase.disable") based on `toggled` value.
matplotlib.backend\_tools.add\_tools\_to\_container(*container*, *tools=[['navigation', ['home', 'back', 'forward']], ['zoompan', ['pan', 'zoom', 'subplots']], ['io', ['save', 'help']]]*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L1010-L1027)
Add multiple tools to the container.
Parameters:
**container**Container
[`backend_bases.ToolContainerBase`](backend_bases_api#matplotlib.backend_bases.ToolContainerBase "matplotlib.backend_bases.ToolContainerBase") object that will get the tools added.
**tools**list, optional
List in the form `[[group1, [tool1, tool2 ...]], [group2, [...]]]` where the tools `[tool1, tool2, ...]` will display in group1. See [`backend_bases.ToolContainerBase.add_tool`](backend_bases_api#matplotlib.backend_bases.ToolContainerBase.add_tool "matplotlib.backend_bases.ToolContainerBase.add_tool") for details.
matplotlib.backend\_tools.add\_tools\_to\_manager(*toolmanager*, *tools={'back': <class 'matplotlib.backend\_tools.ToolBack'>*, *'copy': <class 'matplotlib.backend\_tools.ToolCopyToClipboardBase'>*, *'cursor': <class 'matplotlib.backend\_tools.SetCursorBase'>*, *'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': <class 'matplotlib.backend\_tools.ToolHelpBase'>*, *'home': <class 'matplotlib.backend\_tools.ToolHome'>*, *'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': <class 'matplotlib.backend\_tools.RubberbandBase'>*, *'save': <class 'matplotlib.backend\_tools.SaveFigureBase'>*, *'subplots': <class 'matplotlib.backend\_tools.ConfigureSubplotsBase'>*, *'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]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L993-L1007)
Add multiple tools to a [`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager").
Parameters:
**toolmanager**[`backend_managers.ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")
Manager to which the tools are added.
**tools**{str: class\_like}, optional
The tools to add in a {name: tool} dict, see [`backend_managers.ToolManager.add_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.add_tool "matplotlib.backend_managers.ToolManager.add_tool") for more info.
matplotlib.backend\_tools.cursors[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_tools.py#L29-L37)
alias of [`Cursors`](#matplotlib.backend_tools.Cursors "matplotlib.backend_tools.Cursors")
| programming_docs |
matplotlib matplotlib.animation matplotlib.animation
====================
Table of Contents
* [Animation](#animation)
* [Writer Classes](#writer-classes)
* [Helper Classes](#helper-classes)
Animation
---------
The easiest way to make a live animation in Matplotlib is to use one of the [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") classes.
| | |
| --- | --- |
| [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") | A base class for Animations. |
| [`FuncAnimation`](_as_gen/matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation") | Makes an animation by repeatedly calling a function *func*. |
| [`ArtistAnimation`](_as_gen/matplotlib.animation.artistanimation#matplotlib.animation.ArtistAnimation "matplotlib.animation.ArtistAnimation") | Animation using a fixed set of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") objects. |
In both cases it is critical to keep a reference to the instance object. The animation is advanced by a timer (typically from the host GUI framework) which the [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") object holds the only reference to. If you do not hold a reference to the [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") object, it (and hence the timers) will be garbage collected which will stop the animation.
To save an animation use [`Animation.save`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation.save "matplotlib.animation.Animation.save"), [`Animation.to_html5_video`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation.to_html5_video "matplotlib.animation.Animation.to_html5_video"), or [`Animation.to_jshtml`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation.to_jshtml "matplotlib.animation.Animation.to_jshtml").
See [Helper Classes](#ani-writer-classes) below for details about what movie formats are supported.
### `FuncAnimation`
The inner workings of [`FuncAnimation`](_as_gen/matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation") is more-or-less:
```
for d in frames:
artists = func(d, *fargs)
fig.canvas.draw_idle()
fig.canvas.start_event_loop(interval)
```
with details to handle 'blitting' (to dramatically improve the live performance), to be non-blocking, not repeatedly start/stop the GUI event loop, handle repeats, multiple animated axes, and easily save the animation to a movie file.
'Blitting' is a [standard technique](https://en.wikipedia.org/wiki/Bit_blit) in computer graphics. The general gist is to take an existing bit map (in our case a mostly rasterized figure) and then 'blit' one more artist on top. Thus, by managing a saved 'clean' bitmap, we can only re-draw the few artists that are changing at each frame and possibly save significant amounts of time. When we use blitting (by passing `blit=True`), the core loop of [`FuncAnimation`](_as_gen/matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation") gets a bit more complicated:
```
ax = fig.gca()
def update_blit(artists):
fig.canvas.restore_region(bg_cache)
for a in artists:
a.axes.draw_artist(a)
ax.figure.canvas.blit(ax.bbox)
artists = init_func()
for a in artists:
a.set_animated(True)
fig.canvas.draw()
bg_cache = fig.canvas.copy_from_bbox(ax.bbox)
for f in frames:
artists = func(f, *fargs)
update_blit(artists)
fig.canvas.start_event_loop(interval)
```
This is of course leaving out many details (such as updating the background when the figure is resized or fully re-drawn). However, this hopefully minimalist example gives a sense of how `init_func` and `func` are used inside of [`FuncAnimation`](_as_gen/matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation") and the theory of how 'blitting' works.
The expected signature on `func` and `init_func` is very simple to keep [`FuncAnimation`](_as_gen/matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation") out of your book keeping and plotting logic, but this means that the callable objects you pass in must know what artists they should be working on. There are several approaches to handling this, of varying complexity and encapsulation. The simplest approach, which works quite well in the case of a script, is to define the artist at a global scope and let Python sort things out. For example
```
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig, ax = plt.subplots()
xdata, ydata = [], []
ln, = ax.plot([], [], 'ro')
def init():
ax.set_xlim(0, 2*np.pi)
ax.set_ylim(-1, 1)
return ln,
def update(frame):
xdata.append(frame)
ydata.append(np.sin(frame))
ln.set_data(xdata, ydata)
return ln,
ani = FuncAnimation(fig, update, frames=np.linspace(0, 2*np.pi, 128),
init_func=init, blit=True)
plt.show()
```
The second method is to use [`functools.partial`](https://docs.python.org/3/library/functools.html#functools.partial "(in Python v3.10)") to 'bind' artists to function. A third method is to use closures to build up the required artists and functions. A fourth method is to create a class.
#### Examples
* [Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html)
* [The Bayes update](https://matplotlib.org/stable/gallery/animation/bayes_update.html)
* [The double pendulum problem](https://matplotlib.org/stable/gallery/animation/double_pendulum.html)
* [Animated histogram](https://matplotlib.org/stable/gallery/animation/animated_histogram.html)
* [Rain simulation](https://matplotlib.org/stable/gallery/animation/rain.html)
* [Animated 3D random walk](https://matplotlib.org/stable/gallery/animation/random_walk.html)
* [Animated line plot](https://matplotlib.org/stable/gallery/animation/simple_anim.html)
* [Oscilloscope](https://matplotlib.org/stable/gallery/animation/strip_chart.html)
* [MATPLOTLIB **UNCHAINED**](https://matplotlib.org/stable/gallery/animation/unchained.html)
### `ArtistAnimation`
#### Examples
* [Animated image using a precomputed list of images](https://matplotlib.org/stable/gallery/animation/dynamic_image.html)
Writer Classes
--------------
The provided writers fall into a few broad categories.
The Pillow writer relies on the Pillow library to write the animation, keeping all data in memory.
| | |
| --- | --- |
| [`PillowWriter`](_as_gen/matplotlib.animation.pillowwriter#matplotlib.animation.PillowWriter "matplotlib.animation.PillowWriter") | |
The HTML writer generates JavaScript-based animations.
| | |
| --- | --- |
| [`HTMLWriter`](_as_gen/matplotlib.animation.htmlwriter#matplotlib.animation.HTMLWriter "matplotlib.animation.HTMLWriter") | Writer for JavaScript-based HTML movies. |
The pipe-based writers stream the captured frames over a pipe to an external process. The pipe-based variants tend to be more performant, but may not work on all systems.
| | |
| --- | --- |
| [`FFMpegWriter`](_as_gen/matplotlib.animation.ffmpegwriter#matplotlib.animation.FFMpegWriter "matplotlib.animation.FFMpegWriter") | Pipe-based ffmpeg writer. |
| [`ImageMagickWriter`](_as_gen/matplotlib.animation.imagemagickwriter#matplotlib.animation.ImageMagickWriter "matplotlib.animation.ImageMagickWriter") | Pipe-based animated gif. |
The file-based writers save temporary files for each frame which are stitched into a single file at the end. Although slower, these writers can be easier to debug.
| | |
| --- | --- |
| [`FFMpegFileWriter`](_as_gen/matplotlib.animation.ffmpegfilewriter#matplotlib.animation.FFMpegFileWriter "matplotlib.animation.FFMpegFileWriter") | File-based ffmpeg writer. |
| [`ImageMagickFileWriter`](_as_gen/matplotlib.animation.imagemagickfilewriter#matplotlib.animation.ImageMagickFileWriter "matplotlib.animation.ImageMagickFileWriter") | File-based animated gif writer. |
The writer classes provide a way to grab sequential frames from the same underlying [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure"). They all provide three methods that must be called in sequence:
* [`setup`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter.setup "matplotlib.animation.AbstractMovieWriter.setup") prepares the writer (e.g. opening a pipe). Pipe-based and file-based writers take different arguments to `setup()`.
* [`grab_frame`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter.grab_frame "matplotlib.animation.AbstractMovieWriter.grab_frame") can then be called as often as needed to capture a single frame at a time
* [`finish`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter.finish "matplotlib.animation.AbstractMovieWriter.finish") finalizes the movie and writes the output file to disk.
Example:
```
moviewriter = MovieWriter(...)
moviewriter.setup(fig, 'my_movie.ext', dpi=100)
for j in range(n):
update_figure(j)
moviewriter.grab_frame()
moviewriter.finish()
```
If using the writer classes directly (not through [`Animation.save`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation.save "matplotlib.animation.Animation.save")), it is strongly encouraged to use the [`saving`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter.saving "matplotlib.animation.AbstractMovieWriter.saving") context manager:
```
with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
for j in range(n):
update_figure(j)
moviewriter.grab_frame()
```
to ensure that setup and cleanup are performed as necessary.
### Examples
* [Frame grabbing](https://matplotlib.org/stable/gallery/animation/frame_grabbing_sgskip.html)
Helper Classes
--------------
### Animation Base Classes
| | |
| --- | --- |
| [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") | A base class for Animations. |
| [`TimedAnimation`](_as_gen/matplotlib.animation.timedanimation#matplotlib.animation.TimedAnimation "matplotlib.animation.TimedAnimation") | [`Animation`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") subclass for time-based animation. |
### Writer Registry
A module-level registry is provided to map between the name of the writer and the class to allow a string to be passed to [`Animation.save`](_as_gen/matplotlib.animation.animation#matplotlib.animation.Animation.save "matplotlib.animation.Animation.save") instead of a writer instance.
| | |
| --- | --- |
| [`MovieWriterRegistry`](_as_gen/matplotlib.animation.moviewriterregistry#matplotlib.animation.MovieWriterRegistry "matplotlib.animation.MovieWriterRegistry") | Registry of available writer classes by human readable name. |
### Writer Base Classes
To reduce code duplication base classes
| | |
| --- | --- |
| [`AbstractMovieWriter`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter "matplotlib.animation.AbstractMovieWriter") | Abstract base class for writing movies, providing a way to grab frames by calling [`grab_frame`](_as_gen/matplotlib.animation.abstractmoviewriter#matplotlib.animation.AbstractMovieWriter.grab_frame "matplotlib.animation.AbstractMovieWriter.grab_frame"). |
| [`MovieWriter`](_as_gen/matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") | Base class for writing movies. |
| [`FileMovieWriter`](_as_gen/matplotlib.animation.filemoviewriter#matplotlib.animation.FileMovieWriter "matplotlib.animation.FileMovieWriter") | [`MovieWriter`](_as_gen/matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") for writing to individual files and stitching at the end. |
and mixins
| | |
| --- | --- |
| [`FFMpegBase`](_as_gen/matplotlib.animation.ffmpegbase#matplotlib.animation.FFMpegBase "matplotlib.animation.FFMpegBase") | Mixin class for FFMpeg output. |
| [`ImageMagickBase`](_as_gen/matplotlib.animation.imagemagickbase#matplotlib.animation.ImageMagickBase "matplotlib.animation.ImageMagickBase") | Mixin class for ImageMagick output. |
are provided.
See the source code for how to easily implement new [`MovieWriter`](_as_gen/matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") classes.
matplotlib matplotlib.legend matplotlib.legend
=================
The legend module defines the Legend class, which is responsible for drawing legends associated with axes and/or figures.
Important
It is unlikely that you would ever create a Legend instance manually. Most users would normally create a legend via the [`legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") function. For more details on legends there is also a [legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html).
The [`Legend`](#matplotlib.legend.Legend "matplotlib.legend.Legend") class is a container of legend handles and legend texts.
The legend handler map specifies how to create legend handles from artists (lines, patches, etc.) in the axes or figures. Default legend handlers are defined in the [`legend_handler`](legend_handler_api#module-matplotlib.legend_handler "matplotlib.legend_handler") module. While not all artist types are covered by the default legend handlers, custom legend handlers can be defined to support arbitrary objects.
See the [legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for more information.
*class*matplotlib.legend.DraggableLegend(*legend*, *use\_blit=False*, *update='loc'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L53-L94)
Bases: [`DraggableOffsetBox`](offsetbox_api#matplotlib.offsetbox.DraggableOffsetBox "matplotlib.offsetbox.DraggableOffsetBox")
Wrapper around a [`Legend`](#matplotlib.legend.Legend "matplotlib.legend.Legend") to support mouse dragging.
Parameters:
**legend**[`Legend`](#matplotlib.legend.Legend "matplotlib.legend.Legend")
The [`Legend`](#matplotlib.legend.Legend "matplotlib.legend.Legend") instance to wrap.
**use\_blit**bool, optional
Use blitting for faster image composition. For details see [FuncAnimation](animation_api#func-animation).
**update**{'loc', 'bbox'}, optional
If "loc", update the *loc* parameter of the legend upon finalizing. If "bbox", update the *bbox\_to\_anchor* parameter.
finalize\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L76-L80)
*class*matplotlib.legend.Legend(*parent*, *handles*, *labels*, *\**, *loc=None*, *numpoints=None*, *markerscale=None*, *markerfirst=True*, *scatterpoints=None*, *scatteryoffsets=None*, *prop=None*, *fontsize=None*, *labelcolor=None*, *borderpad=None*, *labelspacing=None*, *handlelength=None*, *handleheight=None*, *handletextpad=None*, *borderaxespad=None*, *columnspacing=None*, *ncols=1*, *mode=None*, *fancybox=None*, *shadow=None*, *title=None*, *title\_fontsize=None*, *framealpha=None*, *edgecolor=None*, *facecolor=None*, *bbox\_to\_anchor=None*, *bbox\_transform=None*, *frameon=None*, *handler\_map=None*, *title\_fontproperties=None*, *alignment='center'*, *ncol=1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L292-L1115)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
Place a legend on the axes at location loc.
Parameters:
**parent**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The artist that contains the legend.
**handles**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
A list of Artists (lines, patches) to be added to the legend.
**labels**list of str
A list of labels to show next to the artists. The length of handles and labels should be the same. If they are not, they are truncated to the smaller of both lengths.
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
#### Notes
Users can specify any arbitrary location for the legend using the *bbox\_to\_anchor* keyword argument. *bbox\_to\_anchor* can be a [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") (or derived there from) or a tuple of 2 or 4 floats. See [`set_bbox_to_anchor`](#matplotlib.legend.Legend.set_bbox_to_anchor "matplotlib.legend.Legend.set_bbox_to_anchor") for more detail.
The legend location can be specified by setting *loc* with a tuple of 2 floats, which is interpreted as the lower-left corner of the legend in the normalized axes coordinate.
codes*={'best': 0, 'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1}*
contains(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L1073-L1077)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L623-L652)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
draw\_frame(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L945-L954)
Set whether the legend box patch is drawn.
Parameters:
**b**bool
get\_alignment()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L894-L896)
Get the alignment value of the legend box
get\_bbox\_to\_anchor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L958-L963)
Return the bbox that the legend will be anchored to.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L856-L858)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
*classmethod*get\_default\_handler\_map()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L676-L679)
Return the global default handler map, shared by all legends.
get\_draggable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L1113-L1115)
Return `True` if the legend is draggable, `False` otherwise.
get\_frame()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L860-L862)
Return the [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") used to frame the legend.
get\_frame\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L941-L943)
Get whether the legend box patch is drawn.
*static*get\_legend\_handler(*legend\_handler\_map*, *orig\_handle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L697-L721)
Return a legend handler from *legend\_handler\_map* that corresponds to *orig\_handler*.
*legend\_handler\_map* should be a dictionary object (that is returned by the get\_legend\_handler\_map method).
It first checks if the *orig\_handle* itself is a key in the *legend\_handler\_map* and return the associated value. Otherwise, it checks for each of the classes in its method-resolution-order. If no matching key is found, it returns `None`.
get\_legend\_handler\_map()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L691-L695)
Return this legend instance's handler map.
get\_lines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L864-L866)
Return the list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s in the legend.
get\_patches()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L868-L872)
Return the list of [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")s in the legend.
get\_texts()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L874-L876)
Return the list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")s in the legend.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L937-L939)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_title()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L927-L929)
Return the [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance for the legend title.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L931-L935)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alignment=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *draggable=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *ncols=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alignment`](#matplotlib.legend.Legend.set_alignment "matplotlib.legend.Legend.set_alignment") | {'center', 'left', 'right'}. |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](#matplotlib.legend.Legend.set_bbox_to_anchor "matplotlib.legend.Legend.set_bbox_to_anchor") | [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") or tuple |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`draggable`](#matplotlib.legend.Legend.set_draggable "matplotlib.legend.Legend.set_draggable") | bool |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](#matplotlib.legend.Legend.set_frame_on "matplotlib.legend.Legend.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`ncols`](#matplotlib.legend.Legend.set_ncols "matplotlib.legend.Legend.set_ncols") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](#matplotlib.legend.Legend.set_title "matplotlib.legend.Legend.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_alignment(*alignment*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L878-L892)
Set the alignment of the legend title and the box of entries.
The entries are aligned as a single block, so that markers always lined up.
Parameters:
**alignment**{'center', 'left', 'right'}.
set\_bbox\_to\_anchor(*bbox*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L965-L1006)
Set the bbox that the legend will be anchored to.
Parameters:
**bbox**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") or tuple
The bounding box can be specified in the following ways:
* A [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") instance
* A tuple of `(left, bottom, width, height)` in the given transform (normalized axes coordinate if None)
* A tuple of `(left, bottom)` where the width and height will be assumed to be zero.
* *None*, to remove the bbox anchoring, and use the parent bbox.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
A transform to apply to the bounding box. If not specified, this will use a transform to the bounding box of the parent.
*classmethod*set\_default\_handler\_map(*handler\_map*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L681-L684)
Set the global default handler map, shared by all legends.
set\_draggable(*state*, *use\_blit=False*, *update='loc'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L1079-L1111)
Enable or disable mouse dragging support of the legend.
Parameters:
**state**bool
Whether mouse dragging is enabled.
**use\_blit**bool, optional
Use blitting for faster image composition. For details see [FuncAnimation](animation_api#func-animation).
**update**{'loc', 'bbox'}, optional
The legend parameter to be changed when dragged:
* 'loc': update the *loc* parameter of the legend
* 'bbox': update the *bbox\_to\_anchor* parameter of the legend
Returns:
[`DraggableLegend`](#matplotlib.legend.DraggableLegend "matplotlib.legend.DraggableLegend") or *None*
If *state* is `True` this returns the [`DraggableLegend`](#matplotlib.legend.DraggableLegend "matplotlib.legend.DraggableLegend") helper instance. Otherwise this returns *None*.
set\_frame\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L945-L954)
Set whether the legend box patch is drawn.
Parameters:
**b**bool
set\_ncols(*ncols*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L597-L599)
Set the number of columns.
set\_title(*title*, *prop=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L898-L925)
Set legend title and title style.
Parameters:
**title**str
The legend title.
**prop**[`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)")
The font properties of the legend title. If a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"), it is interpreted as a fontconfig pattern parsed by [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"). If a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)"), it is interpreted as the absolute path to a font file.
*classmethod*update\_default\_handler\_map(*handler\_map*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend.py#L686-L689)
Update the global default handler map, shared by all legends.
zorder*=5*
| programming_docs |
matplotlib matplotlib.units matplotlib.units
================
The classes here provide support for using custom classes with Matplotlib, e.g., those that do not expose the array interface but know how to convert themselves to arrays. It also supports classes with units and units conversion. Use cases include converters for custom objects, e.g., a list of datetime objects, as well as for objects that are unit aware. We don't assume any particular units implementation; rather a units implementation must register with the Registry converter dictionary and provide a [`ConversionInterface`](#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface"). For example, here is a complete implementation which supports plotting with native datetime objects:
```
import matplotlib.units as units
import matplotlib.dates as dates
import matplotlib.ticker as ticker
import datetime
class DateConverter(units.ConversionInterface):
@staticmethod
def convert(value, unit, axis):
"Convert a datetime value to a scalar or array."
return dates.date2num(value)
@staticmethod
def axisinfo(unit, axis):
"Return major and minor tick locators and formatters."
if unit != 'date':
return None
majloc = dates.AutoDateLocator()
majfmt = dates.AutoDateFormatter(majloc)
return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='date')
@staticmethod
def default_units(x, axis):
"Return the default unit for x or None."
return 'date'
# Finally we register our object type with the Matplotlib units registry.
units.registry[datetime.date] = DateConverter()
```
*class*matplotlib.units.AxisInfo(*majloc=None*, *minloc=None*, *majfmt=None*, *minfmt=None*, *label=None*, *default\_limits=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L72-L105)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Information to support default axis labeling, tick labeling, and limits.
An instance of this class must be returned by [`ConversionInterface.axisinfo`](#matplotlib.units.ConversionInterface.axisinfo "matplotlib.units.ConversionInterface.axisinfo").
Parameters:
**majloc, minloc**Locator, optional
Tick locators for the major and minor ticks.
**majfmt, minfmt**Formatter, optional
Tick formatters for the major and minor ticks.
**label**str, optional
The default axis label.
**default\_limits**optional
The default min and max limits of the axis if no data has been plotted.
#### Notes
If any of the above are `None`, the axis will simply use the default value.
*exception*matplotlib.units.ConversionError[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L52-L53)
Bases: [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)")
*class*matplotlib.units.ConversionInterface[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L108-L149)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The minimal interface for a converter to take custom data types (or sequences) and convert them to values Matplotlib can use.
*static*axisinfo(*unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L114-L117)
Return an [`AxisInfo`](#matplotlib.units.AxisInfo "matplotlib.units.AxisInfo") for the axis with the specified units.
*static*convert(*obj*, *unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L124-L132)
Convert *obj* using *unit* for the specified *axis*.
If *obj* is a sequence, return the converted sequence. The output must be a sequence of scalars that can be used by the numpy array layer.
*static*default\_units(*x*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L119-L122)
Return the default unit for *x* or `None` for the given axis.
*static*is\_numlike(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L134-L149)
[*Deprecated*] The Matplotlib datalim, autoscaling, locators etc work with scalars which are the units converted to floats given the current unit. The converter may be passed these floats, or arrays of them, even when units are set.
#### Notes
Deprecated since version 3.5.
*class*matplotlib.units.DecimalConverter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L152-L175)
Bases: [`ConversionInterface`](#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface")
Converter for decimal.Decimal data to float.
*static*convert(*value*, *unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L155-L173)
Convert Decimals to floats.
The *unit* and *axis* arguments are not used.
Parameters:
**value**decimal.Decimal or iterable
Decimal or list of Decimal need to be converted
*class*matplotlib.units.Registry[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L178-L208)
Bases: [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)")
Register types with conversion interface.
get\_converter(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/units.py#L181-L208)
Get the converter interface instance for *x*, or None.
matplotlib matplotlib.text matplotlib.text
===============
Classes for including text in a figure.
*class*matplotlib.text.Text(*x=0*, *y=0*, *text=''*, *\**, *color=None*, *verticalalignment='baseline'*, *horizontalalignment='left'*, *multialignment=None*, *fontproperties=None*, *rotation=None*, *linespacing=None*, *rotation\_mode=None*, *usetex=None*, *wrap=False*, *transform\_rotates\_text=False*, *parse\_math=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L108-L1334)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
Handle storing and drawing of text in window or data coordinates.
Create a [`Text`](#matplotlib.text.Text "matplotlib.text.Text") instance at *x*, *y* with string *text*.
The text is aligned relative to the anchor point (*x*, *y*) according to `horizontalalignment` (default: 'left') and `verticalalignment` (default: 'bottom'). See also [Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html).
While Text accepts the 'label' keyword argument, by default it is not added to the handles of a legend.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L208-L235)
Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L674-L742)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_bbox\_patch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L490-L495)
Return the bbox Patch, or None if the [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") is not made.
get\_c()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L744-L746)
Alias for [`get_color`](#matplotlib.text.Text.get_color "matplotlib.text.Text.get_color").
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L744-L746)
Return the color of the text.
get\_family()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L752-L760)
Alias for [`get_fontfamily`](#matplotlib.text.Text.get_fontfamily "matplotlib.text.Text.get_fontfamily").
get\_font()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L748-L750)
Alias for [`get_fontproperties`](#matplotlib.text.Text.get_fontproperties "matplotlib.text.Text.get_fontproperties").
get\_font\_properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L748-L750)
Alias for [`get_fontproperties`](#matplotlib.text.Text.get_fontproperties "matplotlib.text.Text.get_fontproperties").
get\_fontfamily()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L752-L760)
Return the list of font families used for font lookup.
See also
[`font_manager.FontProperties.get_family`](font_manager_api#matplotlib.font_manager.FontProperties.get_family "matplotlib.font_manager.FontProperties.get_family")
get\_fontname()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L762-L770)
Return the font name as a string.
See also
[`font_manager.FontProperties.get_name`](font_manager_api#matplotlib.font_manager.FontProperties.get_name "matplotlib.font_manager.FontProperties.get_name")
get\_fontproperties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L748-L750)
Return the [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties").
get\_fontsize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L782-L790)
Return the font size as an integer.
See also
[`font_manager.FontProperties.get_size_in_points`](font_manager_api#matplotlib.font_manager.FontProperties.get_size_in_points "matplotlib.font_manager.FontProperties.get_size_in_points")
get\_fontstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L772-L780)
Return the font style as a string.
See also
[`font_manager.FontProperties.get_style`](font_manager_api#matplotlib.font_manager.FontProperties.get_style "matplotlib.font_manager.FontProperties.get_style")
get\_fontvariant()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L792-L800)
Return the font variant as a string.
See also
[`font_manager.FontProperties.get_variant`](font_manager_api#matplotlib.font_manager.FontProperties.get_variant "matplotlib.font_manager.FontProperties.get_variant")
get\_fontweight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L802-L810)
Return the font weight as a string or a number.
See also
[`font_manager.FontProperties.get_weight`](font_manager_api#matplotlib.font_manager.FontProperties.get_weight "matplotlib.font_manager.FontProperties.get_weight")
get\_ha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L822-L827)
Alias for [`get_horizontalalignment`](#matplotlib.text.Text.get_horizontalalignment "matplotlib.text.Text.get_horizontalalignment").
get\_horizontalalignment()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L822-L827)
Return the horizontal alignment as a string. Will be one of 'left', 'center' or 'right'.
get\_math\_fontfamily()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1079-L1089)
Return the font family name for math text rendered by Matplotlib.
The default value is `[rcParams["mathtext.fontset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=mathtext.fontset#matplotlibrc-sample)` (default: `'dejavusans'`).
See also
[`set_math_fontfamily`](#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily")
get\_name()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L762-L770)
Alias for [`get_fontname`](#matplotlib.text.Text.get_fontname "matplotlib.text.Text.get_fontname").
get\_parse\_math()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1314-L1316)
Return whether mathtext parsing is considered for this [`Text`](#matplotlib.text.Text "matplotlib.text.Text").
get\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L837-L841)
Return the (x, y) position of the text.
get\_prop\_tup(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L844-L862)
[*Deprecated*] Return a hashable tuple of properties.
Not intended to be human readable, but useful for backends who want to cache derived information about text (e.g., layouts) and need to know if the text has changed.
#### Notes
Deprecated since version 3.5.
get\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L250-L256)
Return the text angle in degrees between 0 and 360.
get\_rotation\_mode()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L279-L281)
Return the text rotation mode.
get\_size()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L782-L790)
Alias for [`get_fontsize`](#matplotlib.text.Text.get_fontsize "matplotlib.text.Text.get_fontsize").
get\_stretch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L812-L820)
Return the font stretch as a string or a number.
See also
[`font_manager.FontProperties.get_stretch`](font_manager_api#matplotlib.font_manager.FontProperties.get_stretch "matplotlib.font_manager.FontProperties.get_stretch")
get\_style()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L772-L780)
Alias for [`get_fontstyle`](#matplotlib.text.Text.get_fontstyle "matplotlib.text.Text.get_fontstyle").
get\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L864-L866)
Return the text string.
get\_transform\_rotates\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L258-L262)
Return whether rotations of the transform affect the text direction.
get\_unitless\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L829-L835)
Return the (x, y) unitless position of the text.
get\_usetex()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1298-L1300)
Return whether this [`Text`](#matplotlib.text.Text "matplotlib.text.Text") object uses TeX for rendering.
get\_va()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L868-L873)
Alias for [`get_verticalalignment`](#matplotlib.text.Text.get_verticalalignment "matplotlib.text.Text.get_verticalalignment").
get\_variant()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L792-L800)
Alias for [`get_fontvariant`](#matplotlib.text.Text.get_fontvariant "matplotlib.text.Text.get_fontvariant").
get\_verticalalignment()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L868-L873)
Return the vertical alignment as a string. Will be one of 'top', 'center', 'bottom', 'baseline' or 'center\_baseline'.
get\_weight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L802-L810)
Alias for [`get_fontweight`](#matplotlib.text.Text.get_fontweight "matplotlib.text.Text.get_fontweight").
get\_window\_extent(*renderer=None*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L875-L920)
Return the [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
Parameters:
**renderer**Renderer, optional
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling [`get_window_extent`](#matplotlib.text.Text.get_window_extent "matplotlib.text.Text.get_window_extent") before the first draw. In practice, it is usually easier to trigger a draw first, e.g. by calling [`draw_without_rendering`](figure_api#matplotlib.figure.Figure.draw_without_rendering "matplotlib.figure.Figure.draw_without_rendering") or `plt.show()`.
**dpi**float, optional
The dpi value for computing the bbox, defaults to `self.figure.dpi` (*not* the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
get\_wrap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L542-L544)
Return whether the text can be wrapped.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *backgroundcolor=<UNSET>*, *bbox=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *fontfamily=<UNSET>*, *fontproperties=<UNSET>*, *fontsize=<UNSET>*, *fontstretch=<UNSET>*, *fontstyle=<UNSET>*, *fontvariant=<UNSET>*, *fontweight=<UNSET>*, *gid=<UNSET>*, *horizontalalignment=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linespacing=<UNSET>*, *math\_fontfamily=<UNSET>*, *mouseover=<UNSET>*, *multialignment=<UNSET>*, *parse\_math=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *rotation=<UNSET>*, *rotation\_mode=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *transform\_rotates\_text=<UNSET>*, *url=<UNSET>*, *usetex=<UNSET>*, *verticalalignment=<UNSET>*, *visible=<UNSET>*, *wrap=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") | {'normal', 'small-caps'} |
| [`fontweight`](#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") | {'left', 'right', 'center'} |
| [`parse_math`](#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_backgroundcolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L922-L940)
Set the background color of the text by updating the bbox.
Parameters:
**color**color
See also
[`set_bbox`](#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox")
To change the position of the bounding box
set\_bbox(*rectprops*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L450-L488)
Draw a bounding box around self.
Parameters:
**rectprops**dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch")
The default boxstyle is 'square'. The mutation scale of the [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") is set to the fontsize.
#### Examples
```
t.set_bbox(dict(facecolor='red', alpha=0.5))
```
set\_c(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L942-L961)
Alias for [`set_color`](#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color").
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L527-L530)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L537-L540)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L532-L535)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_color(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L942-L961)
Set the foreground color of the text
Parameters:
**color**color
set\_family(*fontname*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1007-L1029)
Alias for [`set_fontfamily`](#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily").
set\_font(*fp*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1270-L1282)
Alias for [`set_fontproperties`](#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties").
set\_font\_properties(*fp*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1270-L1282)
Alias for [`set_fontproperties`](#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties").
set\_fontfamily(*fontname*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1007-L1029)
Set the font family. May be either a single string, or a list of strings in decreasing priority. Each string may be either a real font name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams.
If a [`Text`](#matplotlib.text.Text "matplotlib.text.Text") instance is constructed with `fontfamily=None`, then the font is set to `[rcParams["font.family"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.family#matplotlibrc-sample)` (default: `['sans-serif']`), and the same is done when [`set_fontfamily()`](#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") is called on an existing [`Text`](#matplotlib.text.Text "matplotlib.text.Text") instance.
Parameters:
**fontname**{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
See also
[`font_manager.FontProperties.set_family`](font_manager_api#matplotlib.font_manager.FontProperties.set_family "matplotlib.font_manager.FontProperties.set_family")
set\_fontname(*fontname*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1318-L1334)
Alias for [`set_family`](#matplotlib.text.Text.set_family "matplotlib.text.Text.set_family").
One-way alias only: the getter differs.
Parameters:
**fontname**{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
See also
[`font_manager.FontProperties.set_family`](font_manager_api#matplotlib.font_manager.FontProperties.set_family "matplotlib.font_manager.FontProperties.set_family")
set\_fontproperties(*fp*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1270-L1282)
Set the font properties that control the text.
Parameters:
**fp**[`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)")
If a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"), it is interpreted as a fontconfig pattern parsed by [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"). If a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)"), it is interpreted as the absolute path to a font file.
set\_fontsize(*fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1061-L1077)
Set the font size.
Parameters:
**fontsize**float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
If float, the fontsize in points. The string values denote sizes relative to the default font size.
See also
[`font_manager.FontProperties.set_size`](font_manager_api#matplotlib.font_manager.FontProperties.set_size "matplotlib.font_manager.FontProperties.set_size")
set\_fontstretch(*stretch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1130-L1145)
Set the font stretch (horizontal condensation or expansion).
Parameters:
**stretch**{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
See also
[`font_manager.FontProperties.set_stretch`](font_manager_api#matplotlib.font_manager.FontProperties.set_stretch "matplotlib.font_manager.FontProperties.set_stretch")
set\_fontstyle(*fontstyle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1046-L1059)
Set the font style.
Parameters:
**fontstyle**{'normal', 'italic', 'oblique'}
See also
[`font_manager.FontProperties.set_style`](font_manager_api#matplotlib.font_manager.FontProperties.set_style "matplotlib.font_manager.FontProperties.set_style")
set\_fontvariant(*variant*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1031-L1044)
Set the font variant.
Parameters:
**variant**{'normal', 'small-caps'}
See also
[`font_manager.FontProperties.set_variant`](font_manager_api#matplotlib.font_manager.FontProperties.set_variant "matplotlib.font_manager.FontProperties.set_variant")
set\_fontweight(*weight*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1113-L1128)
Set the font weight.
Parameters:
**weight**{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
See also
[`font_manager.FontProperties.set_weight`](font_manager_api#matplotlib.font_manager.FontProperties.set_weight "matplotlib.font_manager.FontProperties.set_weight")
set\_ha(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L963-L975)
Alias for [`set_horizontalalignment`](#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment").
set\_horizontalalignment(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L963-L975)
Set the horizontal alignment relative to the anchor point.
See also [Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html).
Parameters:
**align**{'left', 'center', 'right'}
set\_linespacing(*spacing*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L993-L1005)
Set the line spacing as a multiple of the font size.
The default line spacing is 1.2.
Parameters:
**spacing**float (multiple of font size)
set\_ma(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L977-L991)
Alias for [`set_multialignment`](#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment").
set\_math\_fontfamily(*fontfamily*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1091-L1111)
Set the font family for math text rendered by Matplotlib.
This does only affect Matplotlib's own math renderer. It has no effect when rendering with TeX (`usetex=True`).
Parameters:
**fontfamily**str
The name of the font family.
Available font families are defined in the [matplotlibrc.template file](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files).
See also
[`get_math_fontfamily`](#matplotlib.text.Text.get_math_fontfamily "matplotlib.text.Text.get_math_fontfamily")
set\_multialignment(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L977-L991)
Set the text alignment for multiline texts.
The layout of the bounding box of all the lines is determined by the horizontalalignment and verticalalignment properties. This property controls the alignment of the text lines within that box.
Parameters:
**align**{'left', 'right', 'center'}
set\_name(*fontname*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1318-L1334)
Alias for [`set_fontname`](#matplotlib.text.Text.set_fontname "matplotlib.text.Text.set_fontname").
set\_parse\_math(*parse\_math*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1302-L1312)
Override switch to disable any mathtext parsing for this [`Text`](#matplotlib.text.Text "matplotlib.text.Text").
Parameters:
**parse\_math**bool
If False, this [`Text`](#matplotlib.text.Text "matplotlib.text.Text") will never use mathtext. If True, mathtext will be used if there is an even number of unescaped dollar signs.
set\_position(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1147-L1156)
Set the (*x*, *y*) position of the text.
Parameters:
**xy**(float, float)
set\_rotation(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1180-L1199)
Set the rotation of the text.
Parameters:
**s**float or {'vertical', 'horizontal'}
The rotation angle in degrees in mathematically positive direction (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.
set\_rotation\_mode(*m*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L264-L277)
Set text rotation mode.
Parameters:
**m**{None, 'default', 'anchor'}
If `None` or `"default"`, the text will be first rotated, then aligned according to their horizontal and vertical alignments. If `"anchor"`, then alignment occurs before rotation.
set\_size(*fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1061-L1077)
Alias for [`set_fontsize`](#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize").
set\_stretch(*stretch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1130-L1145)
Alias for [`set_fontstretch`](#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch").
set\_style(*fontstyle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1046-L1059)
Alias for [`set_fontstyle`](#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle").
set\_text(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1228-L1244)
Set the text string *s*.
It may contain newlines (`\n`) or math in LaTeX syntax.
Parameters:
**s**object
Any object gets converted to its [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") representation, except for `None` which is converted to an empty string.
set\_transform\_rotates\_text(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1201-L1210)
Whether rotations of the transform affect the text direction.
Parameters:
**t**bool
set\_usetex(*usetex*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1284-L1296)
Parameters:
**usetex**bool or None
Whether to render using TeX, `None` means to use `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`).
set\_va(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1212-L1226)
Alias for [`set_verticalalignment`](#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment").
set\_variant(*variant*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1031-L1044)
Alias for [`set_fontvariant`](#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant").
set\_verticalalignment(*align*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1212-L1226)
Set the vertical alignment relative to the anchor point.
See also [Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html).
Parameters:
**align**{'bottom', 'baseline', 'center', 'center\_baseline', 'top'}
set\_weight(*weight*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1113-L1128)
Alias for [`set_fontweight`](#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight").
set\_wrap(*wrap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L546-L562)
Set whether the text can be wrapped.
Parameters:
**wrap**bool
#### Notes
Wrapping does not work together with `savefig(..., bbox_inches='tight')` (which is also used internally by `%matplotlib inline` in IPython/Jupyter). The 'tight' setting rescales the canvas to accommodate all content and happens before wrapping.
set\_x(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1158-L1167)
Set the *x* position of the text.
Parameters:
**x**float
set\_y(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1169-L1178)
Set the *y* position of the text.
Parameters:
**y**float
update(*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L188-L200)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_bbox\_position\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L497-L518)
Update the location and the size of the bbox.
This method should be used when the position and size of the bbox needs to be updated before actually drawing the bbox.
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L283-L296)
Copy properties from *other* to *self*.
zorder*=3*
*class*matplotlib.text.Annotation(*text*, *xy*, *xytext=None*, *xycoords='data'*, *textcoords=None*, *arrowprops=None*, *annotation\_clip=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1617-L2024)
Bases: [`Text`](#matplotlib.text.Text "matplotlib.text.Text"), `_AnnotationBase`
An [`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation") is a [`Text`](#matplotlib.text.Text "matplotlib.text.Text") that can refer to a specific position *xy*. Optionally an arrow pointing from the text to *xy* can be drawn.
Attributes:
**xy**
The annotated position.
**xycoords**
The coordinate system for *xy*.
**arrow\_patch**
A [`FancyArrowPatch`](_as_gen/matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") to point from *xytext* to *xy*.
Annotate the point *xy* with text *text*.
In the simplest form, the text is placed at *xy*.
Optionally, the text can be displayed in another position *xytext*. An arrow pointing from the text to the annotated point *xy* can then be added by defining *arrowprops*.
Parameters:
**text**str
The text of the annotation.
**xy**(float, float)
The point *(x, y)* to annotate. The coordinate system is determined by *xycoords*.
**xytext**(float, float), default: *xy*
The position *(x, y)* to place the text at. The coordinate system is determined by *textcoords*.
**xycoords**str or [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") or callable or (float, float), default: 'data'
The coordinate system that *xy* is given in. The following types of values are supported:
* One of the following strings:
| Value | Description |
| --- | --- |
| 'figure points' | Points from the lower left of the figure |
| 'figure pixels' | Pixels from the lower left of the figure |
| 'figure fraction' | Fraction of figure from lower left |
| 'subfigure points' | Points from the lower left of the subfigure |
| 'subfigure pixels' | Pixels from the lower left of the subfigure |
| 'subfigure fraction' | Fraction of subfigure from lower left |
| 'axes points' | Points from lower left corner of axes |
| 'axes pixels' | Pixels from lower left corner of axes |
| 'axes fraction' | Fraction of axes from lower left |
| 'data' | Use the coordinate system of the object being annotated (default) |
| 'polar' | *(theta, r)* if not native 'data' coordinates |
Note that 'subfigure pixels' and 'figure pixels' are the same for the parent figure, so users who want code that is usable in a subfigure can use 'subfigure pixels'.
* An [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"): *xy* is interpreted as a fraction of the artist's [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"). E.g. *(0, 0)* would be the lower left corner of the bounding box and *(0.5, 1)* would be the center top of the bounding box.
* A [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") to transform *xy* to screen coordinates.
* A function with one of the following signatures:
```
def transform(renderer) -> Bbox
def transform(renderer) -> Transform
```
where *renderer* is a [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
The result of the function is interpreted like the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") and [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") cases above.
* A tuple *(xcoords, ycoords)* specifying separate coordinate systems for *x* and *y*. *xcoords* and *ycoords* must each be of one of the above described types.
See [Advanced Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#plotting-guide-annotation) for more details.
**textcoords**str or [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") or callable or (float, float), default: value of *xycoords*
The coordinate system that *xytext* is given in.
All *xycoords* values are valid as well as the following strings:
| Value | Description |
| --- | --- |
| 'offset points' | Offset (in points) from the *xy* value |
| 'offset pixels' | Offset (in pixels) from the *xy* value |
**arrowprops**dict, optional
The properties used to draw a [`FancyArrowPatch`](_as_gen/matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") arrow between the positions *xy* and *xytext*. Defaults to None, i.e. no arrow is drawn.
For historical reasons there are two different ways to specify arrows, "simple" and "fancy":
**Simple arrow:**
If *arrowprops* does not contain the key 'arrowstyle' the allowed keys are:
| Key | Description |
| --- | --- |
| width | The width of the arrow in points |
| headwidth | The width of the base of the arrow head in points |
| headlength | The length of the arrow head in points |
| shrink | Fraction of total length to shrink from both ends |
| ? | Any key to [`matplotlib.patches.FancyArrowPatch`](_as_gen/matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") |
The arrow is attached to the edge of the text box, the exact position (corners or centers) depending on where it's pointing to.
**Fancy arrow:**
This is used if 'arrowstyle' is provided in the *arrowprops*.
Valid keys are the following [`FancyArrowPatch`](_as_gen/matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") parameters:
| Key | Description |
| --- | --- |
| arrowstyle | the arrow style |
| connectionstyle | the connection style |
| relpos | see below; default is (0.5, 0.5) |
| patchA | default is bounding box of the text |
| patchB | default is None |
| shrinkA | default is 2 points |
| shrinkB | default is 2 points |
| mutation\_scale | default is text size (in points) |
| mutation\_aspect | default is 1. |
| ? | any key for [`matplotlib.patches.PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") |
The exact starting point position of the arrow is defined by *relpos*. It's a tuple of relative coordinates of the text box, where (0, 0) is the lower left corner and (1, 1) is the upper right corner. Values <0 and >1 are supported and specify points outside the text box. By default (0.5, 0.5) the starting point is centered in the text box.
**annotation\_clip**bool or None, default: None
Whether to clip (i.e. not draw) the annotation when the annotation point *xy* is outside the axes area.
* If *True*, the annotation will be clipped when *xy* is outside the axes.
* If *False*, the annotation will always be drawn.
* If *None*, the annotation will be clipped when *xy* is outside the axes and *xycoords* is 'data'.
**\*\*kwargs**
Additional kwargs are passed to [`Text`](#matplotlib.text.Text "matplotlib.text.Text").
Returns:
[`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation")
See also
[Advanced Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#plotting-guide-annotation)
*property*anncoords
The coordinate system to use for [`Annotation.xyann`](#matplotlib.text.Annotation.xyann "matplotlib.text.Annotation.xyann").
contains(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1847-L1855)
Return whether the mouse event occurred inside the axis-aligned bounding-box of the text.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1978-L1995)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_anncoords()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1884-L1890)
Return the coordinate system to use for [`Annotation.xyann`](#matplotlib.text.Annotation.xyann "matplotlib.text.Annotation.xyann").
See also *xycoords* in [`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation").
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L2020-L2024)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1997-L2018)
Return the [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
Parameters:
**renderer**Renderer, optional
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling [`get_window_extent`](#matplotlib.text.Annotation.get_window_extent "matplotlib.text.Annotation.get_window_extent") before the first draw. In practice, it is usually easier to trigger a draw first, e.g. by calling [`draw_without_rendering`](figure_api#matplotlib.figure.Figure.draw_without_rendering "matplotlib.figure.Figure.draw_without_rendering") or `plt.show()`.
**dpi**float, optional
The dpi value for computing the bbox, defaults to `self.figure.dpi` (*not* the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *anncoords=<UNSET>*, *annotation\_clip=<UNSET>*, *backgroundcolor=<UNSET>*, *bbox=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *fontfamily=<UNSET>*, *fontproperties=<UNSET>*, *fontsize=<UNSET>*, *fontstretch=<UNSET>*, *fontstyle=<UNSET>*, *fontvariant=<UNSET>*, *fontweight=<UNSET>*, *gid=<UNSET>*, *horizontalalignment=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linespacing=<UNSET>*, *math\_fontfamily=<UNSET>*, *mouseover=<UNSET>*, *multialignment=<UNSET>*, *parse\_math=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *rotation=<UNSET>*, *rotation\_mode=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *transform\_rotates\_text=<UNSET>*, *url=<UNSET>*, *usetex=<UNSET>*, *verticalalignment=<UNSET>*, *visible=<UNSET>*, *wrap=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`anncoords`](#matplotlib.text.Annotation.set_anncoords "matplotlib.text.Annotation.set_anncoords") | unknown |
| `annotation_clip` | bool or None |
| [`backgroundcolor`](#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | unknown |
| [`fontfamily`](#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_anncoords(*coords*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1892-L1898)
Set the coordinate system to use for [`Annotation.xyann`](#matplotlib.text.Annotation.xyann "matplotlib.text.Annotation.xyann").
See also *xycoords* in [`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1903-L1907)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
update\_positions(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1909-L1976)
Update the pixel positions of the annotation text and the arrow patch.
*property*xyann
The text position.
See also *xytext* in [`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation").
*property*xycoords
*class*matplotlib.text.OffsetFrom(*artist*, *ref\_coord*, *unit='points'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1337-L1417)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Callable helper class for working with [`Annotation`](#matplotlib.text.Annotation "matplotlib.text.Annotation").
Parameters:
**artist**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The object to compute the offset from.
**ref\_coord**(float, float)
If *artist* is an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), this values is the location to of the offset origin in fractions of the *artist* bounding box.
If *artist* is a transform, the offset origin is the transform applied to this value.
**unit**{'points, 'pixels'}, default: 'points'
The screen units to use (pixels or points) for the offset input.
get\_unit()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1373-L1375)
Return the unit for input to the transform used by `__call__`.
set\_unit(*unit*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/text.py#L1362-L1371)
Set the unit for input to the transform used by `__call__`.
Parameters:
**unit**{'points', 'pixels'}
| programming_docs |
matplotlib matplotlib.mlab matplotlib.mlab
===============
Numerical Python functions written for compatibility with MATLAB commands with the same names. Most numerical Python functions can be found in the [NumPy](https://numpy.org) and [SciPy](https://www.scipy.org) libraries. What remains here is code for performing spectral computations and kernel density estimations.
Spectral functions
------------------
[`cohere`](#matplotlib.mlab.cohere "matplotlib.mlab.cohere")
Coherence (normalized cross spectral density)
[`csd`](#matplotlib.mlab.csd "matplotlib.mlab.csd")
Cross spectral density using Welch's average periodogram
[`detrend`](#matplotlib.mlab.detrend "matplotlib.mlab.detrend")
Remove the mean or best fit line from an array
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
Power spectral density using Welch's average periodogram
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
Spectrogram (spectrum over segments of time)
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
Return the complex-valued frequency spectrum of a signal
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
Return the magnitude of the frequency spectrum of a signal
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
Return the angle (wrapped phase) of the frequency spectrum of a signal
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
Return the phase (unwrapped angle) of the frequency spectrum of a signal
[`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean")
Remove the mean from a line.
[`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear")
Remove the best fit line from a line.
[`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none")
Return the original line.
[`stride_windows`](#matplotlib.mlab.stride_windows "matplotlib.mlab.stride_windows")
Get all windows in an array in a memory-efficient manner
*class*matplotlib.mlab.GaussianKDE(*dataset*, *bw\_method=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L843-L987)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Representation of a kernel-density estimate using Gaussian kernels.
Parameters:
**dataset**array-like
Datapoints to estimate from. In case of univariate data this is a 1-D array, otherwise a 2D array with shape (# of dims, # of data).
**bw\_method**str, scalar or callable, optional
The method used to calculate the estimator bandwidth. This can be 'scott', 'silverman', a scalar constant or a callable. If a scalar, this will be used directly as `kde.factor`. If a callable, it should take a [`GaussianKDE`](#matplotlib.mlab.GaussianKDE "matplotlib.mlab.GaussianKDE") instance as only parameter and return a scalar. If None (default), 'scott' is used.
Attributes:
**dataset**ndarray
The dataset passed to the constructor.
**dim**int
Number of dimensions.
**num\_dp**int
Number of datapoints.
**factor**float
The bandwidth factor, obtained from `kde.covariance_factor`, with which the covariance matrix is multiplied.
**covariance**ndarray
The covariance matrix of *dataset*, scaled by the calculated bandwidth (`kde.factor`).
**inv\_cov**ndarray
The inverse of *covariance*.
#### Methods
| | |
| --- | --- |
| **kde.evaluate(points)** | (ndarray) Evaluate the estimated pdf on a provided set of points. |
| **kde(points)** | (ndarray) Same as kde.evaluate(points) |
covariance\_factor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L928-L929)
evaluate(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L938-L985)
Evaluate the estimated pdf on a set of points.
Parameters:
**points**(# of dimensions, # of points)-array
Alternatively, a (# of dimensions,) vector can be passed in and treated as a single point.
Returns:
(# of points,)-array
The values at each point.
Raises:
**ValueError**if the dimensionality of the input points is different
than the dimensionality of the KDE.
scotts\_factor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L928-L929)
silverman\_factor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L931-L933)
matplotlib.mlab.angle\_spectrum(*x*, *Fs=None*, *window=None*, *pad\_to=None*, *sides=None*)
Compute the angle of the frequency spectrum (wrapped phase spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
Returns:
**spectrum**1-D array
The angle of the frequency spectrum (wrapped phase spectrum).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
Returns the power spectral density.
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
Returns the complex-valued frequency spectrum.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
Returns the absolute value of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
Returns the angle of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
Returns the phase (unwrapped angle) of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
Can return the complex spectrum of segments within the signal.
matplotlib.mlab.cohere(*x*, *y*, *NFFT=256*, *Fs=2*, *detrend=<function detrend\_none>*, *window=<function window\_hanning>*, *noverlap=0*, *pad\_to=None*, *sides='default'*, *scale\_by\_freq=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L793-L840)
The coherence between *x* and *y*. Coherence is the normalized cross spectral density:
\[C\_{xy} = \frac{|P\_{xy}|^2}{P\_{xx}P\_{yy}}\] Parameters:
**x, y**
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between segments.
Returns:
**Cxy**1-D array
The coherence vector.
**freqs**1-D array
The frequencies for the elements in *Cxy*.
See also
[`psd()`](#matplotlib.mlab.psd "matplotlib.mlab.psd"), [`csd()`](#matplotlib.mlab.csd "matplotlib.mlab.csd")
For information about the methods used to compute \(P\_{xy}\), \(P\_{xx}\) and \(P\_{yy}\).
matplotlib.mlab.complex\_spectrum(*x*, *Fs=None*, *window=None*, *pad\_to=None*, *sides=None*)
Compute the complex-valued frequency spectrum of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
Returns:
**spectrum**1-D array
The complex-valued frequency spectrum.
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
Returns the power spectral density.
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
Returns the complex-valued frequency spectrum.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
Returns the absolute value of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
Returns the angle of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
Returns the phase (unwrapped angle) of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
Can return the complex spectrum of segments within the signal.
matplotlib.mlab.csd(*x*, *y*, *NFFT=None*, *Fs=None*, *detrend=None*, *window=None*, *noverlap=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L590-L651)
Compute the cross-spectral density.
The cross spectral density \(P\_{xy}\) by Welch's average periodogram method. The vectors *x* and *y* are divided into *NFFT* length segments. Each segment is detrended by function *detrend* and windowed by function *window*. *noverlap* gives the length of the overlap between segments. The product of the direct FFTs of *x* and *y* are averaged over each segment to compute \(P\_{xy}\), with a scaling to correct for power loss due to windowing.
If len(*x*) < *NFFT* or len(*y*) < *NFFT*, they will be zero padded to *NFFT*.
Parameters:
**x, y**1-D arrays or sequences
Arrays or sequences containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between segments.
Returns:
**Pxy**1-D array
The values for the cross spectrum \(P\_{xy}\) before scaling (real valued)
**freqs**1-D array
The frequencies corresponding to the elements in *Pxy*
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
equivalent to setting `y = x`.
#### References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib.mlab.detrend(*x*, *key=None*, *axis=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L83-L129)
Return *x* with its trend removed.
Parameters:
**x**array or sequence
Array or sequence containing the data.
**key**{'default', 'constant', 'mean', 'linear', 'none'} or function
The detrending algorithm to use. 'default', 'mean', and 'constant' are the same as [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' is the same as [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"). 'none' is the same as [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). The default is 'mean'. See the corresponding functions for more details regarding the algorithms. Can also be a function that carries out the detrend operation.
**axis**int
The axis along which to do the detrending.
See also
[`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean")
Implementation of the 'mean' algorithm.
[`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear")
Implementation of the 'linear' algorithm.
[`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none")
Implementation of the 'none' algorithm.
matplotlib.mlab.detrend\_linear(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L182-L213)
Return *x* minus best fit line; 'linear' detrending.
Parameters:
**y**0-D or 1-D array or sequence
Array or sequence containing the data
See also
[`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean")
Another detrend algorithm.
[`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none")
Another detrend algorithm.
[`detrend`](#matplotlib.mlab.detrend "matplotlib.mlab.detrend")
A wrapper around all the detrend algorithms.
matplotlib.mlab.detrend\_mean(*x*, *axis=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L132-L157)
Return *x* minus the mean(*x*).
Parameters:
**x**array or sequence
Array or sequence containing the data Can have any dimensionality
**axis**int
The axis along which to take the mean. See [`numpy.mean`](https://numpy.org/doc/stable/reference/generated/numpy.mean.html#numpy.mean "(in NumPy v1.23)") for a description of this argument.
See also
[`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear")
Another detrend algorithm.
[`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none")
Another detrend algorithm.
[`detrend`](#matplotlib.mlab.detrend "matplotlib.mlab.detrend")
A wrapper around all the detrend algorithms.
matplotlib.mlab.detrend\_none(*x*, *axis=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L160-L179)
Return *x*: no detrending.
Parameters:
**x**any object
An object containing the data
**axis**int
This parameter is ignored. It is included for compatibility with detrend\_mean
See also
[`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean")
Another detrend algorithm.
[`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear")
Another detrend algorithm.
[`detrend`](#matplotlib.mlab.detrend "matplotlib.mlab.detrend")
A wrapper around all the detrend algorithms.
matplotlib.mlab.magnitude\_spectrum(*x*, *Fs=None*, *window=None*, *pad\_to=None*, *sides=None*)
Compute the magnitude (absolute value) of the frequency spectrum of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
Returns:
**spectrum**1-D array
The magnitude (absolute value) of the frequency spectrum.
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
Returns the power spectral density.
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
Returns the complex-valued frequency spectrum.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
Returns the absolute value of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
Returns the angle of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
Returns the phase (unwrapped angle) of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
Can return the complex spectrum of segments within the signal.
matplotlib.mlab.phase\_spectrum(*x*, *Fs=None*, *window=None*, *pad\_to=None*, *sides=None*)
Compute the phase of the frequency spectrum (unwrapped phase spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
Returns:
**spectrum**1-D array
The phase of the frequency spectrum (unwrapped phase spectrum).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
Returns the power spectral density.
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
Returns the complex-valued frequency spectrum.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
Returns the absolute value of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
Returns the angle of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
Returns the phase (unwrapped angle) of the [`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum").
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
Can return the complex spectrum of segments within the signal.
matplotlib.mlab.psd(*x*, *NFFT=None*, *Fs=None*, *detrend=None*, *window=None*, *noverlap=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L534-L587)
Compute the power spectral density.
The power spectral density \(P\_{xx}\) by Welch's average periodogram method. The vector *x* is divided into *NFFT* length segments. Each segment is detrended by function *detrend* and windowed by function *window*. *noverlap* gives the length of the overlap between segments. The \(|\mathrm{fft}(i)|^2\) of each segment \(i\) are averaged to compute \(P\_{xx}\).
If len(*x*) < *NFFT*, it will be zero padded to *NFFT*.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between segments.
Returns:
**Pxx**1-D array
The values for the power spectrum \(P\_{xx}\) (real valued)
**freqs**1-D array
The frequencies corresponding to the elements in *Pxx*
See also
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram")
[`specgram`](#matplotlib.mlab.specgram "matplotlib.mlab.specgram") differs in the default overlap; in not returning the mean of the segment periodograms; and in returning the times of the segments.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
returns the magnitude spectrum.
[`csd`](#matplotlib.mlab.csd "matplotlib.mlab.csd")
returns the spectral density between two signals.
#### References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib.mlab.specgram(*x*, *NFFT=None*, *Fs=None*, *detrend=None*, *window=None*, *noverlap=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*, *mode=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L710-L790)
Compute a spectrogram.
Compute and plot a spectrogram of data in *x*. Data are split into *NFFT* length segments and the spectrum of each section is computed. The windowing function *window* is applied to each segment, and the amount of overlap of each segment is specified with *noverlap*.
Parameters:
**x**array-like
1-D array or sequence.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 128
The number of points of overlap between blocks.
**mode**str, default: 'psd'
What sort of spectrum to use:
'psd'
Returns the power spectral density.
'complex'
Returns the complex-valued frequency spectrum.
'magnitude'
Returns the magnitude spectrum.
'angle'
Returns the phase spectrum without unwrapping.
'phase'
Returns the phase spectrum with unwrapping.
Returns:
**spectrum**array-like
2D array, columns are the periodograms of successive segments.
**freqs**array-like
1-D array, frequencies corresponding to the rows in *spectrum*.
**t**array-like
1-D array, the times corresponding to midpoints of segments (i.e the columns in *spectrum*).
See also
[`psd`](#matplotlib.mlab.psd "matplotlib.mlab.psd")
differs in the overlap and in the return values.
[`complex_spectrum`](#matplotlib.mlab.complex_spectrum "matplotlib.mlab.complex_spectrum")
similar, but with complex valued frequencies.
[`magnitude_spectrum`](#matplotlib.mlab.magnitude_spectrum "matplotlib.mlab.magnitude_spectrum")
similar single segment when *mode* is 'magnitude'.
[`angle_spectrum`](#matplotlib.mlab.angle_spectrum "matplotlib.mlab.angle_spectrum")
similar to single segment when *mode* is 'angle'.
[`phase_spectrum`](#matplotlib.mlab.phase_spectrum "matplotlib.mlab.phase_spectrum")
similar to single segment when *mode* is 'phase'.
#### Notes
*detrend* and *scale\_by\_freq* only apply when *mode* is set to 'psd'.
matplotlib.mlab.stride\_windows(*x*, *n*, *noverlap=None*, *axis=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L216-L250)
[*Deprecated*] Get all windows of *x* with length *n* as a single array, using strides to avoid data duplication.
Warning
It is not safe to write to the output array. Multiple elements may point to the same piece of memory, so modifying one value may change others.
Parameters:
**x**1D array or sequence
Array or sequence containing the data.
**n**int
The number of data points in each window.
**noverlap**int, default: 0 (no overlap)
The overlap between adjacent windows.
**axis**int
The axis along which the windows will run.
#### Notes
Deprecated since version 3.6.
#### References
[stackoverflow: Rolling window for 1D arrays in Numpy?](https://stackoverflow.com/a/6811241) [stackoverflow: Using strides for an efficient moving average filter](https://stackoverflow.com/a/4947453)
matplotlib.mlab.window\_hanning(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L61-L69)
Return *x* times the Hanning (or Hann) window of len(*x*).
See also
[`window_none`](#matplotlib.mlab.window_none "matplotlib.mlab.window_none")
Another window algorithm.
matplotlib.mlab.window\_none(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mlab.py#L72-L80)
No window function; simply return *x*.
See also
[`window_hanning`](#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
Another window algorithm.
| programming_docs |
matplotlib matplotlib.type1font matplotlib.type1font
====================
Attention
This module is considered internal.
Its use is deprecated and it will be removed in a future version.
A class representing a Type 1 font.
This version reads pfa and pfb files and splits them for embedding in pdf files. It also supports SlantFont and ExtendFont transformations, similarly to pdfTeX and friends. There is no support yet for subsetting.
Usage:
```
font = Type1Font(filename)
clear_part, encrypted_part, finale = font.parts
slanted_font = font.transform({'slant': 0.167})
extended_font = font.transform({'extend': 1.2})
```
Sources:
* Adobe Technical Note #5040, Supporting Downloadable PostScript Language Fonts.
* Adobe Type 1 Font Format, Adobe Systems Incorporated, third printing, v1.1, 1993. ISBN 0-201-57044-0.
*class*matplotlib.\_type1font.Type1Font(*input*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_type1font.py#L321-L774)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A class representing a Type-1 font, for use by backends.
Attributes:
**parts**tuple
A 3-tuple of the cleartext part, the encrypted part, and the finale of zeros.
**decrypted**bytes
The decrypted form of `parts[1]`.
**prop**dict[str, Any]
A dictionary of font properties. Noteworthy keys include:
* FontName: PostScript name of the font
* Encoding: dict from numeric codes to glyph names
* FontMatrix: bytes object encoding a matrix
* UniqueID: optional font identifier, dropped when modifying the font
* CharStrings: dict from glyph names to byte code
* Subrs: array of byte code subroutines
* OtherSubrs: bytes object encoding some PostScript code
Initialize a Type-1 font.
Parameters:
**input**str or 3-tuple
Either a pfb file name, or a 3-tuple of already-decoded Type-1 font [`parts`](#matplotlib._type1font.Type1Font.parts "matplotlib._type1font.Type1Font.parts").
decrypted
parts
prop
transform(*effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_type1font.py#L694-L774)
Return a new font that is slanted and/or extended.
Parameters:
**effects**dict
A dict with optional entries:
* 'slant'float, default: 0
Tangent of the angle that the font is to be slanted to the right. Negative values slant to the left.
* 'extend'float, default: 1
Scaling factor for the font width. Values less than 1 condense the glyphs.
Returns:
[`Type1Font`](#matplotlib._type1font.Type1Font "matplotlib._type1font.Type1Font")
matplotlib matplotlib.blocking_input matplotlib.blocking\_input
==========================
Classes used for blocking interaction with figure windows:
[`BlockingInput`](#matplotlib.blocking_input.BlockingInput "matplotlib.blocking_input.BlockingInput")
Creates a callable object to retrieve events in a blocking way for interactive sessions. Base class of the other classes listed here.
[`BlockingKeyMouseInput`](#matplotlib.blocking_input.BlockingKeyMouseInput "matplotlib.blocking_input.BlockingKeyMouseInput")
Creates a callable object to retrieve key or mouse clicks in a blocking way for interactive sessions. Used by [`waitforbuttonpress`](figure_api#matplotlib.figure.Figure.waitforbuttonpress "matplotlib.figure.Figure.waitforbuttonpress").
[`BlockingMouseInput`](#matplotlib.blocking_input.BlockingMouseInput "matplotlib.blocking_input.BlockingMouseInput")
Creates a callable object to retrieve mouse clicks in a blocking way for interactive sessions. Used by [`ginput`](figure_api#matplotlib.figure.Figure.ginput "matplotlib.figure.Figure.ginput").
[`BlockingContourLabeler`](#matplotlib.blocking_input.BlockingContourLabeler "matplotlib.blocking_input.BlockingContourLabeler")
Creates a callable object to retrieve mouse clicks in a blocking way that will then be used to place labels on a [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"). Used by [`clabel`](_as_gen/matplotlib.axes.axes.clabel#matplotlib.axes.Axes.clabel "matplotlib.axes.Axes.clabel").
*class*matplotlib.blocking\_input.BlockingContourLabeler(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L270-L325)
Bases: [`BlockingMouseInput`](#matplotlib.blocking_input.BlockingMouseInput "matplotlib.blocking_input.BlockingMouseInput")
Callable for retrieving mouse clicks and key presses in a blocking way.
Used to place contour labels.
add\_click(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L281-L282)
Add the coordinates of an event to the list of clicks.
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
button1(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L287-L302)
Process an button-1 event (add a label to a contour).
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
button3(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L304-L320)
Process an button-3 event (remove a label if not in inline mode).
Unfortunately, if one is doing inline labels, then there is currently no way to fix the broken contour - once humpty-dumpty is broken, he can't be put back together. In inline mode, this does nothing.
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
pop\_click(*event*, *index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L284-L285)
Remove a click (by default, the last) from the list of clicks.
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
*class*matplotlib.blocking\_input.BlockingInput(*fig*, *eventslist=()*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L33-L99)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Callable for retrieving events in a blocking way.
add\_event(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L65-L67)
For base class, this just appends an event to events.
cleanup()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L59-L63)
Disconnect all callbacks.
on\_event(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L40-L54)
Event handler; will be passed to the current figure to retrieve events.
pop(*index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L69-L76)
Remove an event from the event list -- by default, the last.
Note that this does not check that there are events, much like the normal pop method. If no events exist, this will throw an exception.
pop\_event(*index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L69-L76)
Remove an event from the event list -- by default, the last.
Note that this does not check that there are events, much like the normal pop method. If no events exist, this will throw an exception.
post\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L56-L57)
For baseclass, do nothing but collect events.
*class*matplotlib.blocking\_input.BlockingKeyMouseInput(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L328-L354)
Bases: [`BlockingInput`](#matplotlib.blocking_input.BlockingInput "matplotlib.blocking_input.BlockingInput")
Callable for retrieving mouse clicks and key presses in a blocking way.
post\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L337-L342)
Determine if it is a key event.
*class*matplotlib.blocking\_input.BlockingMouseInput(*fig*, *mouse\_add=MouseButton.LEFT*, *mouse\_pop=MouseButton.RIGHT*, *mouse\_stop=MouseButton.MIDDLE*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L102-L267)
Bases: [`BlockingInput`](#matplotlib.blocking_input.BlockingInput "matplotlib.blocking_input.BlockingInput")
Callable for retrieving mouse clicks in a blocking way.
This class will also retrieve keypresses and map them to mouse clicks: delete and backspace are a right click, enter is like a middle click, and all others are like a left click.
add\_click(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L202-L219)
Add the coordinates of an event to the list of clicks.
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
button\_add*=1*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
button\_pop*=3*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
button\_stop*=2*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
cleanup(*event=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L243-L257)
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent"), optional
Not used
key\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L145-L158)
Process a key press event, mapping keys to appropriate mouse clicks.
mouse\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L134-L143)
Process a mouse click event.
mouse\_event\_add(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L160-L171)
Process an button-1 event (add a click if inside axes).
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
mouse\_event\_pop(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L188-L200)
Process an button-3 event (remove the last click).
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
mouse\_event\_stop(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L173-L186)
Process an button-2 event (end blocking input).
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
pop(*event*, *index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L234-L241)
Remove a click and the associated event from the list of clicks.
Defaults to the last click.
pop\_click(*event*, *index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L221-L232)
Remove a click (by default, the last) from the list of clicks.
Parameters:
**event**[`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
post\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/blocking_input.py#L125-L132)
Process an event.
matplotlib backend_tkagg, backend_tkcairo backend\_tkagg, backend\_tkcairo
================================
matplotlib.backends.backend\_tkagg.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkagg.py#L8-L15)
alias of [`FigureCanvasTkAgg`](#matplotlib.backends.backend_tkagg.FigureCanvasTkAgg "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg")
*class*matplotlib.backends.backend\_tkagg.FigureCanvasTkAgg(*figure=None*, *master=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkagg.py#L8-L15)
Bases: [`FigureCanvasAgg`](backend_agg_api#matplotlib.backends.backend_agg.FigureCanvasAgg "matplotlib.backends.backend_agg.FigureCanvasAgg"), `FigureCanvasTk`
blit(*bbox=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkagg.py#L13-L15)
Blit the canvas in bbox (default entire canvas).
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkagg.py#L9-L11)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
matplotlib.backends.backend\_tkcairo.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkcairo.py#L10-L21)
alias of [`FigureCanvasTkCairo`](#matplotlib.backends.backend_tkcairo.FigureCanvasTkCairo "matplotlib.backends.backend_tkcairo.FigureCanvasTkCairo")
*class*matplotlib.backends.backend\_tkcairo.FigureCanvasTkCairo(*figure=None*, *master=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkcairo.py#L10-L21)
Bases: [`FigureCanvasCairo`](backend_cairo_api#matplotlib.backends.backend_cairo.FigureCanvasCairo "matplotlib.backends.backend_cairo.FigureCanvasCairo"), `FigureCanvasTk`
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_tkcairo.py#L11-L21)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
matplotlib matplotlib.scale matplotlib.scale
================
Scales define the distribution of data values on an axis, e.g. a log scaling. They are defined as subclasses of [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase").
See also [`axes.Axes.set_xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") and the scales examples in the documentation.
See [Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html) for a full example of defining a custom scale.
Matplotlib also supports non-separable transformations that operate on both [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") at the same time. They are known as projections, and defined in [`matplotlib.projections`](projections_api#module-matplotlib.projections "matplotlib.projections").
*class*matplotlib.scale.AsinhScale(*axis*, *\**, *linear\_width=1.0*, *base=10*, *subs='auto'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L493-L574)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
A quasi-logarithmic scale based on the inverse hyperbolic sine (asinh)
For values close to zero, this is essentially a linear scale, but for large magnitude values (either positive or negative) it is asymptotically logarithmic. The transition between these linear and logarithmic regimes is smooth, and has no discontinuities in the function gradient in contrast to the [`SymmetricalLogScale`](#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale") ("symlog") scale.
Specifically, the transformation of an axis coordinate \(a\) is \(a \rightarrow a\_0 \sinh^{-1} (a / a\_0)\) where \(a\_0\) is the effective width of the linear region of the transformation. In that region, the transformation is \(a \rightarrow a + \mathcal{O}(a^3)\). For large values of \(a\) the transformation behaves as \(a \rightarrow a\_0 \, \mathrm{sgn}(a) \ln |a| + \mathcal{O}(1)\).
Note
This API is provisional and may be revised in the future based on early user feedback.
Parameters:
**linear\_width**float, default: 1
The scale parameter (elsewhere referred to as \(a\_0\)) defining the extent of the quasi-linear region, and the coordinate values beyond which the transformation becomes asymptotically logarithmic.
**base**int, default: 10
The number base used for rounding tick locations on a logarithmic scale. If this is less than one, then rounding is to the nearest integer multiple of powers of ten.
**subs**sequence of int
Multiples of the number base used for minor ticks. If set to 'auto', this will use built-in defaults, e.g. (2, 5) for base=10.
auto\_tick\_multipliers*={3: (2,), 4: (2,), 5: (2,), 8: (2, 4), 10: (2, 5), 16: (2, 4, 8), 64: (4, 16), 1024: (256, 512)}*
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L561-L562)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") object associated with this scale.
*property*linear\_width
name*='asinh'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L564-L574)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.AsinhTransform(*linear\_width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L460-L475)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Inverse hyperbolic-sine transformation used by [`AsinhScale`](#matplotlib.scale.AsinhScale "matplotlib.scale.AsinhScale")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L474-L475)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L471-L472)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.AsinhTransform.input_dims "matplotlib.scale.AsinhTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.AsinhTransform.input_dims "matplotlib.scale.AsinhTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.AsinhTransform.output_dims "matplotlib.scale.AsinhTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.AsinhTransform.output_dims "matplotlib.scale.AsinhTransform.output_dims")), depending on the input.
*class*matplotlib.scale.FuncScale(*axis*, *functions*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L159-L198)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
Provide an arbitrary scale with user-supplied function for the axis.
Parameters:
**axis**[`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
The axis for the scale.
**functions**(callable, callable)
two-tuple of the forward and inverse functions for the scale. The forward function must be monotonic.
Both functions must have the signature:
```
def forward(values: array-like) -> array-like
```
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L184-L186)
Return the [`FuncTransform`](#matplotlib.scale.FuncTransform "matplotlib.scale.FuncTransform") associated with this scale.
name*='function'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L188-L198)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.FuncScaleLog(*axis*, *functions*, *base=10*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L308-L343)
Bases: [`LogScale`](#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
Provide an arbitrary scale with user-supplied function for the axis and then put on a logarithmic axes.
Parameters:
**axis**[`matplotlib.axis.Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
The axis for the scale.
**functions**(callable, callable)
two-tuple of the forward and inverse functions for the scale. The forward function must be monotonic.
Both functions must have the signature:
```
def forward(values: array-like) -> array-like
```
**base**float, default: 10
Logarithmic base of the scale.
*property*base
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L341-L343)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") associated with this scale.
name*='functionlog'*
*class*matplotlib.scale.FuncTransform(*forward*, *inverse*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L123-L156)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
A simple transform that takes and arbitrary function for the forward and inverse transform.
Parameters:
**forward**callable
The forward function for the transform. This function must have an inverse and, for best behavior, be monotonic. It must have the signature:
```
def forward(values: array-like) -> array-like
```
**inverse**callable
The inverse of the forward function. Signature as `forward`.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L155-L156)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L152-L153)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.FuncTransform.input_dims "matplotlib.scale.FuncTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.FuncTransform.input_dims "matplotlib.scale.FuncTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.FuncTransform.output_dims "matplotlib.scale.FuncTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.FuncTransform.output_dims "matplotlib.scale.FuncTransform.output_dims")), depending on the input.
*class*matplotlib.scale.InvertedAsinhTransform(*linear\_width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L478-L490)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Hyperbolic sine transformation used by [`AsinhScale`](#matplotlib.scale.AsinhScale "matplotlib.scale.AsinhScale")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L489-L490)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L486-L487)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.InvertedAsinhTransform.input_dims "matplotlib.scale.InvertedAsinhTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.InvertedAsinhTransform.input_dims "matplotlib.scale.InvertedAsinhTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.InvertedAsinhTransform.output_dims "matplotlib.scale.InvertedAsinhTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.InvertedAsinhTransform.output_dims "matplotlib.scale.InvertedAsinhTransform.output_dims")), depending on the input.
*class*matplotlib.scale.InvertedLogTransform(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L242-L256)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L255-L256)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L252-L253)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.InvertedLogTransform.input_dims "matplotlib.scale.InvertedLogTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.InvertedLogTransform.input_dims "matplotlib.scale.InvertedLogTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.InvertedLogTransform.output_dims "matplotlib.scale.InvertedLogTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.InvertedLogTransform.output_dims "matplotlib.scale.InvertedLogTransform.output_dims")), depending on the input.
*class*matplotlib.scale.InvertedSymmetricalLogTransform(*base*, *linthresh*, *linscale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L378-L402)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L400-L402)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L390-L398)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.InvertedSymmetricalLogTransform.input_dims "matplotlib.scale.InvertedSymmetricalLogTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.InvertedSymmetricalLogTransform.input_dims "matplotlib.scale.InvertedSymmetricalLogTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.InvertedSymmetricalLogTransform.output_dims "matplotlib.scale.InvertedSymmetricalLogTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.InvertedSymmetricalLogTransform.output_dims "matplotlib.scale.InvertedSymmetricalLogTransform.output_dims")), depending on the input.
*class*matplotlib.scale.LinearScale(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L89-L120)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The default linear scale.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L115-L120)
Return the transform for linear scaling, which is just the [`IdentityTransform`](transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform").
name*='linear'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L103-L113)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.LogScale(*axis*, *\**, *base=10*, *subs=None*, *nonpositive='clip'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L259-L305)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
A standard logarithmic scale. Care is taken to only plot positive values.
Parameters:
**axis**[`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
The axis for the scale.
**base**float, default: 10
The base of the logarithm.
**nonpositive**{'clip', 'mask'}, default: 'clip'
Determines the behavior for non-positive values. They can either be masked as invalid, or clipped to a very small positive number.
**subs**sequence of int, default: None
Where to place the subticks between each major tick. For example, in a log10 scale, `[2, 3, 4, 5, 6, 7, 8, 9]` will place 8 logarithmically spaced minor ticks between each major tick.
*property*base
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L295-L297)
Return the [`LogTransform`](#matplotlib.scale.LogTransform "matplotlib.scale.LogTransform") associated with this scale.
limit\_range\_for\_scale(*vmin*, *vmax*, *minpos*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L299-L305)
Limit the domain to positive values.
name*='log'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L286-L293)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.LogTransform(*base*, *nonpositive='clip'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L201-L239)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L238-L239)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L216-L236)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.LogTransform.input_dims "matplotlib.scale.LogTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.LogTransform.input_dims "matplotlib.scale.LogTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.LogTransform.output_dims "matplotlib.scale.LogTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.LogTransform.output_dims "matplotlib.scale.LogTransform.output_dims")), depending on the input.
*class*matplotlib.scale.LogisticTransform(*nonpositive='mask'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L602-L617)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L613-L614)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L609-L611)
logistic transform (base 10)
*class*matplotlib.scale.LogitScale(*axis*, *nonpositive='mask'*, *\**, *one\_half='\\frac{1}{2}'*, *use\_overline=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L620-L680)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
Logit scale for data between zero and one, both excluded.
This scale is similar to a log scale close to zero and to one, and almost linear around 0.5. It maps the interval ]0, 1[ onto ]-infty, +infty[.
Parameters:
**axis**[`matplotlib.axis.Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
Currently unused.
**nonpositive**{'mask', 'clip'}
Determines the behavior for values beyond the open interval ]0, 1[. They can either be masked as invalid, or clipped to a number very close to 0 or 1.
**use\_overline**bool, default: False
Indicate the usage of survival notation (overline{x}) in place of standard notation (1-x) for probability close to one.
**one\_half**str, default: r"frac{1}{2}"
The string used for ticks formatter to represent 1/2.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L650-L652)
Return the [`LogitTransform`](#matplotlib.scale.LogitTransform "matplotlib.scale.LogitTransform") associated with this scale.
limit\_range\_for\_scale(*vmin*, *vmax*, *minpos*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L673-L680)
Limit the domain to values between 0 and 1 (excluded).
name*='logit'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L654-L671)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.LogitTransform(*nonpositive='mask'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L577-L599)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L595-L596)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L586-L593)
logit transform (base 10), masked or clipped
*class*matplotlib.scale.ScaleBase(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L29-L86)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The base class for all scales.
Scales are separable transformations, working on a single dimension.
Subclasses should override
`name`
The scale's name.
[`get_transform()`](#matplotlib.scale.ScaleBase.get_transform "matplotlib.scale.ScaleBase.get_transform")
A method returning a [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), which converts data coordinates to scaled coordinates. This transform should be invertible, so that e.g. mouse positions can be converted back to data coordinates.
[`set_default_locators_and_formatters()`](#matplotlib.scale.ScaleBase.set_default_locators_and_formatters "matplotlib.scale.ScaleBase.set_default_locators_and_formatters")
A method that sets default locators and formatters for an [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") that uses this scale.
[`limit_range_for_scale()`](#matplotlib.scale.ScaleBase.limit_range_for_scale "matplotlib.scale.ScaleBase.limit_range_for_scale")
An optional method that "fixes" the axis range to acceptable values, e.g. restricting log-scaled axes to positive values.
Construct a new scale.
#### Notes
The following note is for scale implementors.
For back-compatibility reasons, scales take an [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") object as first argument. However, this argument should not be used: a single scale object should be usable by multiple [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")es at the same time.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L65-L69)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") object associated with this scale.
limit\_range\_for\_scale(*vmin*, *vmax*, *minpos*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L78-L86)
Return the range *vmin*, *vmax*, restricted to the domain supported by this scale (if any).
*minpos* should be the minimum positive value in the data. This is used by log scales to determine a minimum value.
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L71-L76)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.SymmetricalLogScale(*axis*, *\**, *base=10*, *linthresh=2*, *subs=None*, *linscale=1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L405-L457)
Bases: [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin.
Since the values close to zero tend toward infinity, there is a need to have a range around zero that is linear. The parameter *linthresh* allows the user to specify the size of this range (-*linthresh*, *linthresh*).
Parameters:
**base**float, default: 10
The base of the logarithm.
**linthresh**float, default: 2
Defines the range `(-x, x)`, within which the plot is linear. This avoids having the plot go to infinity around zero.
**subs**sequence of int
Where to place the subticks between each major tick. For example, in a log10 scale: `[2, 3, 4, 5, 6, 7, 8, 9]` will place 8 logarithmically spaced minor ticks between each major tick.
**linscale**float, optional
This allows the linear range `(-linthresh, linthresh)` to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when *linscale* == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Construct a new scale.
#### Notes
The following note is for scale implementors.
For back-compatibility reasons, scales take an [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") object as first argument. However, this argument should not be used: a single scale object should be usable by multiple [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")es at the same time.
*property*base
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L455-L457)
Return the [`SymmetricalLogTransform`](#matplotlib.scale.SymmetricalLogTransform "matplotlib.scale.SymmetricalLogTransform") associated with this scale.
*property*linscale
*property*linthresh
name*='symlog'*
set\_default\_locators\_and\_formatters(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L447-L453)
Set the locators and formatters of *axis* to instances suitable for this scale.
*class*matplotlib.scale.SymmetricalLogTransform(*base*, *linthresh*, *linscale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L346-L375)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=1*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L373-L375)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=1*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L363-L371)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.scale.SymmetricalLogTransform.input_dims "matplotlib.scale.SymmetricalLogTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.scale.SymmetricalLogTransform.input_dims "matplotlib.scale.SymmetricalLogTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.scale.SymmetricalLogTransform.output_dims "matplotlib.scale.SymmetricalLogTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.scale.SymmetricalLogTransform.output_dims "matplotlib.scale.SymmetricalLogTransform.output_dims")), depending on the input.
matplotlib.scale.get\_scale\_names()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L694-L696)
Return the names of the available scales.
matplotlib.scale.register\_scale(*scale\_class*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L722-L731)
Register a new kind of scale.
Parameters:
**scale\_class**subclass of [`ScaleBase`](#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The scale to register.
matplotlib.scale.scale\_factory(*scale*, *axis*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/scale.py#L699-L714)
Return a scale class by name.
Parameters:
**scale**{'asinh', 'function', 'functionlog', 'linear', 'log', 'logit', 'symlog'}
**axis**[`matplotlib.axis.Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
| programming_docs |
matplotlib matplotlib.legend_handler matplotlib.legend\_handler
==========================
Default legend handlers.
Important
This is a low-level legend API, which most end users do not need.
We recommend that you are familiar with the [legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) before reading this documentation.
Legend handlers are expected to be a callable object with a following signature.
```
legend_handler(legend, orig_handle, fontsize, handlebox)
```
Where *legend* is the legend itself, *orig\_handle* is the original plot, *fontsize* is the fontsize in pixels, and *handlebox* is a OffsetBox instance. Within the call, you should create relevant artists (using relevant properties from the *legend* and/or *orig\_handle*) and add them into the handlebox. The artists needs to be scaled according to the fontsize (note that the size is in pixel, i.e., this is dpi-scaled value).
This module includes definition of several legend handler classes derived from the base class (HandlerBase) with the following method:
```
def legend_artist(self, legend, orig_handle, fontsize, handlebox)
```
*class*matplotlib.legend\_handler.HandlerBase(*xpad=0.0*, *ypad=0.0*, *update\_func=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L47-L136)
A Base class for default legend handlers.
The derived classes are meant to override *create\_artists* method, which has a following signature.:
```
def create_artists(self, legend, orig_handle,
xdescent, ydescent, width, height, fontsize,
trans):
```
The overridden method needs to create artists of the given transform that fits in the given dimension (xdescent, ydescent, width, height) that are scaled by fontsize if necessary.
adjust\_drawing\_area(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L84-L91)
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L133-L136)
legend\_artist(*legend*, *orig\_handle*, *fontsize*, *handlebox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L93-L131)
Return the artist that this HandlerBase generates for the given original artist/handle.
Parameters:
**legend**[`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
The legend for which these legend artists are being created.
**orig\_handle**[`matplotlib.artist.Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or similar
The object for which these legend artists are being created.
**fontsize**int
The fontsize in pixels. The artists being created should be scaled according to the given fontsize.
**handlebox**[`matplotlib.offsetbox.OffsetBox`](offsetbox_api#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The box which has been created to hold this legend entry's artists. Artists created in the [`legend_artist`](#matplotlib.legend_handler.HandlerBase.legend_artist "matplotlib.legend_handler.HandlerBase.legend_artist") method must be added to this handlebox inside this method.
update\_prop(*legend\_handle*, *orig\_handle*, *legend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L76-L82)
*class*matplotlib.legend\_handler.HandlerCircleCollection(*yoffsets=None*, *sizes=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L507-L513)
Handler for [`CircleCollection`](collections_api#matplotlib.collections.CircleCollection "matplotlib.collections.CircleCollection")s.
Parameters:
**numpoints**int
Number of points to show in legend entry.
**yoffsets**array of floats
Length *numpoints* list of y offsets for each point in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerNpoints`](#matplotlib.legend_handler.HandlerNpoints "matplotlib.legend_handler.HandlerNpoints").
create\_collection(*orig\_handle*, *sizes*, *offsets*, *offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L510-L513)
*class*matplotlib.legend\_handler.HandlerErrorbar(*xerr\_size=0.5*, *yerr\_size=None*, *marker\_pad=0.3*, *numpoints=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L516-L620)
Handler for Errorbars.
Parameters:
**marker\_pad**float
Padding between points in legend entry.
**numpoints**int
Number of points to show in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L538-L620)
get\_err\_size(*legend*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L527-L536)
*class*matplotlib.legend\_handler.HandlerLine2D(*marker\_pad=0.3*, *numpoints=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L266-L302)
Handler for [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances.
See also
[`HandlerLine2DCompound`](#matplotlib.legend_handler.HandlerLine2DCompound "matplotlib.legend_handler.HandlerLine2DCompound")
An earlier handler implementation, which used one artist for the line and another for the marker(s).
Parameters:
**marker\_pad**float
Padding between points in legend entry.
**numpoints**int
Number of points to show in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L276-L302)
*class*matplotlib.legend\_handler.HandlerLine2DCompound(*marker\_pad=0.3*, *numpoints=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L211-L245)
Original handler for [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances, that relies on combining a line-only with a marker-only artist. May be deprecated in the future.
Parameters:
**marker\_pad**float
Padding between points in legend entry.
**numpoints**int
Number of points to show in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L217-L245)
*class*matplotlib.legend\_handler.HandlerLineCollection(*marker\_pad=0.3*, *numpoints=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L391-L420)
Handler for [`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instances.
Parameters:
**marker\_pad**float
Padding between points in legend entry.
**numpoints**int
Number of points to show in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L409-L420)
get\_numpoints(*legend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L395-L399)
*class*matplotlib.legend\_handler.HandlerNpoints(*marker\_pad=0.3*, *numpoints=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L139-L178)
A legend handler that shows *numpoints* points in the legend entry.
Parameters:
**marker\_pad**float
Padding between points in legend entry.
**numpoints**int
Number of points to show in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
get\_numpoints(*legend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L160-L164)
get\_xdata(*legend*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L166-L178)
*class*matplotlib.legend\_handler.HandlerNpointsYoffsets(*numpoints=None*, *yoffsets=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L181-L208)
A legend handler that shows *numpoints* in the legend, and allows them to be individually offset in the y-direction.
Parameters:
**numpoints**int
Number of points to show in legend entry.
**yoffsets**array of floats
Length *numpoints* list of y offsets for each point in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerNpoints`](#matplotlib.legend_handler.HandlerNpoints "matplotlib.legend_handler.HandlerNpoints").
get\_ydata(*legend*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L202-L208)
*class*matplotlib.legend\_handler.HandlerPatch(*patch\_func=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L305-L348)
Handler for [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") instances.
Parameters:
**patch\_func**callable, optional
The function that creates the legend key artist. *patch\_func* should have the signature:
```
def patch_func(legend=legend, orig_handle=orig_handle,
xdescent=xdescent, ydescent=ydescent,
width=width, height=height, fontsize=fontsize)
```
Subsequently the created artist will have its `update_prop` method called and the appropriate transform will be applied.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L342-L348)
*class*matplotlib.legend\_handler.HandlerPathCollection(*yoffsets=None*, *sizes=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L496-L504)
Handler for [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s, which are used by [`scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
Parameters:
**numpoints**int
Number of points to show in legend entry.
**yoffsets**array of floats
Length *numpoints* list of y offsets for each point in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerNpoints`](#matplotlib.legend_handler.HandlerNpoints "matplotlib.legend_handler.HandlerNpoints").
create\_collection(*orig\_handle*, *sizes*, *offsets*, *offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L499-L504)
*class*matplotlib.legend\_handler.HandlerPolyCollection(*xpad=0.0*, *ypad=0.0*, *update\_func=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L768-L808)
Handler for [`PolyCollection`](collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") used in [`fill_between`](_as_gen/matplotlib.axes.axes.fill_between#matplotlib.axes.Axes.fill_between "matplotlib.axes.Axes.fill_between") and [`stackplot`](_as_gen/matplotlib.axes.axes.stackplot#matplotlib.axes.Axes.stackplot "matplotlib.axes.Axes.stackplot").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L802-L808)
*class*matplotlib.legend\_handler.HandlerRegularPolyCollection(*yoffsets=None*, *sizes=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L423-L493)
Handler for [`RegularPolyCollection`](collections_api#matplotlib.collections.RegularPolyCollection "matplotlib.collections.RegularPolyCollection")s.
Parameters:
**numpoints**int
Number of points to show in legend entry.
**yoffsets**array of floats
Length *numpoints* list of y offsets for each point in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerNpoints`](#matplotlib.legend_handler.HandlerNpoints "matplotlib.legend_handler.HandlerNpoints").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L475-L493)
create\_collection(*orig\_handle*, *sizes*, *offsets*, *offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L467-L473)
get\_numpoints(*legend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L431-L435)
get\_sizes(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L437-L456)
update\_prop(*legend\_handle*, *orig\_handle*, *legend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L458-L465)
*class*matplotlib.legend\_handler.HandlerStem(*marker\_pad=0.3*, *numpoints=None*, *bottom=None*, *yoffsets=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L623-L710)
Handler for plots produced by [`stem`](_as_gen/matplotlib.axes.axes.stem#matplotlib.axes.Axes.stem "matplotlib.axes.Axes.stem").
Parameters:
**marker\_pad**float, default: 0.3
Padding between points in legend entry.
**numpoints**int, optional
Number of points to show in legend entry.
**bottom**float, optional
**yoffsets**array of floats, optional
Length *numpoints* list of y offsets for each point in legend entry.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerNpointsYoffsets`](#matplotlib.legend_handler.HandlerNpointsYoffsets "matplotlib.legend_handler.HandlerNpointsYoffsets").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L657-L702)
get\_ydata(*legend*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L649-L655)
*class*matplotlib.legend\_handler.HandlerStepPatch(*xpad=0.0*, *ypad=0.0*, *update\_func=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L351-L388)
Handler for [`StepPatch`](_as_gen/matplotlib.patches.steppatch#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch") instances.
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L378-L388)
*class*matplotlib.legend\_handler.HandlerTuple(*ndivide=1*, *pad=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L713-L765)
Handler for Tuple.
Parameters:
**ndivide**int, default: 1
The number of sections to divide the legend area into. If None, use the length of the input tuple.
**pad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
Padding in units of fraction of font size.
**\*\*kwargs**
Keyword arguments forwarded to [`HandlerBase`](#matplotlib.legend_handler.HandlerBase "matplotlib.legend_handler.HandlerBase").
create\_artists(*legend*, *orig\_handle*, *xdescent*, *ydescent*, *width*, *height*, *fontsize*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L734-L765)
matplotlib.legend\_handler.update\_from\_first\_child(*tgt*, *src*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/legend_handler.py#L41-L44)
matplotlib matplotlib.ft2font matplotlib.ft2font
==================
*class*matplotlib.ft2font.FT2Font(*filename*, *hinting\_factor=8*, *\**, *\_fallback\_list=None*, *\_kerning\_factor=0*)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Create a new FT2Font object.
Parameters:
**filename**str or file-like
The source of the font data in a format (ttf or ttc) that FreeType can read
**hinting\_factor**int, optional
Must be positive. Used to scale the hinting in the x-direction
**\_fallback\_list**list of FT2Font, optional
A list of FT2Font objects used to find missing glyphs.
Warning
This API is both private and provisional: do not use it directly
**\_kerning\_factor**int, optional
Used to adjust the degree of kerning.
Warning
This API is private: do not use it directly
Attributes:
**num\_faces**
Number of faces in file.
**face\_flags, style\_flags**int
Face and style flags; see the ft2font constants.
**num\_glyphs**
Number of glyphs in the face.
**family\_name, style\_name**
Face family and style name.
**num\_fixed\_sizes**
Number of bitmap in the face.
**scalable**
Whether face is scalable; attributes after this one are only defined for scalable faces.
**bbox**
Face global bounding box (xmin, ymin, xmax, ymax).
**units\_per\_EM**
Number of font units covered by the EM.
**ascender, descender**
Ascender and descender in 26.6 units.
**height**
Height in 26.6 units; used to compute a default line spacing (baseline-to-baseline distance).
**max\_advance\_width, max\_advance\_height**
Maximum horizontal and vertical cursor advance for all glyphs.
**underline\_position, underline\_thickness**
Vertical position and thickness of the underline bar.
**postscript\_name**
PostScript name of the font.
ascender
bbox
clear(*self*)
Clear all the glyphs, reset for a new call to [`set_text`](#matplotlib.ft2font.FT2Font.set_text "matplotlib.ft2font.FT2Font.set_text").
descender
draw\_glyph\_to\_bitmap(*self*, *image*, *x*, *y*, *glyph*, *antialiased=True*)
Draw a single glyph to the bitmap at pixel locations x, y Note it is your responsibility to set up the bitmap manually with `set_bitmap_size(w, h)` before this call is made.
If you want automatic layout, use [`set_text`](#matplotlib.ft2font.FT2Font.set_text "matplotlib.ft2font.FT2Font.set_text") in combinations with [`draw_glyphs_to_bitmap`](#matplotlib.ft2font.FT2Font.draw_glyphs_to_bitmap "matplotlib.ft2font.FT2Font.draw_glyphs_to_bitmap"). This function is instead intended for people who want to render individual glyphs (e.g., returned by [`load_char`](#matplotlib.ft2font.FT2Font.load_char "matplotlib.ft2font.FT2Font.load_char")) at precise locations.
draw\_glyphs\_to\_bitmap(*self*, *antialiased=True*)
Draw the glyphs that were loaded by [`set_text`](#matplotlib.ft2font.FT2Font.set_text "matplotlib.ft2font.FT2Font.set_text") to the bitmap. The bitmap size will be automatically set to include the glyphs.
face\_flags
family\_name
fname
get\_bitmap\_offset(*self*)
Get the (x, y) offset in 26.6 subpixels for the bitmap if ink hangs left or below (0, 0). Since Matplotlib only supports left-to-right text, y is always 0.
get\_char\_index(*self*, *codepoint*)
Return the glyph index corresponding to a character *codepoint*.
get\_charmap(*self*)
Return a dict that maps the character codes of the selected charmap (Unicode by default) to their corresponding glyph indices.
get\_descent(*self*)
Get the descent in 26.6 subpixels of the current string set by [`set_text`](#matplotlib.ft2font.FT2Font.set_text "matplotlib.ft2font.FT2Font.set_text"). The rotation of the string is accounted for. To get the descent in pixels, divide this value by 64.
get\_glyph\_name(*self*, *index*)
Retrieve the ASCII name of a given glyph *index* in a face.
Due to Matplotlib's internal design, for fonts that do not contain glyph names (per FT\_FACE\_FLAG\_GLYPH\_NAMES), this returns a made-up name which does *not* roundtrip through [`get_name_index`](#matplotlib.ft2font.FT2Font.get_name_index "matplotlib.ft2font.FT2Font.get_name_index").
get\_image(*self*)
Return the underlying image buffer for this font object.
get\_kerning(*self*, *left*, *right*, *mode*)
Get the kerning between *left* and *right* glyph indices. *mode* is a kerning mode constant:
* KERNING\_DEFAULT - Return scaled and grid-fitted kerning distances
* KERNING\_UNFITTED - Return scaled but un-grid-fitted kerning distances
* KERNING\_UNSCALED - Return the kerning vector in original font units
get\_name\_index(*self*, *name*)
Return the glyph index of a given glyph *name*. The glyph index 0 means 'undefined character code'.
get\_num\_glyphs(*self*)
Return the number of loaded glyphs.
get\_path(*self*)
Get the path data from the currently loaded glyph as a tuple of vertices, codes.
get\_ps\_font\_info(*self*)
Return the information in the PS Font Info structure.
get\_sfnt(*self*)
Load the entire SFNT names table, as a dict whose keys are (platform-ID, ISO-encoding-scheme, language-code, and description) tuples.
get\_sfnt\_table(*self*, *name*)
Return one of the following SFNT tables: head, maxp, OS/2, hhea, vhea, post, or pclt.
get\_width\_height(*self*)
Get the width and height in 26.6 subpixels of the current string set by [`set_text`](#matplotlib.ft2font.FT2Font.set_text "matplotlib.ft2font.FT2Font.set_text"). The rotation of the string is accounted for. To get width and height in pixels, divide these values by 64.
get\_xys(*self*, *antialiased=True*)
Get the xy locations of the current glyphs.
height
load\_char(*self*, *charcode*, *flags=32*)
Load character with *charcode* in current fontfile and set glyph. *flags* can be a bitwise-or of the LOAD\_XXX constants; the default value is LOAD\_FORCE\_AUTOHINT. Return value is a Glyph object, with attributes
* width: glyph width
* height: glyph height
* bbox: the glyph bbox (xmin, ymin, xmax, ymax)
* horiBearingX: left side bearing in horizontal layouts
* horiBearingY: top side bearing in horizontal layouts
* horiAdvance: advance width for horizontal layout
* vertBearingX: left side bearing in vertical layouts
* vertBearingY: top side bearing in vertical layouts
* vertAdvance: advance height for vertical layout
load\_glyph(*self*, *glyphindex*, *flags=32*)
Load character with *glyphindex* in current fontfile and set glyph. *flags* can be a bitwise-or of the LOAD\_XXX constants; the default value is LOAD\_FORCE\_AUTOHINT. Return value is a Glyph object, with attributes
* width: glyph width
* height: glyph height
* bbox: the glyph bbox (xmin, ymin, xmax, ymax)
* horiBearingX: left side bearing in horizontal layouts
* horiBearingY: top side bearing in horizontal layouts
* horiAdvance: advance width for horizontal layout
* vertBearingX: left side bearing in vertical layouts
* vertBearingY: top side bearing in vertical layouts
* vertAdvance: advance height for vertical layout
max\_advance\_height
max\_advance\_width
num\_charmaps
num\_faces
num\_fixed\_sizes
num\_glyphs
postscript\_name
scalable
select\_charmap(*self*, *i*)
Select a charmap by its FT\_Encoding number.
set\_charmap(*self*, *i*)
Make the i-th charmap current.
set\_size(*self*, *ptsize*, *dpi*)
Set the point size and dpi of the text.
set\_text(*self*, *string*, *angle*, *flags=32*)
Set the text *string* and *angle*. *flags* can be a bitwise-or of the LOAD\_XXX constants; the default value is LOAD\_FORCE\_AUTOHINT. You must call this before [`draw_glyphs_to_bitmap`](#matplotlib.ft2font.FT2Font.draw_glyphs_to_bitmap "matplotlib.ft2font.FT2Font.draw_glyphs_to_bitmap"). A sequence of x,y positions is returned.
style\_flags
style\_name
underline\_position
underline\_thickness
units\_per\_EM
*class*matplotlib.ft2font.FT2Image
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
draw\_rect(*self*, *x0*, *y0*, *x1*, *y1*)
Draw an empty rectangle to the image.
draw\_rect\_filled(*self*, *x0*, *y0*, *x1*, *y1*)
Draw a filled rectangle to the image.
| programming_docs |
matplotlib matplotlib.lines matplotlib.lines
================
2D lines with support for a variety of line styles, markers, colors, etc.
Classes
-------
| | |
| --- | --- |
| [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")(xdata, ydata, \*[, linewidth, ...]) | A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. |
| [`VertexSelector`](_as_gen/matplotlib.lines.vertexselector#matplotlib.lines.VertexSelector "matplotlib.lines.VertexSelector")(line) | Manage the callbacks to maintain a list of selected vertices for [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). |
Functions
---------
| | |
| --- | --- |
| [`segment_hits`](_as_gen/matplotlib.lines.segment_hits#matplotlib.lines.segment_hits "matplotlib.lines.segment_hits")(cx, cy, x, y, radius) | Return the indices of the segments in the polyline with coordinates (*cx*, *cy*) that are within a distance *radius* of the point (*x*, *y*). |
matplotlib matplotlib.axes matplotlib.axes
===============
Table of Contents
* [Inheritance](#inheritance)
* [The Axes class](#the-axes-class)
* [Subplots](#subplots)
* [Plotting](#plotting)
+ [Basic](#basic)
+ [Spans](#spans)
+ [Spectral](#spectral)
+ [Statistics](#statistics)
+ [Binned](#binned)
+ [Contours](#contours)
+ [2D arrays](#d-arrays)
+ [Unstructured triangles](#unstructured-triangles)
+ [Text and annotations](#text-and-annotations)
+ [Vector fields](#vector-fields)
* [Clearing](#clearing)
* [Appearance](#appearance)
* [Property cycle](#property-cycle)
* [Axis / limits](#axis-limits)
+ [Axis limits and direction](#axis-limits-and-direction)
+ [Axis labels, title, and legend](#axis-labels-title-and-legend)
+ [Axis scales](#axis-scales)
+ [Autoscaling and margins](#autoscaling-and-margins)
+ [Aspect ratio](#aspect-ratio)
+ [Ticks and tick labels](#ticks-and-tick-labels)
* [Units](#units)
* [Adding artists](#adding-artists)
* [Twinning and sharing](#twinning-and-sharing)
* [Axes position](#axes-position)
* [Async/event based](#async-event-based)
* [Interactive](#interactive)
* [Children](#children)
* [Drawing](#drawing)
* [Projection](#projection)
* [Other](#other)
Inheritance
-----------
The Axes class
--------------
*class*matplotlib.axes.Axes(*fig*, *rect*, *\**, *facecolor=None*, *frameon=True*, *sharex=None*, *sharey=None*, *label=''*, *xscale=None*, *yscale=None*, *box\_aspect=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L46-L8201)
Bases: `_AxesBase`
The [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") contains most of the figure elements: [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis"), [`Tick`](axis_api#matplotlib.axis.Tick "matplotlib.axis.Tick"), [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"), [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"), [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon"), etc., and sets the coordinate system.
The [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") instance supports callbacks through a callbacks attribute which is a [`CallbackRegistry`](cbook_api#matplotlib.cbook.CallbackRegistry "matplotlib.cbook.CallbackRegistry") instance. The events you can connect to are 'xlim\_changed' and 'ylim\_changed' and the callback will be called with func(*ax*) where *ax* is the [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") instance.
Attributes:
**dataLim**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The bounding box enclosing all data displayed in the Axes.
**viewLim**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The view limits in data coordinates.
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
Subplots
--------
| | |
| --- | --- |
| [`SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase") | Base class for subplots, which are [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") instances with additional methods to facilitate generating and manipulating a set of [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes") within a figure. |
| [`subplot_class_factory`](_as_gen/matplotlib.axes.subplot_class_factory#matplotlib.axes.subplot_class_factory "matplotlib.axes.subplot_class_factory") | |
Plotting
--------
### Basic
| | |
| --- | --- |
| [`Axes.plot`](_as_gen/matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") | Plot y versus x as lines and/or markers. |
| [`Axes.errorbar`](_as_gen/matplotlib.axes.axes.errorbar#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar") | Plot y versus x as lines and/or markers with attached errorbars. |
| [`Axes.scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter") | A scatter plot of *y* vs. |
| [`Axes.plot_date`](_as_gen/matplotlib.axes.axes.plot_date#matplotlib.axes.Axes.plot_date "matplotlib.axes.Axes.plot_date") | [*Discouraged*] Plot coercing the axis to treat floats as dates. |
| [`Axes.step`](_as_gen/matplotlib.axes.axes.step#matplotlib.axes.Axes.step "matplotlib.axes.Axes.step") | Make a step plot. |
| [`Axes.loglog`](_as_gen/matplotlib.axes.axes.loglog#matplotlib.axes.Axes.loglog "matplotlib.axes.Axes.loglog") | Make a plot with log scaling on both the x and y axis. |
| [`Axes.semilogx`](_as_gen/matplotlib.axes.axes.semilogx#matplotlib.axes.Axes.semilogx "matplotlib.axes.Axes.semilogx") | Make a plot with log scaling on the x axis. |
| [`Axes.semilogy`](_as_gen/matplotlib.axes.axes.semilogy#matplotlib.axes.Axes.semilogy "matplotlib.axes.Axes.semilogy") | Make a plot with log scaling on the y axis. |
| [`Axes.fill_between`](_as_gen/matplotlib.axes.axes.fill_between#matplotlib.axes.Axes.fill_between "matplotlib.axes.Axes.fill_between") | Fill the area between two horizontal curves. |
| [`Axes.fill_betweenx`](_as_gen/matplotlib.axes.axes.fill_betweenx#matplotlib.axes.Axes.fill_betweenx "matplotlib.axes.Axes.fill_betweenx") | Fill the area between two vertical curves. |
| [`Axes.bar`](_as_gen/matplotlib.axes.axes.bar#matplotlib.axes.Axes.bar "matplotlib.axes.Axes.bar") | Make a bar plot. |
| [`Axes.barh`](_as_gen/matplotlib.axes.axes.barh#matplotlib.axes.Axes.barh "matplotlib.axes.Axes.barh") | Make a horizontal bar plot. |
| [`Axes.bar_label`](_as_gen/matplotlib.axes.axes.bar_label#matplotlib.axes.Axes.bar_label "matplotlib.axes.Axes.bar_label") | Label a bar plot. |
| [`Axes.stem`](_as_gen/matplotlib.axes.axes.stem#matplotlib.axes.Axes.stem "matplotlib.axes.Axes.stem") | Create a stem plot. |
| [`Axes.eventplot`](_as_gen/matplotlib.axes.axes.eventplot#matplotlib.axes.Axes.eventplot "matplotlib.axes.Axes.eventplot") | Plot identical parallel lines at the given positions. |
| [`Axes.pie`](_as_gen/matplotlib.axes.axes.pie#matplotlib.axes.Axes.pie "matplotlib.axes.Axes.pie") | Plot a pie chart. |
| [`Axes.stackplot`](_as_gen/matplotlib.axes.axes.stackplot#matplotlib.axes.Axes.stackplot "matplotlib.axes.Axes.stackplot") | Draw a stacked area plot. |
| [`Axes.broken_barh`](_as_gen/matplotlib.axes.axes.broken_barh#matplotlib.axes.Axes.broken_barh "matplotlib.axes.Axes.broken_barh") | Plot a horizontal sequence of rectangles. |
| [`Axes.vlines`](_as_gen/matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines") | Plot vertical lines at each *x* from *ymin* to *ymax*. |
| [`Axes.hlines`](_as_gen/matplotlib.axes.axes.hlines#matplotlib.axes.Axes.hlines "matplotlib.axes.Axes.hlines") | Plot horizontal lines at each *y* from *xmin* to *xmax*. |
| [`Axes.fill`](_as_gen/matplotlib.axes.axes.fill#matplotlib.axes.Axes.fill "matplotlib.axes.Axes.fill") | Plot filled polygons. |
### Spans
| | |
| --- | --- |
| [`Axes.axhline`](_as_gen/matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline") | Add a horizontal line across the Axes. |
| [`Axes.axhspan`](_as_gen/matplotlib.axes.axes.axhspan#matplotlib.axes.Axes.axhspan "matplotlib.axes.Axes.axhspan") | Add a horizontal span (rectangle) across the Axes. |
| [`Axes.axvline`](_as_gen/matplotlib.axes.axes.axvline#matplotlib.axes.Axes.axvline "matplotlib.axes.Axes.axvline") | Add a vertical line across the Axes. |
| [`Axes.axvspan`](_as_gen/matplotlib.axes.axes.axvspan#matplotlib.axes.Axes.axvspan "matplotlib.axes.Axes.axvspan") | Add a vertical span (rectangle) across the Axes. |
| [`Axes.axline`](_as_gen/matplotlib.axes.axes.axline#matplotlib.axes.Axes.axline "matplotlib.axes.Axes.axline") | Add an infinitely long straight line. |
### Spectral
| | |
| --- | --- |
| [`Axes.acorr`](_as_gen/matplotlib.axes.axes.acorr#matplotlib.axes.Axes.acorr "matplotlib.axes.Axes.acorr") | Plot the autocorrelation of *x*. |
| [`Axes.angle_spectrum`](_as_gen/matplotlib.axes.axes.angle_spectrum#matplotlib.axes.Axes.angle_spectrum "matplotlib.axes.Axes.angle_spectrum") | Plot the angle spectrum. |
| [`Axes.cohere`](_as_gen/matplotlib.axes.axes.cohere#matplotlib.axes.Axes.cohere "matplotlib.axes.Axes.cohere") | Plot the coherence between *x* and *y*. |
| [`Axes.csd`](_as_gen/matplotlib.axes.axes.csd#matplotlib.axes.Axes.csd "matplotlib.axes.Axes.csd") | Plot the cross-spectral density. |
| [`Axes.magnitude_spectrum`](_as_gen/matplotlib.axes.axes.magnitude_spectrum#matplotlib.axes.Axes.magnitude_spectrum "matplotlib.axes.Axes.magnitude_spectrum") | Plot the magnitude spectrum. |
| [`Axes.phase_spectrum`](_as_gen/matplotlib.axes.axes.phase_spectrum#matplotlib.axes.Axes.phase_spectrum "matplotlib.axes.Axes.phase_spectrum") | Plot the phase spectrum. |
| [`Axes.psd`](_as_gen/matplotlib.axes.axes.psd#matplotlib.axes.Axes.psd "matplotlib.axes.Axes.psd") | Plot the power spectral density. |
| [`Axes.specgram`](_as_gen/matplotlib.axes.axes.specgram#matplotlib.axes.Axes.specgram "matplotlib.axes.Axes.specgram") | Plot a spectrogram. |
| [`Axes.xcorr`](_as_gen/matplotlib.axes.axes.xcorr#matplotlib.axes.Axes.xcorr "matplotlib.axes.Axes.xcorr") | Plot the cross correlation between *x* and *y*. |
### Statistics
| | |
| --- | --- |
| [`Axes.boxplot`](_as_gen/matplotlib.axes.axes.boxplot#matplotlib.axes.Axes.boxplot "matplotlib.axes.Axes.boxplot") | Draw a box and whisker plot. |
| [`Axes.violinplot`](_as_gen/matplotlib.axes.axes.violinplot#matplotlib.axes.Axes.violinplot "matplotlib.axes.Axes.violinplot") | Make a violin plot. |
| [`Axes.violin`](_as_gen/matplotlib.axes.axes.violin#matplotlib.axes.Axes.violin "matplotlib.axes.Axes.violin") | Drawing function for violin plots. |
| [`Axes.bxp`](_as_gen/matplotlib.axes.axes.bxp#matplotlib.axes.Axes.bxp "matplotlib.axes.Axes.bxp") | Drawing function for box and whisker plots. |
### Binned
| | |
| --- | --- |
| [`Axes.hexbin`](_as_gen/matplotlib.axes.axes.hexbin#matplotlib.axes.Axes.hexbin "matplotlib.axes.Axes.hexbin") | Make a 2D hexagonal binning plot of points *x*, *y*. |
| [`Axes.hist`](_as_gen/matplotlib.axes.axes.hist#matplotlib.axes.Axes.hist "matplotlib.axes.Axes.hist") | Compute and plot a histogram. |
| [`Axes.hist2d`](_as_gen/matplotlib.axes.axes.hist2d#matplotlib.axes.Axes.hist2d "matplotlib.axes.Axes.hist2d") | Make a 2D histogram plot. |
| [`Axes.stairs`](_as_gen/matplotlib.axes.axes.stairs#matplotlib.axes.Axes.stairs "matplotlib.axes.Axes.stairs") | A stepwise constant function as a line with bounding edges or a filled plot. |
### Contours
| | |
| --- | --- |
| [`Axes.clabel`](_as_gen/matplotlib.axes.axes.clabel#matplotlib.axes.Axes.clabel "matplotlib.axes.Axes.clabel") | Label a contour plot. |
| [`Axes.contour`](_as_gen/matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") | Plot contour lines. |
| [`Axes.contourf`](_as_gen/matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") | Plot filled contours. |
### 2D arrays
| | |
| --- | --- |
| [`Axes.imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") | Display data as an image, i.e., on a 2D regular raster. |
| [`Axes.matshow`](_as_gen/matplotlib.axes.axes.matshow#matplotlib.axes.Axes.matshow "matplotlib.axes.Axes.matshow") | Plot the values of a 2D matrix or array as color-coded image. |
| [`Axes.pcolor`](_as_gen/matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") | Create a pseudocolor plot with a non-regular rectangular grid. |
| [`Axes.pcolorfast`](_as_gen/matplotlib.axes.axes.pcolorfast#matplotlib.axes.Axes.pcolorfast "matplotlib.axes.Axes.pcolorfast") | Create a pseudocolor plot with a non-regular rectangular grid. |
| [`Axes.pcolormesh`](_as_gen/matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") | Create a pseudocolor plot with a non-regular rectangular grid. |
| [`Axes.spy`](_as_gen/matplotlib.axes.axes.spy#matplotlib.axes.Axes.spy "matplotlib.axes.Axes.spy") | Plot the sparsity pattern of a 2D array. |
### Unstructured triangles
| | |
| --- | --- |
| [`Axes.tripcolor`](_as_gen/matplotlib.axes.axes.tripcolor#matplotlib.axes.Axes.tripcolor "matplotlib.axes.Axes.tripcolor") | Create a pseudocolor plot of an unstructured triangular grid. |
| [`Axes.triplot`](_as_gen/matplotlib.axes.axes.triplot#matplotlib.axes.Axes.triplot "matplotlib.axes.Axes.triplot") | Draw an unstructured triangular grid as lines and/or markers. |
| [`Axes.tricontour`](_as_gen/matplotlib.axes.axes.tricontour#matplotlib.axes.Axes.tricontour "matplotlib.axes.Axes.tricontour") | Draw contour lines on an unstructured triangular grid. |
| [`Axes.tricontourf`](_as_gen/matplotlib.axes.axes.tricontourf#matplotlib.axes.Axes.tricontourf "matplotlib.axes.Axes.tricontourf") | Draw contour regions on an unstructured triangular grid. |
### Text and annotations
| | |
| --- | --- |
| [`Axes.annotate`](_as_gen/matplotlib.axes.axes.annotate#matplotlib.axes.Axes.annotate "matplotlib.axes.Axes.annotate") | Annotate the point *xy* with text *text*. |
| [`Axes.text`](_as_gen/matplotlib.axes.axes.text#matplotlib.axes.Axes.text "matplotlib.axes.Axes.text") | Add text to the Axes. |
| [`Axes.table`](_as_gen/matplotlib.axes.axes.table#matplotlib.axes.Axes.table "matplotlib.axes.Axes.table") | Add a table to an [`Axes`](#matplotlib.axes.Axes "matplotlib.axes.Axes"). |
| [`Axes.arrow`](_as_gen/matplotlib.axes.axes.arrow#matplotlib.axes.Axes.arrow "matplotlib.axes.Axes.arrow") | Add an arrow to the Axes. |
| [`Axes.inset_axes`](_as_gen/matplotlib.axes.axes.inset_axes#matplotlib.axes.Axes.inset_axes "matplotlib.axes.Axes.inset_axes") | Add a child inset Axes to this existing Axes. |
| [`Axes.indicate_inset`](_as_gen/matplotlib.axes.axes.indicate_inset#matplotlib.axes.Axes.indicate_inset "matplotlib.axes.Axes.indicate_inset") | Add an inset indicator to the Axes. |
| [`Axes.indicate_inset_zoom`](_as_gen/matplotlib.axes.axes.indicate_inset_zoom#matplotlib.axes.Axes.indicate_inset_zoom "matplotlib.axes.Axes.indicate_inset_zoom") | Add an inset indicator rectangle to the Axes based on the axis limits for an *inset\_ax* and draw connectors between *inset\_ax* and the rectangle. |
| [`Axes.secondary_xaxis`](_as_gen/matplotlib.axes.axes.secondary_xaxis#matplotlib.axes.Axes.secondary_xaxis "matplotlib.axes.Axes.secondary_xaxis") | Add a second x-axis to this Axes. |
| [`Axes.secondary_yaxis`](_as_gen/matplotlib.axes.axes.secondary_yaxis#matplotlib.axes.Axes.secondary_yaxis "matplotlib.axes.Axes.secondary_yaxis") | Add a second y-axis to this Axes. |
### Vector fields
| | |
| --- | --- |
| [`Axes.barbs`](_as_gen/matplotlib.axes.axes.barbs#matplotlib.axes.Axes.barbs "matplotlib.axes.Axes.barbs") | Plot a 2D field of barbs. |
| [`Axes.quiver`](_as_gen/matplotlib.axes.axes.quiver#matplotlib.axes.Axes.quiver "matplotlib.axes.Axes.quiver") | Plot a 2D field of arrows. |
| [`Axes.quiverkey`](_as_gen/matplotlib.axes.axes.quiverkey#matplotlib.axes.Axes.quiverkey "matplotlib.axes.Axes.quiverkey") | Add a key to a quiver plot. |
| [`Axes.streamplot`](_as_gen/matplotlib.axes.axes.streamplot#matplotlib.axes.Axes.streamplot "matplotlib.axes.Axes.streamplot") | Draw streamlines of a vector flow. |
Clearing
--------
| | |
| --- | --- |
| [`Axes.cla`](_as_gen/matplotlib.axes.axes.cla#matplotlib.axes.Axes.cla "matplotlib.axes.Axes.cla") | Clear the Axes. |
| [`Axes.clear`](_as_gen/matplotlib.axes.axes.clear#matplotlib.axes.Axes.clear "matplotlib.axes.Axes.clear") | Clear the Axes. |
Appearance
----------
| | |
| --- | --- |
| [`Axes.axis`](_as_gen/matplotlib.axes.axes.axis#matplotlib.axes.Axes.axis "matplotlib.axes.Axes.axis") | Convenience method to get or set some axis properties. |
| [`Axes.set_axis_off`](_as_gen/matplotlib.axes.axes.set_axis_off#matplotlib.axes.Axes.set_axis_off "matplotlib.axes.Axes.set_axis_off") | Turn the x- and y-axis off. |
| [`Axes.set_axis_on`](_as_gen/matplotlib.axes.axes.set_axis_on#matplotlib.axes.Axes.set_axis_on "matplotlib.axes.Axes.set_axis_on") | Turn the x- and y-axis on. |
| [`Axes.set_frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | Set whether the Axes rectangle patch is drawn. |
| [`Axes.get_frame_on`](_as_gen/matplotlib.axes.axes.get_frame_on#matplotlib.axes.Axes.get_frame_on "matplotlib.axes.Axes.get_frame_on") | Get whether the Axes rectangle patch is drawn. |
| [`Axes.set_axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | Set whether axis ticks and gridlines are above or below most artists. |
| [`Axes.get_axisbelow`](_as_gen/matplotlib.axes.axes.get_axisbelow#matplotlib.axes.Axes.get_axisbelow "matplotlib.axes.Axes.get_axisbelow") | Get whether axis ticks and gridlines are above or below most artists. |
| [`Axes.grid`](_as_gen/matplotlib.axes.axes.grid#matplotlib.axes.Axes.grid "matplotlib.axes.Axes.grid") | Configure the grid lines. |
| [`Axes.get_facecolor`](_as_gen/matplotlib.axes.axes.get_facecolor#matplotlib.axes.Axes.get_facecolor "matplotlib.axes.Axes.get_facecolor") | Get the facecolor of the Axes. |
| [`Axes.set_facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") | Set the facecolor of the Axes. |
Property cycle
--------------
| | |
| --- | --- |
| [`Axes.set_prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | Set the property cycle of the Axes. |
Axis / limits
-------------
| | |
| --- | --- |
| [`Axes.get_xaxis`](_as_gen/matplotlib.axes.axes.get_xaxis#matplotlib.axes.Axes.get_xaxis "matplotlib.axes.Axes.get_xaxis") | [*Discouraged*] Return the XAxis instance. |
| [`Axes.get_yaxis`](_as_gen/matplotlib.axes.axes.get_yaxis#matplotlib.axes.Axes.get_yaxis "matplotlib.axes.Axes.get_yaxis") | [*Discouraged*] Return the YAxis instance. |
### Axis limits and direction
| | |
| --- | --- |
| [`Axes.invert_xaxis`](_as_gen/matplotlib.axes.axes.invert_xaxis#matplotlib.axes.Axes.invert_xaxis "matplotlib.axes.Axes.invert_xaxis") | Invert the x-axis. |
| [`Axes.xaxis_inverted`](_as_gen/matplotlib.axes.axes.xaxis_inverted#matplotlib.axes.Axes.xaxis_inverted "matplotlib.axes.Axes.xaxis_inverted") | Return whether the xaxis is oriented in the "inverse" direction. |
| [`Axes.invert_yaxis`](_as_gen/matplotlib.axes.axes.invert_yaxis#matplotlib.axes.Axes.invert_yaxis "matplotlib.axes.Axes.invert_yaxis") | Invert the y-axis. |
| [`Axes.yaxis_inverted`](_as_gen/matplotlib.axes.axes.yaxis_inverted#matplotlib.axes.Axes.yaxis_inverted "matplotlib.axes.Axes.yaxis_inverted") | Return whether the yaxis is oriented in the "inverse" direction. |
| [`Axes.set_xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | Set the x-axis view limits. |
| [`Axes.get_xlim`](_as_gen/matplotlib.axes.axes.get_xlim#matplotlib.axes.Axes.get_xlim "matplotlib.axes.Axes.get_xlim") | Return the x-axis view limits. |
| [`Axes.set_ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | Set the y-axis view limits. |
| [`Axes.get_ylim`](_as_gen/matplotlib.axes.axes.get_ylim#matplotlib.axes.Axes.get_ylim "matplotlib.axes.Axes.get_ylim") | Return the y-axis view limits. |
| [`Axes.update_datalim`](_as_gen/matplotlib.axes.axes.update_datalim#matplotlib.axes.Axes.update_datalim "matplotlib.axes.Axes.update_datalim") | Extend the `dataLim` Bbox to include the given points. |
| [`Axes.set_xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | Set the lower and upper numerical bounds of the x-axis. |
| [`Axes.get_xbound`](_as_gen/matplotlib.axes.axes.get_xbound#matplotlib.axes.Axes.get_xbound "matplotlib.axes.Axes.get_xbound") | Return the lower and upper x-axis bounds, in increasing order. |
| [`Axes.set_ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | Set the lower and upper numerical bounds of the y-axis. |
| [`Axes.get_ybound`](_as_gen/matplotlib.axes.axes.get_ybound#matplotlib.axes.Axes.get_ybound "matplotlib.axes.Axes.get_ybound") | Return the lower and upper y-axis bounds, in increasing order. |
### Axis labels, title, and legend
| | |
| --- | --- |
| [`Axes.set_xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | Set the label for the x-axis. |
| [`Axes.get_xlabel`](_as_gen/matplotlib.axes.axes.get_xlabel#matplotlib.axes.Axes.get_xlabel "matplotlib.axes.Axes.get_xlabel") | Get the xlabel text string. |
| [`Axes.set_ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | Set the label for the y-axis. |
| [`Axes.get_ylabel`](_as_gen/matplotlib.axes.axes.get_ylabel#matplotlib.axes.Axes.get_ylabel "matplotlib.axes.Axes.get_ylabel") | Get the ylabel text string. |
| [`Axes.set_title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | Set a title for the Axes. |
| [`Axes.get_title`](_as_gen/matplotlib.axes.axes.get_title#matplotlib.axes.Axes.get_title "matplotlib.axes.Axes.get_title") | Get an Axes title. |
| [`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") | Place a legend on the Axes. |
| [`Axes.get_legend`](_as_gen/matplotlib.axes.axes.get_legend#matplotlib.axes.Axes.get_legend "matplotlib.axes.Axes.get_legend") | Return the [`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") instance, or None if no legend is defined. |
| [`Axes.get_legend_handles_labels`](_as_gen/matplotlib.axes.axes.get_legend_handles_labels#matplotlib.axes.Axes.get_legend_handles_labels "matplotlib.axes.Axes.get_legend_handles_labels") | Return handles and labels for legend |
### Axis scales
| | |
| --- | --- |
| [`Axes.set_xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | Set the xaxis' scale. |
| [`Axes.get_xscale`](_as_gen/matplotlib.axes.axes.get_xscale#matplotlib.axes.Axes.get_xscale "matplotlib.axes.Axes.get_xscale") | Return the xaxis' scale (as a str). |
| [`Axes.set_yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | Set the yaxis' scale. |
| [`Axes.get_yscale`](_as_gen/matplotlib.axes.axes.get_yscale#matplotlib.axes.Axes.get_yscale "matplotlib.axes.Axes.get_yscale") | Return the yaxis' scale (as a str). |
### Autoscaling and margins
| | |
| --- | --- |
| [`Axes.use_sticky_edges`](_as_gen/matplotlib.axes.axes.use_sticky_edges#matplotlib.axes.Axes.use_sticky_edges "matplotlib.axes.Axes.use_sticky_edges") | When autoscaling, whether to obey all `Artist.sticky_edges`. |
| [`Axes.margins`](_as_gen/matplotlib.axes.axes.margins#matplotlib.axes.Axes.margins "matplotlib.axes.Axes.margins") | Set or retrieve autoscaling margins. |
| [`Axes.set_xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | Set padding of X data limits prior to autoscaling. |
| [`Axes.set_ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | Set padding of Y data limits prior to autoscaling. |
| [`Axes.relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") | Recompute the data limits based on current artists. |
| [`Axes.autoscale`](_as_gen/matplotlib.axes.axes.autoscale#matplotlib.axes.Axes.autoscale "matplotlib.axes.Axes.autoscale") | Autoscale the axis view to the data (toggle). |
| [`Axes.autoscale_view`](_as_gen/matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") | Autoscale the view limits using the data limits. |
| [`Axes.set_autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | Set whether autoscaling is applied to each axis on the next draw or call to [`Axes.autoscale_view`](_as_gen/matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view"). |
| [`Axes.get_autoscale_on`](_as_gen/matplotlib.axes.axes.get_autoscale_on#matplotlib.axes.Axes.get_autoscale_on "matplotlib.axes.Axes.get_autoscale_on") | Return True if each axis is autoscaled, False otherwise. |
| [`Axes.set_autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | Set whether the xaxis is autoscaled when drawing or by [`Axes.autoscale_view`](_as_gen/matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view"). |
| [`Axes.get_autoscalex_on`](_as_gen/matplotlib.axes.axes.get_autoscalex_on#matplotlib.axes.Axes.get_autoscalex_on "matplotlib.axes.Axes.get_autoscalex_on") | Return whether the xaxis is autoscaled. |
| [`Axes.set_autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | Set whether the yaxis is autoscaled when drawing or by [`Axes.autoscale_view`](_as_gen/matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view"). |
| [`Axes.get_autoscaley_on`](_as_gen/matplotlib.axes.axes.get_autoscaley_on#matplotlib.axes.Axes.get_autoscaley_on "matplotlib.axes.Axes.get_autoscaley_on") | Return whether the yaxis is autoscaled. |
### Aspect ratio
| | |
| --- | --- |
| [`Axes.apply_aspect`](_as_gen/matplotlib.axes.axes.apply_aspect#matplotlib.axes.Axes.apply_aspect "matplotlib.axes.Axes.apply_aspect") | Adjust the Axes for a specified data aspect ratio. |
| [`Axes.set_aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | Set the aspect ratio of the axes scaling, i.e. y/x-scale. |
| [`Axes.get_aspect`](_as_gen/matplotlib.axes.axes.get_aspect#matplotlib.axes.Axes.get_aspect "matplotlib.axes.Axes.get_aspect") | Return the aspect ratio of the axes scaling. |
| [`Axes.set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | Set the Axes box aspect, i.e. the ratio of height to width. |
| [`Axes.get_box_aspect`](_as_gen/matplotlib.axes.axes.get_box_aspect#matplotlib.axes.Axes.get_box_aspect "matplotlib.axes.Axes.get_box_aspect") | Return the Axes box aspect, i.e. the ratio of height to width. |
| [`Axes.set_adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | Set how the Axes adjusts to achieve the required aspect ratio. |
| [`Axes.get_adjustable`](_as_gen/matplotlib.axes.axes.get_adjustable#matplotlib.axes.Axes.get_adjustable "matplotlib.axes.Axes.get_adjustable") | Return whether the Axes will adjust its physical dimension ('box') or its data limits ('datalim') to achieve the desired aspect ratio. |
### Ticks and tick labels
| | |
| --- | --- |
| [`Axes.set_xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | Set the xaxis' tick locations and optionally labels. |
| [`Axes.get_xticks`](_as_gen/matplotlib.axes.axes.get_xticks#matplotlib.axes.Axes.get_xticks "matplotlib.axes.Axes.get_xticks") | Return the xaxis' tick locations in data coordinates. |
| [`Axes.set_xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | Set the xaxis' labels with list of string labels. |
| [`Axes.get_xticklabels`](_as_gen/matplotlib.axes.axes.get_xticklabels#matplotlib.axes.Axes.get_xticklabels "matplotlib.axes.Axes.get_xticklabels") | Get the xaxis' tick labels. |
| [`Axes.get_xmajorticklabels`](_as_gen/matplotlib.axes.axes.get_xmajorticklabels#matplotlib.axes.Axes.get_xmajorticklabels "matplotlib.axes.Axes.get_xmajorticklabels") | Return the xaxis' major tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axes.get_xminorticklabels`](_as_gen/matplotlib.axes.axes.get_xminorticklabels#matplotlib.axes.Axes.get_xminorticklabels "matplotlib.axes.Axes.get_xminorticklabels") | Return the xaxis' minor tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axes.get_xgridlines`](_as_gen/matplotlib.axes.axes.get_xgridlines#matplotlib.axes.Axes.get_xgridlines "matplotlib.axes.Axes.get_xgridlines") | Return the xaxis' grid lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axes.get_xticklines`](_as_gen/matplotlib.axes.axes.get_xticklines#matplotlib.axes.Axes.get_xticklines "matplotlib.axes.Axes.get_xticklines") | Return the xaxis' tick lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axes.xaxis_date`](_as_gen/matplotlib.axes.axes.xaxis_date#matplotlib.axes.Axes.xaxis_date "matplotlib.axes.Axes.xaxis_date") | Set up axis ticks and labels to treat data along the xaxis as dates. |
| [`Axes.set_yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | Set the yaxis' tick locations and optionally labels. |
| [`Axes.get_yticks`](_as_gen/matplotlib.axes.axes.get_yticks#matplotlib.axes.Axes.get_yticks "matplotlib.axes.Axes.get_yticks") | Return the yaxis' tick locations in data coordinates. |
| [`Axes.set_yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | Set the yaxis' labels with list of string labels. |
| [`Axes.get_yticklabels`](_as_gen/matplotlib.axes.axes.get_yticklabels#matplotlib.axes.Axes.get_yticklabels "matplotlib.axes.Axes.get_yticklabels") | Get the yaxis' tick labels. |
| [`Axes.get_ymajorticklabels`](_as_gen/matplotlib.axes.axes.get_ymajorticklabels#matplotlib.axes.Axes.get_ymajorticklabels "matplotlib.axes.Axes.get_ymajorticklabels") | Return the yaxis' major tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axes.get_yminorticklabels`](_as_gen/matplotlib.axes.axes.get_yminorticklabels#matplotlib.axes.Axes.get_yminorticklabels "matplotlib.axes.Axes.get_yminorticklabels") | Return the yaxis' minor tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axes.get_ygridlines`](_as_gen/matplotlib.axes.axes.get_ygridlines#matplotlib.axes.Axes.get_ygridlines "matplotlib.axes.Axes.get_ygridlines") | Return the yaxis' grid lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axes.get_yticklines`](_as_gen/matplotlib.axes.axes.get_yticklines#matplotlib.axes.Axes.get_yticklines "matplotlib.axes.Axes.get_yticklines") | Return the yaxis' tick lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axes.yaxis_date`](_as_gen/matplotlib.axes.axes.yaxis_date#matplotlib.axes.Axes.yaxis_date "matplotlib.axes.Axes.yaxis_date") | Set up axis ticks and labels to treat data along the yaxis as dates. |
| [`Axes.minorticks_off`](_as_gen/matplotlib.axes.axes.minorticks_off#matplotlib.axes.Axes.minorticks_off "matplotlib.axes.Axes.minorticks_off") | Remove minor ticks from the Axes. |
| [`Axes.minorticks_on`](_as_gen/matplotlib.axes.axes.minorticks_on#matplotlib.axes.Axes.minorticks_on "matplotlib.axes.Axes.minorticks_on") | Display minor ticks on the Axes. |
| [`Axes.ticklabel_format`](_as_gen/matplotlib.axes.axes.ticklabel_format#matplotlib.axes.Axes.ticklabel_format "matplotlib.axes.Axes.ticklabel_format") | Configure the [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") used by default for linear Axes. |
| [`Axes.tick_params`](_as_gen/matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params") | Change the appearance of ticks, tick labels, and gridlines. |
| [`Axes.locator_params`](_as_gen/matplotlib.axes.axes.locator_params#matplotlib.axes.Axes.locator_params "matplotlib.axes.Axes.locator_params") | Control behavior of major tick locators. |
Units
-----
| | |
| --- | --- |
| [`Axes.convert_xunits`](_as_gen/matplotlib.axes.axes.convert_xunits#matplotlib.axes.Axes.convert_xunits "matplotlib.axes.Axes.convert_xunits") | Convert *x* using the unit type of the xaxis. |
| [`Axes.convert_yunits`](_as_gen/matplotlib.axes.axes.convert_yunits#matplotlib.axes.Axes.convert_yunits "matplotlib.axes.Axes.convert_yunits") | Convert *y* using the unit type of the yaxis. |
| [`Axes.have_units`](_as_gen/matplotlib.axes.axes.have_units#matplotlib.axes.Axes.have_units "matplotlib.axes.Axes.have_units") | Return whether units are set on any axis. |
Adding artists
--------------
| | |
| --- | --- |
| [`Axes.add_artist`](_as_gen/matplotlib.axes.axes.add_artist#matplotlib.axes.Axes.add_artist "matplotlib.axes.Axes.add_artist") | Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the Axes; return the artist. |
| [`Axes.add_child_axes`](_as_gen/matplotlib.axes.axes.add_child_axes#matplotlib.axes.Axes.add_child_axes "matplotlib.axes.Axes.add_child_axes") | Add an `AxesBase` to the Axes' children; return the child Axes. |
| [`Axes.add_collection`](_as_gen/matplotlib.axes.axes.add_collection#matplotlib.axes.Axes.add_collection "matplotlib.axes.Axes.add_collection") | Add a [`Collection`](collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection") to the Axes; return the collection. |
| [`Axes.add_container`](_as_gen/matplotlib.axes.axes.add_container#matplotlib.axes.Axes.add_container "matplotlib.axes.Axes.add_container") | Add a [`Container`](container_api#matplotlib.container.Container "matplotlib.container.Container") to the Axes' containers; return the container. |
| [`Axes.add_image`](_as_gen/matplotlib.axes.axes.add_image#matplotlib.axes.Axes.add_image "matplotlib.axes.Axes.add_image") | Add an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") to the Axes; return the image. |
| [`Axes.add_line`](_as_gen/matplotlib.axes.axes.add_line#matplotlib.axes.Axes.add_line "matplotlib.axes.Axes.add_line") | Add a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") to the Axes; return the line. |
| [`Axes.add_patch`](_as_gen/matplotlib.axes.axes.add_patch#matplotlib.axes.Axes.add_patch "matplotlib.axes.Axes.add_patch") | Add a [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") to the Axes; return the patch. |
| [`Axes.add_table`](_as_gen/matplotlib.axes.axes.add_table#matplotlib.axes.Axes.add_table "matplotlib.axes.Axes.add_table") | Add a [`Table`](table_api#matplotlib.table.Table "matplotlib.table.Table") to the Axes; return the table. |
Twinning and sharing
--------------------
| | |
| --- | --- |
| [`Axes.twinx`](_as_gen/matplotlib.axes.axes.twinx#matplotlib.axes.Axes.twinx "matplotlib.axes.Axes.twinx") | Create a twin Axes sharing the xaxis. |
| [`Axes.twiny`](_as_gen/matplotlib.axes.axes.twiny#matplotlib.axes.Axes.twiny "matplotlib.axes.Axes.twiny") | Create a twin Axes sharing the yaxis. |
| [`Axes.sharex`](_as_gen/matplotlib.axes.axes.sharex#matplotlib.axes.Axes.sharex "matplotlib.axes.Axes.sharex") | Share the x-axis with *other*. |
| [`Axes.sharey`](_as_gen/matplotlib.axes.axes.sharey#matplotlib.axes.Axes.sharey "matplotlib.axes.Axes.sharey") | Share the y-axis with *other*. |
| [`Axes.get_shared_x_axes`](_as_gen/matplotlib.axes.axes.get_shared_x_axes#matplotlib.axes.Axes.get_shared_x_axes "matplotlib.axes.Axes.get_shared_x_axes") | Return an immutable view on the shared x-axes Grouper. |
| [`Axes.get_shared_y_axes`](_as_gen/matplotlib.axes.axes.get_shared_y_axes#matplotlib.axes.Axes.get_shared_y_axes "matplotlib.axes.Axes.get_shared_y_axes") | Return an immutable view on the shared y-axes Grouper. |
Axes position
-------------
| | |
| --- | --- |
| [`Axes.get_anchor`](_as_gen/matplotlib.axes.axes.get_anchor#matplotlib.axes.Axes.get_anchor "matplotlib.axes.Axes.get_anchor") | Get the anchor location. |
| [`Axes.set_anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | Define the anchor location. |
| [`Axes.get_axes_locator`](_as_gen/matplotlib.axes.axes.get_axes_locator#matplotlib.axes.Axes.get_axes_locator "matplotlib.axes.Axes.get_axes_locator") | Return the axes\_locator. |
| [`Axes.set_axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Set the Axes locator. |
| [`Axes.reset_position`](_as_gen/matplotlib.axes.axes.reset_position#matplotlib.axes.Axes.reset_position "matplotlib.axes.Axes.reset_position") | Reset the active position to the original position. |
| [`Axes.get_position`](_as_gen/matplotlib.axes.axes.get_position#matplotlib.axes.Axes.get_position "matplotlib.axes.Axes.get_position") | Return the position of the Axes within the figure as a [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"). |
| [`Axes.set_position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | Set the Axes position. |
Async/event based
-----------------
| | |
| --- | --- |
| [`Axes.stale`](_as_gen/matplotlib.axes.axes.stale#matplotlib.axes.Axes.stale "matplotlib.axes.Axes.stale") | Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist. |
| [`Axes.pchanged`](_as_gen/matplotlib.axes.axes.pchanged#matplotlib.axes.Axes.pchanged "matplotlib.axes.Axes.pchanged") | Call all of the registered callbacks. |
| [`Axes.add_callback`](_as_gen/matplotlib.axes.axes.add_callback#matplotlib.axes.Axes.add_callback "matplotlib.axes.Axes.add_callback") | Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes. |
| [`Axes.remove_callback`](_as_gen/matplotlib.axes.axes.remove_callback#matplotlib.axes.Axes.remove_callback "matplotlib.axes.Axes.remove_callback") | Remove a callback based on its observer id. |
Interactive
-----------
| | |
| --- | --- |
| [`Axes.can_pan`](_as_gen/matplotlib.axes.axes.can_pan#matplotlib.axes.Axes.can_pan "matplotlib.axes.Axes.can_pan") | Return whether this Axes supports any pan/zoom button functionality. |
| [`Axes.can_zoom`](_as_gen/matplotlib.axes.axes.can_zoom#matplotlib.axes.Axes.can_zoom "matplotlib.axes.Axes.can_zoom") | Return whether this Axes supports the zoom box button functionality. |
| [`Axes.get_navigate`](_as_gen/matplotlib.axes.axes.get_navigate#matplotlib.axes.Axes.get_navigate "matplotlib.axes.Axes.get_navigate") | Get whether the Axes responds to navigation commands. |
| [`Axes.set_navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | Set whether the Axes responds to navigation toolbar commands. |
| [`Axes.get_navigate_mode`](_as_gen/matplotlib.axes.axes.get_navigate_mode#matplotlib.axes.Axes.get_navigate_mode "matplotlib.axes.Axes.get_navigate_mode") | Get the navigation toolbar button status: 'PAN', 'ZOOM', or None. |
| [`Axes.set_navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | Set the navigation toolbar button status. |
| [`Axes.start_pan`](_as_gen/matplotlib.axes.axes.start_pan#matplotlib.axes.Axes.start_pan "matplotlib.axes.Axes.start_pan") | Called when a pan operation has started. |
| [`Axes.drag_pan`](_as_gen/matplotlib.axes.axes.drag_pan#matplotlib.axes.Axes.drag_pan "matplotlib.axes.Axes.drag_pan") | Called when the mouse moves during a pan operation. |
| [`Axes.end_pan`](_as_gen/matplotlib.axes.axes.end_pan#matplotlib.axes.Axes.end_pan "matplotlib.axes.Axes.end_pan") | Called when a pan operation completes (when the mouse button is up.) |
| [`Axes.format_coord`](_as_gen/matplotlib.axes.axes.format_coord#matplotlib.axes.Axes.format_coord "matplotlib.axes.Axes.format_coord") | Return a format string formatting the *x*, *y* coordinates. |
| [`Axes.format_cursor_data`](_as_gen/matplotlib.axes.axes.format_cursor_data#matplotlib.axes.Axes.format_cursor_data "matplotlib.axes.Axes.format_cursor_data") | Return a string representation of *data*. |
| [`Axes.format_xdata`](_as_gen/matplotlib.axes.axes.format_xdata#matplotlib.axes.Axes.format_xdata "matplotlib.axes.Axes.format_xdata") | Return *x* formatted as an x-value. |
| [`Axes.format_ydata`](_as_gen/matplotlib.axes.axes.format_ydata#matplotlib.axes.Axes.format_ydata "matplotlib.axes.Axes.format_ydata") | Return *y* formatted as an y-value. |
| [`Axes.mouseover`](_as_gen/matplotlib.axes.axes.mouseover#matplotlib.axes.Axes.mouseover "matplotlib.axes.Axes.mouseover") | Return whether this artist is queried for custom context information when the mouse cursor moves over it. |
| [`Axes.in_axes`](_as_gen/matplotlib.axes.axes.in_axes#matplotlib.axes.Axes.in_axes "matplotlib.axes.Axes.in_axes") | Return whether the given event (in display coords) is in the Axes. |
| [`Axes.contains`](_as_gen/matplotlib.axes.axes.contains#matplotlib.axes.Axes.contains "matplotlib.axes.Axes.contains") | Test whether the artist contains the mouse event. |
| [`Axes.contains_point`](_as_gen/matplotlib.axes.axes.contains_point#matplotlib.axes.Axes.contains_point "matplotlib.axes.Axes.contains_point") | Return whether *point* (pair of pixel coordinates) is inside the Axes patch. |
| [`Axes.get_cursor_data`](_as_gen/matplotlib.axes.axes.get_cursor_data#matplotlib.axes.Axes.get_cursor_data "matplotlib.axes.Axes.get_cursor_data") | Return the cursor data for a given event. |
Children
--------
| | |
| --- | --- |
| [`Axes.get_children`](_as_gen/matplotlib.axes.axes.get_children#matplotlib.axes.Axes.get_children "matplotlib.axes.Axes.get_children") | Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). |
| [`Axes.get_images`](_as_gen/matplotlib.axes.axes.get_images#matplotlib.axes.Axes.get_images "matplotlib.axes.Axes.get_images") | Return a list of [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")s contained by the Axes. |
| [`Axes.get_lines`](_as_gen/matplotlib.axes.axes.get_lines#matplotlib.axes.Axes.get_lines "matplotlib.axes.Axes.get_lines") | Return a list of lines contained by the Axes. |
| [`Axes.findobj`](_as_gen/matplotlib.axes.axes.findobj#matplotlib.axes.Axes.findobj "matplotlib.axes.Axes.findobj") | Find artist objects. |
Drawing
-------
| | |
| --- | --- |
| [`Axes.draw`](_as_gen/matplotlib.axes.axes.draw#matplotlib.axes.Axes.draw "matplotlib.axes.Axes.draw") | Draw the Artist (and its children) using the given renderer. |
| [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") | Efficiently redraw a single artist. |
| [`Axes.redraw_in_frame`](_as_gen/matplotlib.axes.axes.redraw_in_frame#matplotlib.axes.Axes.redraw_in_frame "matplotlib.axes.Axes.redraw_in_frame") | Efficiently redraw Axes data, but not axis ticks, labels, etc. |
| [`Axes.get_renderer_cache`](_as_gen/matplotlib.axes.axes.get_renderer_cache#matplotlib.axes.Axes.get_renderer_cache "matplotlib.axes.Axes.get_renderer_cache") | [*Deprecated*] |
| [`Axes.get_rasterization_zorder`](_as_gen/matplotlib.axes.axes.get_rasterization_zorder#matplotlib.axes.Axes.get_rasterization_zorder "matplotlib.axes.Axes.get_rasterization_zorder") | Return the zorder value below which artists will be rasterized. |
| [`Axes.set_rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | Set the zorder threshold for rasterization for vector graphics output. |
| [`Axes.get_window_extent`](_as_gen/matplotlib.axes.axes.get_window_extent#matplotlib.axes.Axes.get_window_extent "matplotlib.axes.Axes.get_window_extent") | Return the Axes bounding box in display space; *args* and *kwargs* are empty. |
| [`Axes.get_tightbbox`](_as_gen/matplotlib.axes.axes.get_tightbbox#matplotlib.axes.Axes.get_tightbbox "matplotlib.axes.Axes.get_tightbbox") | Return the tight bounding box of the Axes, including axis and their decorators (xlabel, title, etc). |
Projection
----------
Methods used by [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") that must be overridden for non-rectilinear Axes.
| | |
| --- | --- |
| [`Axes.name`](_as_gen/matplotlib.axes.axes.name#matplotlib.axes.Axes.name "matplotlib.axes.Axes.name") | |
| [`Axes.get_xaxis_transform`](_as_gen/matplotlib.axes.axes.get_xaxis_transform#matplotlib.axes.Axes.get_xaxis_transform "matplotlib.axes.Axes.get_xaxis_transform") | Get the transformation used for drawing x-axis labels, ticks and gridlines. |
| [`Axes.get_yaxis_transform`](_as_gen/matplotlib.axes.axes.get_yaxis_transform#matplotlib.axes.Axes.get_yaxis_transform "matplotlib.axes.Axes.get_yaxis_transform") | Get the transformation used for drawing y-axis labels, ticks and gridlines. |
| [`Axes.get_data_ratio`](_as_gen/matplotlib.axes.axes.get_data_ratio#matplotlib.axes.Axes.get_data_ratio "matplotlib.axes.Axes.get_data_ratio") | Return the aspect ratio of the scaled data. |
| [`Axes.get_xaxis_text1_transform`](_as_gen/matplotlib.axes.axes.get_xaxis_text1_transform#matplotlib.axes.Axes.get_xaxis_text1_transform "matplotlib.axes.Axes.get_xaxis_text1_transform") | Returns:
|
| [`Axes.get_xaxis_text2_transform`](_as_gen/matplotlib.axes.axes.get_xaxis_text2_transform#matplotlib.axes.Axes.get_xaxis_text2_transform "matplotlib.axes.Axes.get_xaxis_text2_transform") | Returns:
|
| [`Axes.get_yaxis_text1_transform`](_as_gen/matplotlib.axes.axes.get_yaxis_text1_transform#matplotlib.axes.Axes.get_yaxis_text1_transform "matplotlib.axes.Axes.get_yaxis_text1_transform") | Returns:
|
| [`Axes.get_yaxis_text2_transform`](_as_gen/matplotlib.axes.axes.get_yaxis_text2_transform#matplotlib.axes.Axes.get_yaxis_text2_transform "matplotlib.axes.Axes.get_yaxis_text2_transform") | Returns:
|
Other
-----
| | |
| --- | --- |
| [`Axes.zorder`](_as_gen/matplotlib.axes.axes.zorder#matplotlib.axes.Axes.zorder "matplotlib.axes.Axes.zorder") | |
| [`Axes.get_default_bbox_extra_artists`](_as_gen/matplotlib.axes.axes.get_default_bbox_extra_artists#matplotlib.axes.Axes.get_default_bbox_extra_artists "matplotlib.axes.Axes.get_default_bbox_extra_artists") | Return a default list of artists that are used for the bounding box calculation. |
| [`Axes.get_transformed_clip_path_and_affine`](_as_gen/matplotlib.axes.axes.get_transformed_clip_path_and_affine#matplotlib.axes.Axes.get_transformed_clip_path_and_affine "matplotlib.axes.Axes.get_transformed_clip_path_and_affine") | Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. |
| [`Axes.has_data`](_as_gen/matplotlib.axes.axes.has_data#matplotlib.axes.Axes.has_data "matplotlib.axes.Axes.has_data") | Return whether any artists have been added to the Axes. |
| [`Axes.set`](_as_gen/matplotlib.axes.axes.set#matplotlib.axes.Axes.set "matplotlib.axes.Axes.set") | Set multiple properties at once. |
*class*matplotlib.axes.Axes.ArtistList(*axes*, *prop\_name*, *add\_name*, *valid\_types=None*, *invalid\_types=None*)
A sublist of Axes children based on their type.
The type-specific children sublists will become immutable in Matplotlib 3.7. Then, these artist lists will likely be replaced by tuples. Use as if this is a tuple already.
This class exists only for the transition period to warn on the deprecated modification of artist lists.
Parameters:
**axes**.axes.Axes
The Axes from which this sublist will pull the children Artists.
**prop\_name**str
The property name used to access this sublist from the Axes; used to generate deprecation warnings.
**add\_name**str
The method name used to add Artists of this sublist's type to the Axes; used to generate deprecation warnings.
**valid\_types**list of type, optional
A list of types that determine which children will be returned by this sublist. If specified, then the Artists in the sublist must be instances of any of these types. If unspecified, then any type of Artist is valid (unless limited by *invalid\_types*.)
**invalid\_types**tuple, optional
A list of types that determine which children will *not* be returned by this sublist. If specified, then Artists in the sublist will never be an instance of these types. Otherwise, no types will be excluded.
insert(*index*, *item*)
S.insert(index, value) -- insert value before index
| programming_docs |
matplotlib matplotlib.docstring matplotlib.docstring
====================
Attention
This module is considered internal.
Its use is deprecated and it will be removed in a future version.
*class*matplotlib.\_docstring.Substitution(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_docstring.py#L6-L47)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A decorator that performs %-substitution on an object's docstring.
This decorator should be robust even if `obj.__doc__` is None (for example, if -OO was passed to the interpreter).
Usage: construct a docstring.Substitution with a sequence or dictionary suitable for performing substitution; then decorate a suitable function with the constructed object, e.g.:
```
sub_author_name = Substitution(author='Jason')
@sub_author_name
def some_function(x):
"%(author)s wrote this function"
# note that some_function.__doc__ is now "Jason wrote this function"
```
One can also use positional arguments:
```
sub_first_last_names = Substitution('Edgar Allen', 'Poe')
@sub_first_last_names
def some_function(x):
"%s %s wrote the Raven"
```
update(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_docstring.py#L43-L47)
Update `self.params` (which must be a dict) with the supplied args.
matplotlib.\_docstring.copy(*source*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_docstring.py#L86-L92)
Copy a docstring from another source function (if present).
matplotlib matplotlib.mathtext matplotlib.mathtext
===================
A module for parsing a subset of the TeX math syntax and rendering it to a Matplotlib backend.
For a tutorial of its usage, see [Writing mathematical expressions](https://matplotlib.org/stable/tutorials/text/mathtext.html). This document is primarily concerned with implementation details.
The module uses [pyparsing](https://pypi.org/project/pyparsing/) to parse the TeX expression.
The Bakoma distribution of the TeX Computer Modern fonts, and STIX fonts are supported. There is experimental support for using arbitrary fonts, but results may vary without proper tweaking and metrics for those fonts.
*class*matplotlib.mathtext.MathTextParser(*output*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L185-L252)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Create a MathTextParser for the given backend *output*.
Parameters:
**output**{"path", "agg"}
Whether to return a [`VectorParse`](#matplotlib.mathtext.VectorParse "matplotlib.mathtext.VectorParse") ("path") or a [`RasterParse`](#matplotlib.mathtext.RasterParse "matplotlib.mathtext.RasterParse") ("agg", or its synonym "macosx").
parse(*s*, *dpi=72*, *prop=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L210-L226)
Parse the given math expression *s* at the given *dpi*. If *prop* is provided, it is a [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") object specifying the "default" font to use in the math expression, used for all non-math text.
The results are cached, so multiple calls to [`parse`](#matplotlib.mathtext.MathTextParser.parse "matplotlib.mathtext.MathTextParser.parse") with the same expression should be fast.
Depending on the *output* type, this returns either a [`VectorParse`](#matplotlib.mathtext.VectorParse "matplotlib.mathtext.VectorParse") or a [`RasterParse`](#matplotlib.mathtext.RasterParse "matplotlib.mathtext.RasterParse").
*exception*matplotlib.mathtext.MathTextWarning(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L176-L178)
Bases: [`Warning`](https://docs.python.org/3/library/exceptions.html#Warning "(in Python v3.10)")
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
*class*matplotlib.mathtext.MathtextBackend[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L37-L90)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
[*Deprecated*] The base class for the mathtext backend-specific code. [`MathtextBackend`](#matplotlib.mathtext.MathtextBackend "matplotlib.mathtext.MathtextBackend") subclasses interface between mathtext and specific Matplotlib graphics backends.
Subclasses need to override the following:
* [`render_glyph()`](#matplotlib.mathtext.MathtextBackend.render_glyph "matplotlib.mathtext.MathtextBackend.render_glyph")
* [`render_rect_filled()`](#matplotlib.mathtext.MathtextBackend.render_rect_filled "matplotlib.mathtext.MathtextBackend.render_rect_filled")
* [`get_results()`](#matplotlib.mathtext.MathtextBackend.get_results "matplotlib.mathtext.MathtextBackend.get_results")
And optionally, if you need to use a FreeType hinting style:
* [`get_hinting_type()`](#matplotlib.mathtext.MathtextBackend.get_hinting_type "matplotlib.mathtext.MathtextBackend.get_hinting_type")
#### Notes
Deprecated since version 3.6.
get\_hinting\_type()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L85-L90)
Get the FreeType hinting type to use with this particular backend.
get\_results(*box*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L78-L83)
Return a backend-specific tuple to return to the backend after all processing is done.
render\_glyph(*ox*, *oy*, *info*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L65-L70)
Draw a glyph described by *info* to the reference point (*ox*, *oy*).
render\_rect\_filled(*x1*, *y1*, *x2*, *y2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L72-L76)
Draw a filled black rectangle from (*x1*, *y1*) to (*x2*, *y2*).
set\_canvas\_size(*w*, *h*, *d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L59-L63)
Set the dimension of the drawing canvas.
*class*matplotlib.mathtext.MathtextBackendAgg[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L93-L148)
Bases: [`MathtextBackend`](#matplotlib.mathtext.MathtextBackend "matplotlib.mathtext.MathtextBackend")
[*Deprecated*] Render glyphs and rectangles to an FTImage buffer, which is later transferred to the Agg image by the Agg backend.
#### Notes
Deprecated since version 3.6.
get\_hinting\_type()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L146-L148)
Get the FreeType hinting type to use with this particular backend.
get\_results(*box*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L141-L144)
Return a backend-specific tuple to return to the backend after all processing is done.
render\_glyph(*ox*, *oy*, *info*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L118-L127)
Draw a glyph described by *info* to the reference point (*ox*, *oy*).
render\_rect\_filled(*x1*, *y1*, *x2*, *y2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L129-L139)
Draw a filled black rectangle from (*x1*, *y1*) to (*x2*, *y2*).
set\_canvas\_size(*w*, *h*, *d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L113-L116)
Set the dimension of the drawing canvas.
*class*matplotlib.mathtext.MathtextBackendPath[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L151-L173)
Bases: [`MathtextBackend`](#matplotlib.mathtext.MathtextBackend "matplotlib.mathtext.MathtextBackend")
[*Deprecated*] Store information to write a mathtext rendering to the text path machinery.
#### Notes
Deprecated since version 3.6.
get\_results(*box*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L172-L173)
Return a backend-specific tuple to return to the backend after all processing is done.
render\_glyph(*ox*, *oy*, *info*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L165-L167)
Draw a glyph described by *info* to the reference point (*ox*, *oy*).
render\_rect\_filled(*x1*, *y1*, *x2*, *y2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L169-L170)
Draw a filled black rectangle from (*x1*, *y1*) to (*x2*, *y2*).
*class*matplotlib.mathtext.RasterParse(*ox*, *oy*, *width*, *height*, *depth*, *image*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
The namedtuple type returned by `MathTextParser("agg").parse(...)`.
This tuple contains the global metrics (*width*, *height*, *depth*), and a raster *image*. The offsets *ox*, *oy* are always zero.
Create new instance of RasterParse(ox, oy, width, height, depth, image)
depth
Alias for field number 4
height
Alias for field number 3
image
Alias for field number 5
ox
Alias for field number 0
oy
Alias for field number 1
width
Alias for field number 2
*class*matplotlib.mathtext.VectorParse(*width*, *height*, *depth*, *glyphs*, *rects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
The namedtuple type returned by `MathTextParser("path").parse(...)`.
This tuple contains the global metrics (*width*, *height*, *depth*), a list of *glyphs* (including their positions) and of *rect*angles.
Create new instance of VectorParse(width, height, depth, glyphs, rects)
depth
Alias for field number 2
glyphs
Alias for field number 3
height
Alias for field number 1
rects
Alias for field number 4
width
Alias for field number 0
matplotlib.mathtext.get\_unicode\_index(*symbol*, *math=<deprecated parameter>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_mathtext.py#L37-L67)
Return the integer index (from the Unicode table) of *symbol*.
Parameters:
**symbol**str
A single (Unicode) character, a TeX command (e.g. r'pi') or a Type1 symbol name (e.g. 'phi').
**math**bool, default: False
If True (deprecated), replace ASCII hyphen-minus by Unicode minus.
matplotlib.mathtext.math\_to\_image(*s*, *filename\_or\_obj*, *prop=None*, *dpi=None*, *format=None*, *\**, *color=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/mathtext.py#L255-L287)
Given a math expression, renders it in a closely-clipped bounding box to an image file.
Parameters:
**s**str
A math expression. The math portion must be enclosed in dollar signs.
**filename\_or\_obj**str or path-like or file-like
Where to write the image data.
**prop**[`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
The size and style of the text.
**dpi**float, optional
The output dpi. If not set, the dpi is determined as for [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
**format**str, optional
The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not set, the format is determined as for [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
**color**str, optional
Foreground color, defaults to `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
matplotlib matplotlib.colorbar matplotlib.colorbar
===================
Colorbars are a visualization of the mapping from scalar values to colors. In Matplotlib they are drawn into a dedicated [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
Note
Colorbars are typically created through [`Figure.colorbar`](figure_api#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") or its pyplot wrapper [`pyplot.colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar"), which internally use [`Colorbar`](#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar") together with [`make_axes_gridspec`](#matplotlib.colorbar.make_axes_gridspec "matplotlib.colorbar.make_axes_gridspec") (for [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")-positioned axes) or [`make_axes`](#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes") (for non-[`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")-positioned axes).
End-users most likely won't need to directly use this module's API.
*class*matplotlib.colorbar.Colorbar(*ax*, *mappable=None*, *\**, *cmap=None*, *norm=None*, *alpha=None*, *values=None*, *boundaries=None*, *orientation='vertical'*, *ticklocation='auto'*, *extend=None*, *spacing='uniform'*, *ticks=None*, *format=None*, *drawedges=False*, *filled=<deprecated parameter>*, *extendfrac=None*, *extendrect=False*, *label=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L199-L1329)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Draw a colorbar in an existing axes.
Typically, colorbars are created using [`Figure.colorbar`](figure_api#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") or [`pyplot.colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") and associated with [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable")s (such as an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") generated via [`imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow")).
In order to draw a colorbar not associated with other elements in the figure, e.g. when showing a colormap by itself, one can create an empty [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable"), or directly pass *cmap* and *norm* instead of *mappable* to [`Colorbar`](#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar").
Useful public methods are [`set_label()`](#matplotlib.colorbar.Colorbar.set_label "matplotlib.colorbar.Colorbar.set_label") and [`add_lines()`](#matplotlib.colorbar.Colorbar.add_lines "matplotlib.colorbar.Colorbar.add_lines").
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance in which the colorbar is drawn.
**mappable**[`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable")
The mappable whose colormap and norm will be used.
To show the under- and over- value colors, the mappable's norm should be specified as
```
norm = colors.Normalize(clip=False)
```
To show the colors versus index instead of on a 0-1 scale, use:
```
norm=colors.NoNorm()
```
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The colormap to use. This parameter is ignored, unless *mappable* is None.
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
The normalization to use. This parameter is ignored, unless *mappable* is None.
**alpha**float
The colorbar transparency between 0 (transparent) and 1 (opaque).
**orientation**{'vertical', 'horizontal'}
**ticklocation**{'auto', 'left', 'right', 'top', 'bottom'}
**drawedges**bool
**filled**bool
**extend**{'neither', 'both', 'min', 'max'}
Make pointed end(s) for out-of-range values (unless 'neither'). These are set for a given colormap using the colormap set\_under and set\_over methods.
**extendfrac**{*None*, 'auto', length, lengths}
If set to *None*, both the minimum and maximum triangular colorbar extensions will have a length of 5% of the interior colorbar length (this is the default setting).
If set to 'auto', makes the triangular colorbar extensions the same lengths as the interior boxes (when *spacing* is set to 'uniform') or the same lengths as the respective adjacent interior boxes (when *spacing* is set to 'proportional').
If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length.
**extendrect**bool
If *False* the minimum and maximum colorbar extensions will be triangular (the default). If *True* the extensions will be rectangular.
**spacing**{'uniform', 'proportional'}
For discrete colorbars ([`BoundaryNorm`](_as_gen/matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm") or contours), 'uniform' gives each color the same space; 'proportional' makes the space proportional to the data interval.
**ticks**None or list of ticks or Locator
If None, ticks are determined automatically from the input.
**format**None or str or Formatter
If None, [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used. Format strings, e.g., `"%4.2e"` or `"{x:.2e}"`, are supported. An alternative [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") may be given instead.
**drawedges**bool
Whether to draw lines at color boundaries.
**label**str
The label on the colorbar's long axis.
**boundaries, values**None or a sequence
If unset, the colormap will be displayed on a 0-1 scale. If sequences, *values* must have a length 1 less than *boundaries*. For each region delimited by adjacent entries in *boundaries*, the color mapped to the corresponding value in values will be used. Normally only useful for indexed colors (i.e. `norm=NoNorm()`) or other unusual circumstances.
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance in which the colorbar is drawn.
**lines**list
A list of [`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") (empty if no lines were drawn).
**dividers**[`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
A LineCollection (empty if *drawedges* is `False`).
add\_lines(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L714-L792)
Draw lines on the colorbar.
The lines are appended to the list `lines`.
Parameters:
**levels**array-like
The positions of the lines.
**colors**color or list of colors
Either a single color applying to all lines or one color value for each line.
**linewidths**float or array-like
Either a single linewidth applying to all lines or one linewidth for each line.
**erase**bool, default: True
Whether to remove any previously added lines.
#### Notes
Alternatively, this method can also be called with the signature `colorbar.add_lines(contour_set, erase=True)`, in which case *levels*, *colors*, and *linewidths* are taken from *contour\_set*.
drag\_pan(*button*, *key*, *x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L1322-L1329)
draw\_all()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L502-L508)
[*Deprecated*] Calculate any free parameters based on the current cmap and norm, and do all the drawing.
#### Notes
Deprecated since version 3.6: Use fig.draw\_without\_rendering() instead.
*property*filled[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*formatter
Major tick label [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") for the colorbar.
get\_ticks(*minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L879-L891)
Return the ticks as a list of locations.
Parameters:
**minor**boolean, default: False
if True return the minor ticks.
*property*locator
Major tick [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") for the colorbar.
*property*minorformatter
Minor tick [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") for the colorbar.
*property*minorlocator
Minor tick [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") for the colorbar.
minorticks\_off()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L937-L940)
Turn the minor ticks of the colorbar off.
minorticks\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L930-L935)
Turn on colorbar minor ticks.
n\_rasterize*=50*
*property*patch[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L1013-L1048)
Remove this colorbar from the figure.
If the colorbar was created with `use_gridspec=True` the previous gridspec is restored.
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L969-L976)
Set the transparency between 0 (transparent) and 1 (opaque).
If an array is provided, *alpha* will be set to None to use the transparency values associated with the colormap.
set\_label(*label*, *\**, *loc=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L942-L967)
Add a label to the long axis of the colorbar.
Parameters:
**label**str
The label text.
**loc**str, optional
The location of the label.
* For horizontal orientation one of {'left', 'center', 'right'}
* For vertical orientation one of {'bottom', 'center', 'top'}
Defaults to `[rcParams["xaxis.labellocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=xaxis.labellocation#matplotlibrc-sample)` (default: `'center'`) or `[rcParams["yaxis.labellocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=yaxis.labellocation#matplotlibrc-sample)` (default: `'center'`) depending on the orientation.
**\*\*kwargs**
Keyword arguments are passed to [`set_xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") / [`set_ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel"). Supported keywords are *labelpad* and [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
set\_ticklabels(*ticklabels*, *update\_ticks=<deprecated parameter>*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L893-L928)
[*Discouraged*] Set tick labels.
Discouraged
The use of this method is discouraged, because of the dependency on tick positions. In most cases, you'll want to use `set_ticks(positions, labels=labels)` instead.
If you are using this method, you should always fix the tick positions before, e.g. by using [`Colorbar.set_ticks`](#matplotlib.colorbar.Colorbar.set_ticks "matplotlib.colorbar.Colorbar.set_ticks") or by explicitly setting a [`FixedLocator`](ticker_api#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator") on the long axis of the colorbar. Otherwise, ticks are free to move and the labels may end up in unexpected positions.
Parameters:
**ticklabels**sequence of str or of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
Texts for labeling each tick location in the sequence set by [`Colorbar.set_ticks`](#matplotlib.colorbar.Colorbar.set_ticks "matplotlib.colorbar.Colorbar.set_ticks"); the number of labels must match the number of locations.
**update\_ticks**bool, default: True
This keyword argument is ignored and will be be removed. Deprecated
minorbool
If True, set minor ticks instead of major ticks.
**\*\*kwargs**
[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels.
set\_ticks(*ticks*, *update\_ticks=<deprecated parameter>*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L852-L877)
Set tick locations.
Parameters:
**ticks**list of floats
List of tick locations.
**labels**list of str, optional
List of tick labels. If not set, the labels show the data value.
**minor**bool, default: False
If `False`, set the major ticks; if `True`, the minor ticks.
**\*\*kwargs**
[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels. These take effect only if you pass *labels*. In other cases, please use [`tick_params`](_as_gen/matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
update\_normal(*mappable*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L474-L500)
Update solid patches, lines, etc.
This is meant to be called when the norm of the image or contour plot to which this colorbar belongs changes.
If the norm on the mappable is different than before, this resets the locator and formatter for the axis, so if these have been customized, they will need to be customized again. However, if the norm only changes values of *vmin*, *vmax* or *cmap* then the old formatter and locator will be preserved.
update\_ticks()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L794-L802)
Setup the ticks and ticklabels. This should not be needed by users.
matplotlib.colorbar.ColorbarBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L199-L1329)
alias of [`Colorbar`](#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar")
matplotlib.colorbar.make\_axes(*parents*, *location=None*, *orientation=None*, *fraction=0.15*, *shrink=1.0*, *aspect=20*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L1356-L1455)
Create an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") suitable for a colorbar.
The axes is placed in the figure of the *parents* axes, by resizing and repositioning *parents*.
Parameters:
**parents**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes to use as parents for placing the colorbar.
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
Returns:
**cax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The child axes.
**kwargs**dict
The reduced keyword dictionary to be passed when creating the colorbar instance.
matplotlib.colorbar.make\_axes\_gridspec(*parent*, *\**, *location=None*, *orientation=None*, *fraction=0.15*, *shrink=1.0*, *aspect=20*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colorbar.py#L1458-L1565)
Create a [`SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase") suitable for a colorbar.
The axes is placed in the figure of the *parent* axes, by resizing and repositioning *parent*.
This function is similar to [`make_axes`](#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes"). Primary differences are
* [`make_axes_gridspec`](#matplotlib.colorbar.make_axes_gridspec "matplotlib.colorbar.make_axes_gridspec") should only be used with a [`SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase") parent.
* [`make_axes`](#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes") creates an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"); [`make_axes_gridspec`](#matplotlib.colorbar.make_axes_gridspec "matplotlib.colorbar.make_axes_gridspec") creates a [`SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase").
* [`make_axes`](#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes") updates the position of the parent. [`make_axes_gridspec`](#matplotlib.colorbar.make_axes_gridspec "matplotlib.colorbar.make_axes_gridspec") replaces the `grid_spec` attribute of the parent with a new one.
While this function is meant to be compatible with [`make_axes`](#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes"), there could be some minor differences.
Parameters:
**parent**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes to use as parent for placing the colorbar.
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
Returns:
**cax**[`SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase")
The child axes.
**kwargs**dict
The reduced keyword dictionary to be passed when creating the colorbar instance.
| programming_docs |
matplotlib backend_mixed backend\_mixed
==============
*class*matplotlib.backends.backend\_mixed.MixedModeRenderer(*figure*, *width*, *height*, *dpi*, *vector\_renderer*, *raster\_renderer\_class=None*, *bbox\_inches\_restore=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_mixed.py#L8-L119)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A helper class to implement a renderer that switches between vector and raster drawing. An example may be a PDF writer, where most things are drawn with PDF vector commands, but some very complex objects, such as quad meshes, are rasterised and then output as images.
Parameters:
**figure**[`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure instance.
**width**scalar
The width of the canvas in logical units
**height**scalar
The height of the canvas in logical units
**dpi**float
The dpi of the canvas
**vector\_renderer**[`matplotlib.backend_bases.RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
An instance of a subclass of [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") that will be used for the vector drawing.
**raster\_renderer\_class**[`matplotlib.backend_bases.RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
The renderer class to use for the raster drawing. If not provided, this will use the Agg backend (which is currently the only viable option anyway.)
start\_rasterizing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_mixed.py#L71-L85)
Enter "raster" mode. All subsequent drawing commands (until [`stop_rasterizing`](#matplotlib.backends.backend_mixed.MixedModeRenderer.stop_rasterizing "matplotlib.backends.backend_mixed.MixedModeRenderer.stop_rasterizing") is called) will be drawn with the raster backend.
stop\_rasterizing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_mixed.py#L87-L119)
Exit "raster" mode. All of the drawing that was done since the last [`start_rasterizing`](#matplotlib.backends.backend_mixed.MixedModeRenderer.start_rasterizing "matplotlib.backends.backend_mixed.MixedModeRenderer.start_rasterizing") call will be copied to the vector backend by calling draw\_image.
matplotlib matplotlib.pyplot matplotlib.pyplot
=================
[`matplotlib.pyplot`](#module-matplotlib.pyplot "matplotlib.pyplot") is a state-based interface to matplotlib. It provides an implicit, MATLAB-like, way of plotting. It also opens figures on your screen, and acts as the figure GUI manager.
pyplot is mainly intended for interactive plots and simple cases of programmatic plot generation:
```
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1)
y = np.sin(x)
plt.plot(x, y)
```
The explicit object-oriented API is recommended for complex plots, though pyplot is still usually used to create the figure and often the axes in the figure. See [`pyplot.figure`](_as_gen/matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure"), [`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots"), and [`pyplot.subplot_mosaic`](_as_gen/matplotlib.pyplot.subplot_mosaic#matplotlib.pyplot.subplot_mosaic "matplotlib.pyplot.subplot_mosaic") to create figures, and [Axes API](axes_api) for the plotting methods on an Axes:
```
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0, 5, 0.1)
y = np.sin(x)
fig, ax = plt.subplots()
ax.plot(x, y)
```
See [Matplotlib Application Interfaces (APIs)](https://matplotlib.org/stable/users/explain/api_interfaces.html#api-interfaces) for an explanation of the tradeoffs between the implicit and explicit interfaces.
Plotting commands
-----------------
| | |
| --- | --- |
| [`acorr`](_as_gen/matplotlib.pyplot.acorr#matplotlib.pyplot.acorr "matplotlib.pyplot.acorr") | Plot the autocorrelation of *x*. |
| [`angle_spectrum`](_as_gen/matplotlib.pyplot.angle_spectrum#matplotlib.pyplot.angle_spectrum "matplotlib.pyplot.angle_spectrum") | Plot the angle spectrum. |
| [`annotate`](_as_gen/matplotlib.pyplot.annotate#matplotlib.pyplot.annotate "matplotlib.pyplot.annotate") | Annotate the point *xy* with text *text*. |
| [`arrow`](_as_gen/matplotlib.pyplot.arrow#matplotlib.pyplot.arrow "matplotlib.pyplot.arrow") | Add an arrow to the Axes. |
| [`autoscale`](_as_gen/matplotlib.pyplot.autoscale#matplotlib.pyplot.autoscale "matplotlib.pyplot.autoscale") | Autoscale the axis view to the data (toggle). |
| [`axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes") | Add an Axes to the current figure and make it the current Axes. |
| [`axhline`](_as_gen/matplotlib.pyplot.axhline#matplotlib.pyplot.axhline "matplotlib.pyplot.axhline") | Add a horizontal line across the Axes. |
| [`axhspan`](_as_gen/matplotlib.pyplot.axhspan#matplotlib.pyplot.axhspan "matplotlib.pyplot.axhspan") | Add a horizontal span (rectangle) across the Axes. |
| [`axis`](_as_gen/matplotlib.pyplot.axis#matplotlib.pyplot.axis "matplotlib.pyplot.axis") | Convenience method to get or set some axis properties. |
| [`axline`](_as_gen/matplotlib.pyplot.axline#matplotlib.pyplot.axline "matplotlib.pyplot.axline") | Add an infinitely long straight line. |
| [`axvline`](_as_gen/matplotlib.pyplot.axvline#matplotlib.pyplot.axvline "matplotlib.pyplot.axvline") | Add a vertical line across the Axes. |
| [`axvspan`](_as_gen/matplotlib.pyplot.axvspan#matplotlib.pyplot.axvspan "matplotlib.pyplot.axvspan") | Add a vertical span (rectangle) across the Axes. |
| [`bar`](_as_gen/matplotlib.pyplot.bar#matplotlib.pyplot.bar "matplotlib.pyplot.bar") | Make a bar plot. |
| [`bar_label`](_as_gen/matplotlib.pyplot.bar_label#matplotlib.pyplot.bar_label "matplotlib.pyplot.bar_label") | Label a bar plot. |
| [`barbs`](_as_gen/matplotlib.pyplot.barbs#matplotlib.pyplot.barbs "matplotlib.pyplot.barbs") | Plot a 2D field of barbs. |
| [`barh`](_as_gen/matplotlib.pyplot.barh#matplotlib.pyplot.barh "matplotlib.pyplot.barh") | Make a horizontal bar plot. |
| [`box`](_as_gen/matplotlib.pyplot.box#matplotlib.pyplot.box "matplotlib.pyplot.box") | Turn the axes box on or off on the current axes. |
| [`boxplot`](_as_gen/matplotlib.pyplot.boxplot#matplotlib.pyplot.boxplot "matplotlib.pyplot.boxplot") | Draw a box and whisker plot. |
| [`broken_barh`](_as_gen/matplotlib.pyplot.broken_barh#matplotlib.pyplot.broken_barh "matplotlib.pyplot.broken_barh") | Plot a horizontal sequence of rectangles. |
| [`cla`](_as_gen/matplotlib.pyplot.cla#matplotlib.pyplot.cla "matplotlib.pyplot.cla") | Clear the current axes. |
| [`clabel`](_as_gen/matplotlib.pyplot.clabel#matplotlib.pyplot.clabel "matplotlib.pyplot.clabel") | Label a contour plot. |
| [`clf`](_as_gen/matplotlib.pyplot.clf#matplotlib.pyplot.clf "matplotlib.pyplot.clf") | Clear the current figure. |
| [`clim`](_as_gen/matplotlib.pyplot.clim#matplotlib.pyplot.clim "matplotlib.pyplot.clim") | Set the color limits of the current image. |
| [`close`](_as_gen/matplotlib.pyplot.close#matplotlib.pyplot.close "matplotlib.pyplot.close") | Close a figure window. |
| [`cohere`](_as_gen/matplotlib.pyplot.cohere#matplotlib.pyplot.cohere "matplotlib.pyplot.cohere") | Plot the coherence between *x* and *y*. |
| [`colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") | Add a colorbar to a plot. |
| [`contour`](_as_gen/matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour") | Plot contour lines. |
| [`contourf`](_as_gen/matplotlib.pyplot.contourf#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf") | Plot filled contours. |
| [`csd`](_as_gen/matplotlib.pyplot.csd#matplotlib.pyplot.csd "matplotlib.pyplot.csd") | Plot the cross-spectral density. |
| [`delaxes`](_as_gen/matplotlib.pyplot.delaxes#matplotlib.pyplot.delaxes "matplotlib.pyplot.delaxes") | Remove an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") (defaulting to the current axes) from its figure. |
| [`draw`](_as_gen/matplotlib.pyplot.draw#matplotlib.pyplot.draw "matplotlib.pyplot.draw") | Redraw the current figure. |
| [`draw_if_interactive`](_as_gen/matplotlib.pyplot.draw_if_interactive#matplotlib.pyplot.draw_if_interactive "matplotlib.pyplot.draw_if_interactive") | Redraw the current figure if in interactive mode. |
| [`errorbar`](_as_gen/matplotlib.pyplot.errorbar#matplotlib.pyplot.errorbar "matplotlib.pyplot.errorbar") | Plot y versus x as lines and/or markers with attached errorbars. |
| [`eventplot`](_as_gen/matplotlib.pyplot.eventplot#matplotlib.pyplot.eventplot "matplotlib.pyplot.eventplot") | Plot identical parallel lines at the given positions. |
| [`figimage`](_as_gen/matplotlib.pyplot.figimage#matplotlib.pyplot.figimage "matplotlib.pyplot.figimage") | Add a non-resampled image to the figure. |
| [`figlegend`](_as_gen/matplotlib.pyplot.figlegend#matplotlib.pyplot.figlegend "matplotlib.pyplot.figlegend") | Place a legend on the figure. |
| [`fignum_exists`](_as_gen/matplotlib.pyplot.fignum_exists#matplotlib.pyplot.fignum_exists "matplotlib.pyplot.fignum_exists") | Return whether the figure with the given id exists. |
| [`figtext`](_as_gen/matplotlib.pyplot.figtext#matplotlib.pyplot.figtext "matplotlib.pyplot.figtext") | Add text to figure. |
| [`figure`](_as_gen/matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure") | Create a new figure, or activate an existing figure. |
| [`fill`](_as_gen/matplotlib.pyplot.fill#matplotlib.pyplot.fill "matplotlib.pyplot.fill") | Plot filled polygons. |
| [`fill_between`](_as_gen/matplotlib.pyplot.fill_between#matplotlib.pyplot.fill_between "matplotlib.pyplot.fill_between") | Fill the area between two horizontal curves. |
| [`fill_betweenx`](_as_gen/matplotlib.pyplot.fill_betweenx#matplotlib.pyplot.fill_betweenx "matplotlib.pyplot.fill_betweenx") | Fill the area between two vertical curves. |
| [`findobj`](_as_gen/matplotlib.pyplot.findobj#matplotlib.pyplot.findobj "matplotlib.pyplot.findobj") | Find artist objects. |
| [`gca`](_as_gen/matplotlib.pyplot.gca#matplotlib.pyplot.gca "matplotlib.pyplot.gca") | Get the current Axes. |
| [`gcf`](_as_gen/matplotlib.pyplot.gcf#matplotlib.pyplot.gcf "matplotlib.pyplot.gcf") | Get the current figure. |
| [`gci`](_as_gen/matplotlib.pyplot.gci#matplotlib.pyplot.gci "matplotlib.pyplot.gci") | Get the current colorable artist. |
| [`get`](_as_gen/matplotlib.pyplot.get#matplotlib.pyplot.get "matplotlib.pyplot.get") | Return the value of an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s *property*, or print all of them. |
| [`get_cmap`](_as_gen/matplotlib.pyplot.get_cmap#matplotlib.pyplot.get_cmap "matplotlib.pyplot.get_cmap") | Get a colormap instance, defaulting to rc values if *name* is None. |
| [`get_figlabels`](_as_gen/matplotlib.pyplot.get_figlabels#matplotlib.pyplot.get_figlabels "matplotlib.pyplot.get_figlabels") | Return a list of existing figure labels. |
| [`get_fignums`](_as_gen/matplotlib.pyplot.get_fignums#matplotlib.pyplot.get_fignums "matplotlib.pyplot.get_fignums") | Return a list of existing figure numbers. |
| [`getp`](_as_gen/matplotlib.pyplot.getp#matplotlib.pyplot.getp "matplotlib.pyplot.getp") | Return the value of an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s *property*, or print all of them. |
| [`grid`](_as_gen/matplotlib.pyplot.grid#matplotlib.pyplot.grid "matplotlib.pyplot.grid") | Configure the grid lines. |
| [`hexbin`](_as_gen/matplotlib.pyplot.hexbin#matplotlib.pyplot.hexbin "matplotlib.pyplot.hexbin") | Make a 2D hexagonal binning plot of points *x*, *y*. |
| [`hist`](_as_gen/matplotlib.pyplot.hist#matplotlib.pyplot.hist "matplotlib.pyplot.hist") | Compute and plot a histogram. |
| [`hist2d`](_as_gen/matplotlib.pyplot.hist2d#matplotlib.pyplot.hist2d "matplotlib.pyplot.hist2d") | Make a 2D histogram plot. |
| [`hlines`](_as_gen/matplotlib.pyplot.hlines#matplotlib.pyplot.hlines "matplotlib.pyplot.hlines") | Plot horizontal lines at each *y* from *xmin* to *xmax*. |
| [`imread`](_as_gen/matplotlib.pyplot.imread#matplotlib.pyplot.imread "matplotlib.pyplot.imread") | Read an image from a file into an array. |
| [`imsave`](_as_gen/matplotlib.pyplot.imsave#matplotlib.pyplot.imsave "matplotlib.pyplot.imsave") | Save an array as an image file. |
| [`imshow`](_as_gen/matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow") | Display data as an image, i.e., on a 2D regular raster. |
| [`install_repl_displayhook`](_as_gen/matplotlib.pyplot.install_repl_displayhook#matplotlib.pyplot.install_repl_displayhook "matplotlib.pyplot.install_repl_displayhook") | Connect to the display hook of the current shell. |
| [`ioff`](_as_gen/matplotlib.pyplot.ioff#matplotlib.pyplot.ioff "matplotlib.pyplot.ioff") | Disable interactive mode. |
| [`ion`](_as_gen/matplotlib.pyplot.ion#matplotlib.pyplot.ion "matplotlib.pyplot.ion") | Enable interactive mode. |
| [`isinteractive`](_as_gen/matplotlib.pyplot.isinteractive#matplotlib.pyplot.isinteractive "matplotlib.pyplot.isinteractive") | Return whether plots are updated after every plotting command. |
| [`legend`](_as_gen/matplotlib.pyplot.legend#matplotlib.pyplot.legend "matplotlib.pyplot.legend") | Place a legend on the Axes. |
| [`locator_params`](_as_gen/matplotlib.pyplot.locator_params#matplotlib.pyplot.locator_params "matplotlib.pyplot.locator_params") | Control behavior of major tick locators. |
| [`loglog`](_as_gen/matplotlib.pyplot.loglog#matplotlib.pyplot.loglog "matplotlib.pyplot.loglog") | Make a plot with log scaling on both the x and y axis. |
| [`magnitude_spectrum`](_as_gen/matplotlib.pyplot.magnitude_spectrum#matplotlib.pyplot.magnitude_spectrum "matplotlib.pyplot.magnitude_spectrum") | Plot the magnitude spectrum. |
| [`margins`](_as_gen/matplotlib.pyplot.margins#matplotlib.pyplot.margins "matplotlib.pyplot.margins") | Set or retrieve autoscaling margins. |
| [`matshow`](_as_gen/matplotlib.pyplot.matshow#matplotlib.pyplot.matshow "matplotlib.pyplot.matshow") | Display an array as a matrix in a new figure window. |
| [`minorticks_off`](_as_gen/matplotlib.pyplot.minorticks_off#matplotlib.pyplot.minorticks_off "matplotlib.pyplot.minorticks_off") | Remove minor ticks from the Axes. |
| [`minorticks_on`](_as_gen/matplotlib.pyplot.minorticks_on#matplotlib.pyplot.minorticks_on "matplotlib.pyplot.minorticks_on") | Display minor ticks on the Axes. |
| [`pause`](_as_gen/matplotlib.pyplot.pause#matplotlib.pyplot.pause "matplotlib.pyplot.pause") | Run the GUI event loop for *interval* seconds. |
| [`pcolor`](_as_gen/matplotlib.pyplot.pcolor#matplotlib.pyplot.pcolor "matplotlib.pyplot.pcolor") | Create a pseudocolor plot with a non-regular rectangular grid. |
| [`pcolormesh`](_as_gen/matplotlib.pyplot.pcolormesh#matplotlib.pyplot.pcolormesh "matplotlib.pyplot.pcolormesh") | Create a pseudocolor plot with a non-regular rectangular grid. |
| [`phase_spectrum`](_as_gen/matplotlib.pyplot.phase_spectrum#matplotlib.pyplot.phase_spectrum "matplotlib.pyplot.phase_spectrum") | Plot the phase spectrum. |
| [`pie`](_as_gen/matplotlib.pyplot.pie#matplotlib.pyplot.pie "matplotlib.pyplot.pie") | Plot a pie chart. |
| [`plot`](_as_gen/matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") | Plot y versus x as lines and/or markers. |
| [`plot_date`](_as_gen/matplotlib.pyplot.plot_date#matplotlib.pyplot.plot_date "matplotlib.pyplot.plot_date") | [*Discouraged*] Plot coercing the axis to treat floats as dates. |
| [`polar`](_as_gen/matplotlib.pyplot.polar#matplotlib.pyplot.polar "matplotlib.pyplot.polar") | Make a polar plot. |
| [`psd`](_as_gen/matplotlib.pyplot.psd#matplotlib.pyplot.psd "matplotlib.pyplot.psd") | Plot the power spectral density. |
| [`quiver`](_as_gen/matplotlib.pyplot.quiver#matplotlib.pyplot.quiver "matplotlib.pyplot.quiver") | Plot a 2D field of arrows. |
| [`quiverkey`](_as_gen/matplotlib.pyplot.quiverkey#matplotlib.pyplot.quiverkey "matplotlib.pyplot.quiverkey") | Add a key to a quiver plot. |
| [`rc`](_as_gen/matplotlib.pyplot.rc#matplotlib.pyplot.rc "matplotlib.pyplot.rc") | Set the current [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams"). *group* is the grouping for the rc, e.g., for `lines.linewidth` the group is `lines`, for `axes.facecolor`, the group is `axes`, and so on. Group may also be a list or tuple of group names, e.g., (*xtick*, *ytick*). *kwargs* is a dictionary attribute name/value pairs, e.g.,::. |
| [`rc_context`](_as_gen/matplotlib.pyplot.rc_context#matplotlib.pyplot.rc_context "matplotlib.pyplot.rc_context") | Return a context manager for temporarily changing rcParams. |
| [`rcdefaults`](_as_gen/matplotlib.pyplot.rcdefaults#matplotlib.pyplot.rcdefaults "matplotlib.pyplot.rcdefaults") | Restore the [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") from Matplotlib's internal default style. |
| [`rgrids`](_as_gen/matplotlib.pyplot.rgrids#matplotlib.pyplot.rgrids "matplotlib.pyplot.rgrids") | Get or set the radial gridlines on the current polar plot. |
| [`savefig`](_as_gen/matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig") | Save the current figure. |
| [`sca`](_as_gen/matplotlib.pyplot.sca#matplotlib.pyplot.sca "matplotlib.pyplot.sca") | Set the current Axes to *ax* and the current Figure to the parent of *ax*. |
| [`scatter`](_as_gen/matplotlib.pyplot.scatter#matplotlib.pyplot.scatter "matplotlib.pyplot.scatter") | A scatter plot of *y* vs. |
| [`sci`](_as_gen/matplotlib.pyplot.sci#matplotlib.pyplot.sci "matplotlib.pyplot.sci") | Set the current image. |
| [`semilogx`](_as_gen/matplotlib.pyplot.semilogx#matplotlib.pyplot.semilogx "matplotlib.pyplot.semilogx") | Make a plot with log scaling on the x axis. |
| [`semilogy`](_as_gen/matplotlib.pyplot.semilogy#matplotlib.pyplot.semilogy "matplotlib.pyplot.semilogy") | Make a plot with log scaling on the y axis. |
| [`set_cmap`](_as_gen/matplotlib.pyplot.set_cmap#matplotlib.pyplot.set_cmap "matplotlib.pyplot.set_cmap") | Set the default colormap, and applies it to the current image if any. |
| [`set_loglevel`](_as_gen/matplotlib.pyplot.set_loglevel#matplotlib.pyplot.set_loglevel "matplotlib.pyplot.set_loglevel") | Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet. |
| [`setp`](_as_gen/matplotlib.pyplot.setp#matplotlib.pyplot.setp "matplotlib.pyplot.setp") | Set one or more properties on an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), or list allowed values. |
| [`show`](_as_gen/matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show") | Display all open figures. |
| [`specgram`](_as_gen/matplotlib.pyplot.specgram#matplotlib.pyplot.specgram "matplotlib.pyplot.specgram") | Plot a spectrogram. |
| [`spy`](_as_gen/matplotlib.pyplot.spy#matplotlib.pyplot.spy "matplotlib.pyplot.spy") | Plot the sparsity pattern of a 2D array. |
| [`stackplot`](_as_gen/matplotlib.pyplot.stackplot#matplotlib.pyplot.stackplot "matplotlib.pyplot.stackplot") | Draw a stacked area plot. |
| [`stairs`](_as_gen/matplotlib.pyplot.stairs#matplotlib.pyplot.stairs "matplotlib.pyplot.stairs") | A stepwise constant function as a line with bounding edges or a filled plot. |
| [`stem`](_as_gen/matplotlib.pyplot.stem#matplotlib.pyplot.stem "matplotlib.pyplot.stem") | Create a stem plot. |
| [`step`](_as_gen/matplotlib.pyplot.step#matplotlib.pyplot.step "matplotlib.pyplot.step") | Make a step plot. |
| [`streamplot`](_as_gen/matplotlib.pyplot.streamplot#matplotlib.pyplot.streamplot "matplotlib.pyplot.streamplot") | Draw streamlines of a vector flow. |
| [`subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot") | Add an Axes to the current figure or retrieve an existing Axes. |
| [`subplot2grid`](_as_gen/matplotlib.pyplot.subplot2grid#matplotlib.pyplot.subplot2grid "matplotlib.pyplot.subplot2grid") | Create a subplot at a specific location inside a regular grid. |
| [`subplot_mosaic`](_as_gen/matplotlib.pyplot.subplot_mosaic#matplotlib.pyplot.subplot_mosaic "matplotlib.pyplot.subplot_mosaic") | Build a layout of Axes based on ASCII art or nested lists. |
| [`subplot_tool`](_as_gen/matplotlib.pyplot.subplot_tool#matplotlib.pyplot.subplot_tool "matplotlib.pyplot.subplot_tool") | Launch a subplot tool window for a figure. |
| [`subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots") | Create a figure and a set of subplots. |
| [`subplots_adjust`](_as_gen/matplotlib.pyplot.subplots_adjust#matplotlib.pyplot.subplots_adjust "matplotlib.pyplot.subplots_adjust") | Adjust the subplot layout parameters. |
| [`suptitle`](_as_gen/matplotlib.pyplot.suptitle#matplotlib.pyplot.suptitle "matplotlib.pyplot.suptitle") | Add a centered suptitle to the figure. |
| [`switch_backend`](_as_gen/matplotlib.pyplot.switch_backend#matplotlib.pyplot.switch_backend "matplotlib.pyplot.switch_backend") | Close all open figures and set the Matplotlib backend. |
| [`table`](_as_gen/matplotlib.pyplot.table#matplotlib.pyplot.table "matplotlib.pyplot.table") | Add a table to an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). |
| [`text`](_as_gen/matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text") | Add text to the Axes. |
| [`thetagrids`](_as_gen/matplotlib.pyplot.thetagrids#matplotlib.pyplot.thetagrids "matplotlib.pyplot.thetagrids") | Get or set the theta gridlines on the current polar plot. |
| [`tick_params`](_as_gen/matplotlib.pyplot.tick_params#matplotlib.pyplot.tick_params "matplotlib.pyplot.tick_params") | Change the appearance of ticks, tick labels, and gridlines. |
| [`ticklabel_format`](_as_gen/matplotlib.pyplot.ticklabel_format#matplotlib.pyplot.ticklabel_format "matplotlib.pyplot.ticklabel_format") | Configure the [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") used by default for linear Axes. |
| [`tight_layout`](_as_gen/matplotlib.pyplot.tight_layout#matplotlib.pyplot.tight_layout "matplotlib.pyplot.tight_layout") | Adjust the padding between and around subplots. |
| [`title`](_as_gen/matplotlib.pyplot.title#matplotlib.pyplot.title "matplotlib.pyplot.title") | Set a title for the Axes. |
| [`tricontour`](_as_gen/matplotlib.pyplot.tricontour#matplotlib.pyplot.tricontour "matplotlib.pyplot.tricontour") | Draw contour lines on an unstructured triangular grid. |
| [`tricontourf`](_as_gen/matplotlib.pyplot.tricontourf#matplotlib.pyplot.tricontourf "matplotlib.pyplot.tricontourf") | Draw contour regions on an unstructured triangular grid. |
| [`tripcolor`](_as_gen/matplotlib.pyplot.tripcolor#matplotlib.pyplot.tripcolor "matplotlib.pyplot.tripcolor") | Create a pseudocolor plot of an unstructured triangular grid. |
| [`triplot`](_as_gen/matplotlib.pyplot.triplot#matplotlib.pyplot.triplot "matplotlib.pyplot.triplot") | Draw an unstructured triangular grid as lines and/or markers. |
| [`twinx`](_as_gen/matplotlib.pyplot.twinx#matplotlib.pyplot.twinx "matplotlib.pyplot.twinx") | Make and return a second axes that shares the *x*-axis. |
| [`twiny`](_as_gen/matplotlib.pyplot.twiny#matplotlib.pyplot.twiny "matplotlib.pyplot.twiny") | Make and return a second axes that shares the *y*-axis. |
| [`uninstall_repl_displayhook`](_as_gen/matplotlib.pyplot.uninstall_repl_displayhook#matplotlib.pyplot.uninstall_repl_displayhook "matplotlib.pyplot.uninstall_repl_displayhook") | Disconnect from the display hook of the current shell. |
| [`violinplot`](_as_gen/matplotlib.pyplot.violinplot#matplotlib.pyplot.violinplot "matplotlib.pyplot.violinplot") | Make a violin plot. |
| [`vlines`](_as_gen/matplotlib.pyplot.vlines#matplotlib.pyplot.vlines "matplotlib.pyplot.vlines") | Plot vertical lines at each *x* from *ymin* to *ymax*. |
| [`xcorr`](_as_gen/matplotlib.pyplot.xcorr#matplotlib.pyplot.xcorr "matplotlib.pyplot.xcorr") | Plot the cross correlation between *x* and *y*. |
| [`xkcd`](_as_gen/matplotlib.pyplot.xkcd#matplotlib.pyplot.xkcd "matplotlib.pyplot.xkcd") | Turn on [xkcd](https://xkcd.com/) sketch-style drawing mode. |
| [`xlabel`](_as_gen/matplotlib.pyplot.xlabel#matplotlib.pyplot.xlabel "matplotlib.pyplot.xlabel") | Set the label for the x-axis. |
| [`xlim`](_as_gen/matplotlib.pyplot.xlim#matplotlib.pyplot.xlim "matplotlib.pyplot.xlim") | Get or set the x limits of the current axes. |
| [`xscale`](_as_gen/matplotlib.pyplot.xscale#matplotlib.pyplot.xscale "matplotlib.pyplot.xscale") | Set the xaxis' scale. |
| [`xticks`](_as_gen/matplotlib.pyplot.xticks#matplotlib.pyplot.xticks "matplotlib.pyplot.xticks") | Get or set the current tick locations and labels of the x-axis. |
| [`ylabel`](_as_gen/matplotlib.pyplot.ylabel#matplotlib.pyplot.ylabel "matplotlib.pyplot.ylabel") | Set the label for the y-axis. |
| [`ylim`](_as_gen/matplotlib.pyplot.ylim#matplotlib.pyplot.ylim "matplotlib.pyplot.ylim") | Get or set the y-limits of the current axes. |
| [`yscale`](_as_gen/matplotlib.pyplot.yscale#matplotlib.pyplot.yscale "matplotlib.pyplot.yscale") | Set the yaxis' scale. |
| [`yticks`](_as_gen/matplotlib.pyplot.yticks#matplotlib.pyplot.yticks "matplotlib.pyplot.yticks") | Get or set the current tick locations and labels of the y-axis. |
Other commands
--------------
| | |
| --- | --- |
| [`connect`](_as_gen/matplotlib.pyplot.connect#matplotlib.pyplot.connect "matplotlib.pyplot.connect") | Bind function *func* to event *s*. |
| [`disconnect`](_as_gen/matplotlib.pyplot.disconnect#matplotlib.pyplot.disconnect "matplotlib.pyplot.disconnect") | Disconnect the callback with id *cid*. |
| [`get_current_fig_manager`](_as_gen/matplotlib.pyplot.get_current_fig_manager#matplotlib.pyplot.get_current_fig_manager "matplotlib.pyplot.get_current_fig_manager") | Return the figure manager of the current figure. |
| [`ginput`](_as_gen/matplotlib.pyplot.ginput#matplotlib.pyplot.ginput "matplotlib.pyplot.ginput") | Blocking call to interact with a figure. |
| [`new_figure_manager`](_as_gen/matplotlib.pyplot.new_figure_manager#matplotlib.pyplot.new_figure_manager "matplotlib.pyplot.new_figure_manager") | Create a new figure manager instance. |
| [`waitforbuttonpress`](_as_gen/matplotlib.pyplot.waitforbuttonpress#matplotlib.pyplot.waitforbuttonpress "matplotlib.pyplot.waitforbuttonpress") | Blocking call to interact with the figure. |
Colormaps
---------
Colormaps are available via the colormap registry [`matplotlib.colormaps`](matplotlib_configuration_api#matplotlib.colormaps "matplotlib.colormaps"). For convenience this registry is available in `pyplot` as
matplotlib.pyplot.colormaps[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py)
Container for colormaps that are known to Matplotlib by name.
Experimental
While we expect the API to be final, we formally mark it as experimental for 3.5 because we want to keep the option to still adapt the API for 3.6 should the need arise.
The universal registry instance is [`matplotlib.colormaps`](matplotlib_configuration_api#matplotlib.colormaps "matplotlib.colormaps"). There should be no need for users to instantiate [`ColormapRegistry`](cm_api#matplotlib.cm.ColormapRegistry "matplotlib.cm.ColormapRegistry") themselves.
Read access uses a dict-like interface mapping names to [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s:
```
import matplotlib as mpl
cmap = mpl.colormaps['viridis']
```
Returned [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s are copies, so that their modification does not change the global definition of the colormap.
Additional colormaps can be added via [`ColormapRegistry.register`](cm_api#matplotlib.cm.ColormapRegistry.register "matplotlib.cm.ColormapRegistry.register"):
```
mpl.colormaps.register(my_colormap)
```
Additionally, there are shortcut functions to set builtin colormaps; e.g. `plt.viridis()` is equivalent to `plt.set_cmap('viridis')`.
matplotlib.pyplot.color\_sequences[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py)
Container for sequences of colors that are known to Matplotlib by name.
The universal registry instance is [`matplotlib.color_sequences`](matplotlib_configuration_api#matplotlib.color_sequences "matplotlib.color_sequences"). There should be no need for users to instantiate [`ColorSequenceRegistry`](_as_gen/matplotlib.colors.colorsequenceregistry#matplotlib.colors.ColorSequenceRegistry "matplotlib.colors.ColorSequenceRegistry") themselves.
Read access uses a dict-like interface mapping names to lists of colors:
```
import matplotlib as mpl
cmap = mpl.color_sequences['tab10']
```
The returned lists are copies, so that their modification does not change the global definition of the color sequence.
Additional color sequences can be added via [`ColorSequenceRegistry.register`](_as_gen/matplotlib.colors.colorsequenceregistry#matplotlib.colors.ColorSequenceRegistry.register "matplotlib.colors.ColorSequenceRegistry.register"):
```
mpl.color_sequences.register('rgb', ['r', 'g', 'b'])
```
| programming_docs |
matplotlib backend_template backend\_template
=================
A fully functional, do-nothing backend intended as a template for backend writers. It is fully functional in that you can select it as a backend e.g. with
```
import matplotlib
matplotlib.use("template")
```
and your program will (should!) run without error, though no output is produced. This provides a starting point for backend writers; you can selectively implement drawing methods ([`draw_path`](#matplotlib.backends.backend_template.RendererTemplate.draw_path "matplotlib.backends.backend_template.RendererTemplate.draw_path"), [`draw_image`](#matplotlib.backends.backend_template.RendererTemplate.draw_image "matplotlib.backends.backend_template.RendererTemplate.draw_image"), etc.) and slowly see your figure come to life instead having to have a full blown implementation before getting any results.
Copy this file to a directory outside of the Matplotlib source tree, somewhere where Python can import it (by adding the directory to your `sys.path` or by packaging it as a normal Python package); if the backend is importable as `import my.backend` you can then select it using
```
import matplotlib
matplotlib.use("module://my.backend")
```
If your backend implements support for saving figures (i.e. has a `print_xyz` method), you can register it as the default handler for a given file type:
```
from matplotlib.backend_bases import register_backend
register_backend('xyz', 'my_backend', 'XYZ File Format')
...
plt.savefig("figure.xyz")
```
matplotlib.backends.backend\_template.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L159-L214)
alias of [`FigureCanvasTemplate`](#matplotlib.backends.backend_template.FigureCanvasTemplate "matplotlib.backends.backend_template.FigureCanvasTemplate")
*class*matplotlib.backends.backend\_template.FigureCanvasTemplate(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L159-L214)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
The canvas the figure renders into. Calls the draw and print fig methods, creates the renderers, etc.
Note: GUI templates will want to connect events for button presses, mouse movements and key presses to functions that call the base class methods button\_press\_event, button\_release\_event, motion\_notify\_event, key\_press\_event, and key\_release\_event. See the implementations of the interactive backends for examples.
Attributes:
**figure**[`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
A high-level Figure instance
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L181-L191)
Draw the figure using the renderer.
It is important that this method actually walk the artist tree even if not output is produced because this will trigger deferred work (like computing limits auto-limits and tick values) that users may want access to before saving to disk.
filetypes*={'eps': 'Encapsulated Postscript', 'foo': 'My magic Foo format', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format', 'webp': 'WebP Image Format'}*
get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L213-L214)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
manager\_class[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L151-L156)
alias of [`FigureManagerTemplate`](#matplotlib.backends.backend_template.FigureManagerTemplate "matplotlib.backends.backend_template.FigureManagerTemplate")
print\_foo(*filename*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L200-L211)
Write out format foo.
This method is normally called via [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") and [`FigureCanvasBase.print_figure`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.print_figure "matplotlib.backend_bases.FigureCanvasBase.print_figure"), which take care of setting the figure facecolor, edgecolor, and dpi to the desired output values, and will restore them to the original values. Therefore, [`print_foo`](#matplotlib.backends.backend_template.FigureCanvasTemplate.print_foo "matplotlib.backends.backend_template.FigureCanvasTemplate.print_foo") does not need to handle these settings.
matplotlib.backends.backend\_template.FigureManager[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L151-L156)
alias of [`FigureManagerTemplate`](#matplotlib.backends.backend_template.FigureManagerTemplate "matplotlib.backends.backend_template.FigureManagerTemplate")
*class*matplotlib.backends.backend\_template.FigureManagerTemplate(*canvas*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L151-L156)
Bases: [`FigureManagerBase`](backend_bases_api#matplotlib.backend_bases.FigureManagerBase "matplotlib.backend_bases.FigureManagerBase")
Helper class for pyplot mode, wraps everything up into a neat bundle.
For non-interactive backends, the base class is sufficient.
*class*matplotlib.backends.backend\_template.GraphicsContextTemplate[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L109-L128)
Bases: [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context provides the color, line styles, etc. See the cairo and postscript backends for examples of mapping the graphics context attributes (cap styles, join styles, line widths, colors) to a particular backend. In cairo this is done by wrapping a cairo.Context object and forwarding the appropriate calls to it using a dictionary mapping styles to gdk constants. In Postscript, all the work is done by the renderer, mapping line styles to postscript calls.
If it's more appropriate to do the mapping at the renderer level (as in the postscript backend), you don't need to override any of the GC methods. If it's more appropriate to wrap an instance (as in the cairo backend) and do the mapping here, you'll need to override several of the setter methods.
The base GraphicsContext stores colors as a RGB tuple on the unit interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors appropriate for your backend.
*class*matplotlib.backends.backend\_template.RendererTemplate(*dpi*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L39-L106)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
The renderer handles drawing/rendering operations.
This is a minimal do-nothing class that can be used to get started when writing a new backend. Refer to [`backend_bases.RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") for documentation of the methods.
draw\_image(*gc*, *x*, *y*, *im*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L79-L80)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that `option_scale_image` returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_template.RendererTemplate.draw_image "matplotlib.backends.backend_template.RendererTemplate.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L52-L53)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L82-L83)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
flipy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L85-L87)
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L89-L91)
Return the canvas width and height in display coords.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L93-L94)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
new\_gc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L96-L98)
Return an instance of a [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase").
points\_to\_pixels(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L100-L106)
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
```
points to pixels = points * pixels_per_inch/72 * dpi/72
```
Parameters:
**points**float or array-like
a float or a numpy array of float
Returns:
Points converted to pixels
matplotlib.backends.backend\_template.show(*\**, *block=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_template.py#L139-L148)
For image backends - is not required. For GUI backends - show() is usually the last line of a pyplot script and tells the backend that it is time to draw. In interactive mode, this should do nothing.
matplotlib matplotlib.texmanager matplotlib.texmanager
=====================
Support for embedded TeX expressions in Matplotlib.
Requirements:
* LaTeX.
* \*Agg backends: dvipng>=1.6.
* PS backend: PSfrag, dvips, and Ghostscript>=9.0.
* PDF and SVG backends: if LuaTeX is present, it will be used to speed up some post-processing steps, but note that it is not used to parse the TeX string itself (only LaTeX is supported).
To enable TeX rendering of all text in your Matplotlib figure, set `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`) to True.
TeX and dvipng/dvips processing results are cached in ~/.matplotlib/tex.cache for reuse between sessions.
[`TexManager.get_rgba`](#matplotlib.texmanager.TexManager.get_rgba "matplotlib.texmanager.TexManager.get_rgba") can also be used to directly obtain raster output as RGBA NumPy arrays.
*class*matplotlib.texmanager.TexManager[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L56-L368)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Convert strings to dvi files using TeX, caching the results to a directory.
Repeated calls to this constructor always return the same instance.
*property*font\_families[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*font\_family[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*font\_info[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*classmethod*get\_basefile(*tex*, *fontsize*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L178-L185)
Return a filename based on a hash of the string, fontsize, and dpi.
*classmethod*get\_custom\_preamble()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L195-L198)
Return a string containing user additions to the tex preamble.
get\_font\_config()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L113-L120)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
*classmethod*get\_font\_preamble()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L187-L193)
Return a string containing font configuration for the tex preamble.
*classmethod*get\_grey(*tex*, *fontsize=None*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L326-L339)
Return the alpha channel.
*classmethod*get\_rgba(*tex*, *fontsize=None*, *dpi=None*, *rgb=(0, 0, 0)*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L341-L356)
Return latex's rendering of the tex string as an rgba array.
#### Examples
```
>>> texmanager = TexManager()
>>> s = r"\TeX\ is $\displaystyle\sum_n\frac{-e^{i\pi}}{2^n}$!"
>>> Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1, 0, 0))
```
*classmethod*get\_text\_width\_height\_descent(*tex*, *fontsize*, *renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L358-L368)
Return width, height and descent of the text.
*property*grey\_arrayd[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*classmethod*make\_dvi(*tex*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L276-L300)
Generate a dvi file containing latex's layout of tex string.
Return the file name.
*classmethod*make\_png(*tex*, *fontsize*, *dpi*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L302-L324)
Generate a png file containing latex's rendering of tex string.
Return the file name.
*classmethod*make\_tex(*tex*, *fontsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/texmanager.py#L238-L248)
Generate a tex file to render the tex string at a specific font size.
Return the file name.
texcache*='/home/elliott/.cache/matplotlib/tex.cache'*
matplotlib backend_pdf backend\_pdf
============
A PDF Matplotlib backend.
Author: Jouni K Seppänen <[[email protected]](https://matplotlib.org/cdn-cgi/l/email-protection#751f1e06535646424e535640474e5356414d4e1c1e1c535641434e131c)> and others.
matplotlib.backends.backend\_pdf.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2790-L2827)
alias of [`FigureCanvasPdf`](#matplotlib.backends.backend_pdf.FigureCanvasPdf "matplotlib.backends.backend_pdf.FigureCanvasPdf")
*class*matplotlib.backends.backend\_pdf.FigureCanvasPdf(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2790-L2827)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2825-L2827)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
filetypes*={'pdf': 'Portable Document Format'}*
fixed\_dpi*=72*
get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2796-L2797)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
print\_pdf(*filename*, *\**, *bbox\_inches\_restore=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2799-L2823)
*class*matplotlib.backends.backend\_pdf.GraphicsContextPdf(*file*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2468-L2670)
Bases: [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
alpha\_cmd(*alpha*, *forced*, *effective\_alphas*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2535-L2537)
capstyle\_cmd(*style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2519-L2520)
capstyles*={'butt': 0, 'projecting': 2, 'round': 1}*
clip\_cmd(*cliprect*, *clippath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2580-L2598)
Set clip rectangle. Calls [`pop()`](#matplotlib.backends.backend_pdf.GraphicsContextPdf.pop "matplotlib.backends.backend_pdf.GraphicsContextPdf.pop") and [`push()`](#matplotlib.backends.backend_pdf.GraphicsContextPdf.push "matplotlib.backends.backend_pdf.GraphicsContextPdf.push").
commands*=((('\_cliprect', '\_clippath'), <function GraphicsContextPdf.clip\_cmd>), (('\_alpha', '\_forced\_alpha', '\_effective\_alphas'), <function GraphicsContextPdf.alpha\_cmd>), (('\_capstyle',), <function GraphicsContextPdf.capstyle\_cmd>), (('\_fillcolor',), <function GraphicsContextPdf.fillcolor\_cmd>), (('\_joinstyle',), <function GraphicsContextPdf.joinstyle\_cmd>), (('\_linewidth',), <function GraphicsContextPdf.linewidth\_cmd>), (('\_dashes',), <function GraphicsContextPdf.dash\_cmd>), (('\_rgb',), <function GraphicsContextPdf.rgb\_cmd>), (('\_hatch', '\_hatch\_color'), <function GraphicsContextPdf.hatch\_cmd>))*
copy\_properties(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2652-L2661)
Copy properties of other into self.
dash\_cmd(*dashes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2528-L2533)
delta(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2614-L2650)
Copy properties of other into self and return PDF commands needed to transform self into other.
fill(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2494-L2507)
Predicate: does the path need to be filled?
An optional argument can be used to specify an alternative \_fillcolor, as needed by RendererPdf.draw\_markers.
fillcolor\_cmd(*rgb*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2559-L2565)
finalize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2663-L2670)
Make sure every pushed graphics state is popped.
hatch\_cmd(*hatch*, *hatch\_color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2539-L2549)
joinstyle\_cmd(*style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2522-L2523)
joinstyles*={'bevel': 2, 'miter': 0, 'round': 1}*
linewidth\_cmd(*width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2525-L2526)
paint()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2509-L2514)
Return the appropriate pdf operator to cause the path to be stroked, filled, or both.
pop()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2574-L2578)
push()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2567-L2572)
rgb\_cmd(*rgb*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2551-L2557)
stroke()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2483-L2492)
Predicate: does the path need to be stroked (its outline drawn)? This tests for the various conditions that disable stroking the path, in which case it would presumably be filled.
*class*matplotlib.backends.backend\_pdf.Name(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L415-L451)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
PDF name object.
*static*hexify(*match*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L445-L448)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
name
pdfRepr()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L450-L451)
*class*matplotlib.backends.backend\_pdf.Op(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L477-L544)
Bases: [`Enum`](https://docs.python.org/3/library/enum.html#enum.Enum "(in Python v3.10)")
PDF operators (not an exhaustive list).
begin\_text*=b'BT'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
clip*=b'W'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
close\_fill\_stroke*=b'b'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
close\_stroke*=b's'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
closepath*=b'h'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
concat\_matrix*=b'cm'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
curveto*=b'c'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
end\_text*=b'ET'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
endpath*=b'n'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
fill*=b'f'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
fill\_stroke*=b'B'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
grestore*=b'Q'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
gsave*=b'q'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
lineto*=b'l'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
moveto*=b'm'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
*property*op[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*classmethod*paint\_path(*fill*, *stroke*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L523-L544)
Return the PDF operator to paint a path.
Parameters:
**fill**bool
Fill the path with the fill color.
**stroke**bool
Stroke the outline of the path with the line color.
pdfRepr()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L520-L521)
rectangle*=b're'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
selectfont*=b'Tf'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setcolor\_nonstroke*=b'scn'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setcolor\_stroke*=b'SCN'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setcolorspace\_nonstroke*=b'cs'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setcolorspace\_stroke*=b'CS'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setdash*=b'd'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setgray\_nonstroke*=b'g'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setgray\_stroke*=b'G'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setgstate*=b'gs'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setlinecap*=b'J'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setlinejoin*=b'j'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setlinewidth*=b'w'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setrgb\_nonstroke*=b'rg'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
setrgb\_stroke*=b'RG'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
shading*=b'sh'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
show*=b'Tj'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
showkern*=b'TJ'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
stroke*=b'S'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
textmatrix*=b'Tm'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
textpos*=b'Td'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
use\_xobject*=b'Do'*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py)
*class*matplotlib.backends.backend\_pdf.Operator(*op*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L454-L465)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
op
pdfRepr()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L464-L465)
*class*matplotlib.backends.backend\_pdf.PdfFile(*filename*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L686-L1962)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
PDF file object.
Parameters:
**filename**str or path-like or file-like
Output target; if a string, a file will be opened for writing.
**metadata**dict from strings to strings and dates
Information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary'), e.g.: `{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}`.
The standard keys are 'Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Producer', 'CreationDate', 'ModDate', and 'Trapped'. Values have been predefined for 'Creator', 'Producer' and 'CreationDate'. They can be removed by setting them to [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)").
addGouraudTriangles(*points*, *colors*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1616-L1637)
Add a Gouraud triangle shading.
Parameters:
**points**np.ndarray
Triangle vertices, shape (n, 3, 2) where n = number of triangles, 3 = vertices, 2 = x, y.
**colors**np.ndarray
Vertex colors, shape (n, 3, 1) or (n, 3, 4) as with points, but last dimension is either (gray,) or (r, g, b, alpha).
Returns:
Name, Reference
alphaState(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1480-L1491)
Return name of an ExtGState that sets alpha to the given value.
beginStream(*id*, *len*, *extra=None*, *png=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L902-L904)
close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L881-L890)
Flush all buffers and free all resources.
createType1Descriptor(*t1font*, *fontfile*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1072-L1133)
dviFontName(*dvifont*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L951-L979)
Given a dvi font object, return a name suitable for Op.selectfont. This registers the font information in `self.dviFontInfo` if not yet registered.
embedTTF(*filename*, *characters*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1163-L1478)
Embed the TTF font from the named file into the document.
endStream()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L906-L909)
finalize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L848-L879)
Write out the various deferred objects and the pdf end matter.
fontName(*fontprop*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L920-L949)
Select a font based on fontprop and return a name suitable for Op.selectfont. If fontprop is a string, it will be interpreted as the filename of the font.
hatchPattern(*hatch\_style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1560-L1576)
imageObject(*image*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1683-L1693)
Return name of an image XObject representing the given image.
markerObject(*path*, *trans*, *fill*, *stroke*, *lw*, *joinstyle*, *capstyle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1816-L1843)
Return name of a marker XObject representing the given path.
newPage(*width*, *height*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L794-L821)
newTextnote(*text*, *positionRect=[-100, -100, 0, 0]*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L823-L830)
output(*\*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L898-L900)
outputStream(*ref*, *data*, *\**, *extra=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L911-L914)
pathCollectionObject(*gc*, *path*, *trans*, *padding*, *filled*, *stroked*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1867-L1873)
*static*pathOperations(*path*, *transform*, *clip=None*, *simplify=None*, *sketch=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1896-L1903)
recordXref(*id*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1927-L1928)
reserveObject(*name=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1916-L1925)
Reserve an ID for an indirect object.
The name is used for debugging in case we forget to print out the object with writeObject.
write(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L892-L896)
writeExtGSTates()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1545-L1552)
writeFonts()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L981-L1000)
writeGouraudTriangles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1639-L1681)
writeHatches()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1578-L1614)
writeImages()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1806-L1814)
writeInfoDict()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1947-L1951)
Write out the info dictionary, checking it for good form
writeMarkers()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1845-L1865)
writeObject(*object*, *contents*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1930-L1932)
writePath(*path*, *transform*, *clip=False*, *sketch=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1905-L1914)
writePathCollectionTemplates()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1875-L1894)
writeTrailer()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1953-L1962)
Write out the PDF trailer.
writeXref()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1934-L1945)
Write out the xref table.
*class*matplotlib.backends.backend\_pdf.PdfPages(*filename*, *keep\_empty=True*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2673-L2787)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A multi-page PDF file.
#### Notes
In reality [`PdfPages`](#matplotlib.backends.backend_pdf.PdfPages "matplotlib.backends.backend_pdf.PdfPages") is a thin wrapper around [`PdfFile`](#matplotlib.backends.backend_pdf.PdfFile "matplotlib.backends.backend_pdf.PdfFile"), in order to avoid confusion when using [`savefig`](_as_gen/matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig") and forgetting the format argument.
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> # Initialize:
>>> with PdfPages('foo.pdf') as pdf:
... # As many times as you like, create a figure fig and save it:
... fig = plt.figure()
... pdf.savefig(fig)
... # When no figure is specified the current figure is saved
... pdf.savefig()
```
Create a new PdfPages object.
Parameters:
**filename**str or path-like or file-like
Plots using [`PdfPages.savefig`](#matplotlib.backends.backend_pdf.PdfPages.savefig "matplotlib.backends.backend_pdf.PdfPages.savefig") will be written to a file at this location. The file is opened at once and any older file with the same name is overwritten.
**keep\_empty**bool, optional
If set to False, then empty pdf files will be deleted automatically when closed.
**metadata**dict, optional
Information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary'), e.g.: `{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}`.
The standard keys are 'Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Producer', 'CreationDate', 'ModDate', and 'Trapped'. Values have been predefined for 'Creator', 'Producer' and 'CreationDate'. They can be removed by setting them to [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)").
attach\_note(*text*, *positionRect=[-100, -100, 0, 0]*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2780-L2787)
Add a new text note to the page to be saved next. The optional positionRect specifies the position of the new note on the page. It is outside the page per default to make sure it is invisible on printouts.
close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2729-L2739)
Finalize this object, making the underlying file a complete PDF file.
get\_pagecount()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2776-L2778)
Return the current number of pages in the multipage pdf file.
infodict()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2741-L2747)
Return a modifiable information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary').
keep\_empty
savefig(*figure=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2749-L2774)
Save a [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") to this file as a new page.
Any other keyword arguments are passed to [`savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
Parameters:
**figure**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") or int, default: the active figure
The figure, or index of the figure, that is saved to the file.
*class*matplotlib.backends.backend\_pdf.Reference(*id*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L392-L412)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
PDF reference object.
Use PdfFile.reserveObject() to create References.
pdfRepr()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L405-L406)
write(*contents*, *file*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L408-L412)
*class*matplotlib.backends.backend\_pdf.RendererPdf(*file*, *image\_dpi*, *height*, *width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1965-L2465)
Bases: `RendererPDFPSBase`
check\_gc(*gc*, *fillcolor=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1979-L2004)
draw\_gouraud\_triangle(*gc*, *points*, *colors*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2156-L2158)
Draw a Gouraud-shaded triangle.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**points**(3, 2) array-like
Array of (x, y) points for the triangle.
**colors**(3, 4) array-like
RGBA colors for each point of the triangle.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_gouraud\_triangles(*gc*, *points*, *colors*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2160-L2198)
Draw a series of Gouraud triangles.
Parameters:
**points**(N, 3, 2) array-like
Array of *N* (x, y) points for the triangles.
**colors**(N, 3, 4) array-like
Array of *N* RGBA colors for each point of the triangles.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_image(*gc*, *x*, *y*, *im*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2009-L2037)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that `option_scale_image` returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_pdf.RendererPdf.draw_image "matplotlib.backends.backend_pdf.RendererPdf.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *trans*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2118-L2154)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_pdf.RendererPdf.draw_path "matplotlib.backends.backend_pdf.RendererPdf.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_mathtext(*gc*, *x*, *y*, *s*, *prop*, *angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2210-L2262)
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2039-L2046)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_path\_collection(*gc*, *master\_transform*, *paths*, *all\_transforms*, *offsets*, *offset\_trans*, *facecolors*, *edgecolors*, *linewidths*, *linestyles*, *antialiaseds*, *urls*, *offset\_position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2048-L2116)
Draw a collection of *paths*.
Each path is first transformed by the corresponding entry in *all\_transforms* (a list of (3, 3) matrices) and then by *master\_transform*. They are then translated by the corresponding entry in *offsets*, which has been first transformed by *offset\_trans*.
*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and *antialiased* are lists that set the corresponding properties.
*offset\_position* is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_pdf.RendererPdf.draw_path "matplotlib.backends.backend_pdf.RendererPdf.draw_path"). Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods `_iter_collection_raw_paths` and `_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of [`draw_path_collection`](#matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection "matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection") can be made globally.
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *\**, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2264-L2345)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2352-L2450)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
encode\_string(*s*, *fonttype*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2347-L2350)
finalize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L1976-L1977)
get\_image\_magnification()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2006-L2007)
Get the factor by which to magnify images passed to [`draw_image`](#matplotlib.backends.backend_pdf.RendererPdf.draw_image "matplotlib.backends.backend_pdf.RendererPdf.draw_image"). Allows a backend to have images at a different resolution to other artists.
new\_gc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L2463-L2465)
Return an instance of a [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase").
*class*matplotlib.backends.backend\_pdf.Stream(*id*, *len*, *file*, *extra=None*, *png=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L547-L637)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
PDF stream object.
This has no pdfRepr method. Instead, call begin(), then output the contents of the stream by calling write(), and finally call end().
Parameters:
**id**int
Object id of the stream.
**len**Reference or None
An unused Reference object for the length of the stream; None means to use a memory buffer so the length can be inlined.
**file**PdfFile
The underlying object to write the stream to.
**extra**dict from Name to anything, or None
Extra key-value pairs to include in the stream header.
**png**dict or None
If the data is already png encoded, the decode parameters.
compressobj
end()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L606-L620)
Finalize stream.
extra
file
id
len
pdfFile
pos
write(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L622-L629)
Write some data on the stream.
*class*matplotlib.backends.backend\_pdf.Verbatim(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L468-L474)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Store verbatim PDF command content for later inclusion in the stream.
pdfRepr()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L473-L474)
matplotlib.backends.backend\_pdf.fill(*strings*, *linelen=75*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L95-L97)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of \_fill instead.
matplotlib.backends.backend\_pdf.pdfRepr(*obj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pdf.py#L304-L374)
Map Python objects to PDF syntax.
| programming_docs |
matplotlib backend_ps backend\_ps
===========
A PostScript backend, which can produce both PostScript .ps and .eps.
matplotlib.backends.backend\_ps.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L823-L1102)
alias of [`FigureCanvasPS`](#matplotlib.backends.backend_ps.FigureCanvasPS "matplotlib.backends.backend_ps.FigureCanvasPS")
*class*matplotlib.backends.backend\_ps.FigureCanvasPS(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L823-L1102)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1100-L1102)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
filetypes*={'eps': 'Encapsulated Postscript', 'ps': 'Postscript'}*
fixed\_dpi*=72*
get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L828-L829)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
print\_eps(*outfile*, *\*args*, *metadata=None*, *papertype=None*, *orientation='portrait'*, *\*\*kwargs*)
print\_ps(*outfile*, *\*args*, *metadata=None*, *papertype=None*, *orientation='portrait'*, *\*\*kwargs*)
*class*matplotlib.backends.backend\_ps.PsBackendHelper[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L42-L44)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
*class*matplotlib.backends.backend\_ps.RendererPS(*width*, *height*, *pswriter*, *imagedpi=72*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L253-L813)
Bases: `RendererPDFPSBase`
The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles.
create\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L364-L396)
draw\_gouraud\_triangle(*gc*, *points*, *colors*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L713-L716)
Draw a Gouraud-shaded triangle.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**points**(3, 2) array-like
Array of (x, y) points for the triangle.
**colors**(3, 4) array-like
RGBA colors for each point of the triangle.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_gouraud\_triangles(*gc*, *points*, *colors*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L718-L762)
Draw a series of Gouraud triangles.
Parameters:
**points**(N, 3, 2) array-like
Array of *N* (x, y) points for the triangles.
**colors**(N, 3, 4) array-like
Array of *N* RGBA colors for each point of the triangles.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_image(*gc*, *x*, *y*, *im*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L437-L468)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that `option_scale_image` returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_ps.RendererPS.draw_image "matplotlib.backends.backend_ps.RendererPS.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *trans*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L478-L529)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_ps.RendererPS.draw_path "matplotlib.backends.backend_ps.RendererPS.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_mathtext(*gc*, *x*, *y*, *s*, *prop*, *angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L686-L711)
Draw the math text using matplotlib.mathtext.
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L470-L476)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_path\_collection(*gc*, *master\_transform*, *paths*, *all\_transforms*, *offsets*, *offset\_trans*, *facecolors*, *edgecolors*, *linewidths*, *linestyles*, *antialiaseds*, *urls*, *offset\_position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L531-L574)
Draw a collection of *paths*.
Each path is first transformed by the corresponding entry in *all\_transforms* (a list of (3, 3) matrices) and then by *master\_transform*. They are then translated by the corresponding entry in *offsets*, which has been first transformed by *offset\_trans*.
*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and *antialiased* are lists that set the corresponding properties.
*offset\_position* is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_ps.RendererPS.draw_path "matplotlib.backends.backend_ps.RendererPS.draw_path"). Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods `_iter_collection_raw_paths` and `_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of [`draw_path_collection`](#matplotlib.backends.backend_ps.RendererPS.draw_path_collection "matplotlib.backends.backend_ps.RendererPS.draw_path_collection") can be made globally.
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *\**, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L576-L614)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L616-L684)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
get\_image\_magnification()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L398-L404)
Get the factor by which to magnify images passed to draw\_image. Allows a backend to have images at a different resolution to other artists.
set\_color(*r*, *g*, *b*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L303-L309)
set\_font(*fontname*, *fontsize*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L357-L362)
set\_linecap(*linecap*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L338-L342)
set\_linedash(*offset*, *seq*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L344-L355)
set\_linejoin(*linejoin*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L325-L329)
set\_linewidth(*linewidth*, *store=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L311-L316)
matplotlib.backends.backend\_ps.convert\_psfrags(*tmpfile*, *psfrags*, *font\_preamble*, *custom\_preamble*, *paper\_width*, *paper\_height*, *orientation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1105-L1109)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib.backends.backend\_ps.get\_bbox\_header(*lbrt*, *rotated=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1233-L1248)
Return a postscript header string for the given bbox lbrt=(l, b, r, t). Optionally, return rotate command.
matplotlib.backends.backend\_ps.gs\_distill(*tmpfile*, *eps=False*, *ptype='letter'*, *bbox=None*, *rotated=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1168-L1199)
Use ghostscript's pswrite or epswrite device to distill a file. This yields smaller files without illegal encapsulated postscript operators. The output is low-level, converting text to outlines.
matplotlib.backends.backend\_ps.pstoeps(*tmpfile*, *bbox=None*, *rotated=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1251-L1309)
Convert the postscript to encapsulated postscript. The bbox of the eps file will be replaced with the given *bbox* argument. If None, original bbox will be used.
matplotlib.backends.backend\_ps.quote\_ps\_string(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L90-L101)
[*Deprecated*] Quote dangerous characters of S for use in a PostScript string constant.
#### Notes
Deprecated since version 3.6: Use a vendored copy of this function instead.
matplotlib.backends.backend\_ps.xpdf\_distill(*tmpfile*, *eps=False*, *ptype='letter'*, *bbox=None*, *rotated=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_ps.py#L1202-L1230)
Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file. This yields smaller files without illegal encapsulated postscript operators. This distiller is preferred, generating high-level postscript output that treats text as text.
matplotlib matplotlib.sankey matplotlib.sankey
=================
Module for creating Sankey diagrams using Matplotlib.
*class*matplotlib.sankey.Sankey(*ax=None*, *scale=1.0*, *unit=''*, *format='%G'*, *gap=0.25*, *radius=0.1*, *shoulder=0.03*, *offset=0.15*, *head\_angle=100*, *margin=0.4*, *tolerance=1e-06*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sankey.py#L30-L825)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Sankey diagram.
Sankey diagrams are a specific type of flow diagram, in which the width of the arrows is shown proportionally to the flow quantity. They are typically used to visualize energy or material or cost transfers between processes. [Wikipedia (6/1/2011)](https://en.wikipedia.org/wiki/Sankey_diagram)
Create a new Sankey instance.
The optional arguments listed below are applied to all subdiagrams so that there is consistent alignment and formatting.
In order to draw a complex Sankey diagram, create an instance of [`Sankey`](#matplotlib.sankey.Sankey "matplotlib.sankey.Sankey") by calling it without any kwargs:
```
sankey = Sankey()
```
Then add simple Sankey sub-diagrams:
```
sankey.add() # 1
sankey.add() # 2
#...
sankey.add() # n
```
Finally, create the full diagram:
```
sankey.finish()
```
Or, instead, simply daisy-chain those calls:
```
Sankey().add().add... .add().finish()
```
Other Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Axes onto which the data should be plotted. If *ax* isn't provided, new Axes will be created.
**scale**float
Scaling factor for the flows. *scale* sizes the width of the paths in order to maintain proper layout. The same scale is applied to all subdiagrams. The value should be chosen such that the product of the scale and the sum of the inputs is approximately 1.0 (and the product of the scale and the sum of the outputs is approximately -1.0).
**unit**str
The physical unit associated with the flow quantities. If *unit* is None, then none of the quantities are labeled.
**format**str or callable
A Python number formatting string or callable used to label the flows with their quantities (i.e., a number times a unit, where the unit is given). If a format string is given, the label will be `format % quantity`. If a callable is given, it will be called with `quantity` as an argument.
**gap**float
Space between paths that break in/break away to/from the top or bottom.
**radius**float
Inner radius of the vertical paths.
**shoulder**float
Size of the shoulders of output arrows.
**offset**float
Text offset (from the dip or tip of the arrow).
**head\_angle**float
Angle, in degrees, of the arrow heads (and negative of the angle of the tails).
**margin**float
Minimum space between Sankey outlines and the edge of the plot area.
**tolerance**float
Acceptable maximum of the magnitude of the sum of flows. The magnitude of the sum of connected flows cannot be greater than *tolerance*.
**\*\*kwargs**
Any additional keyword arguments will be passed to [`add()`](#matplotlib.sankey.Sankey.add "matplotlib.sankey.Sankey.add"), which will create the first subdiagram.
See also
[`Sankey.add`](#matplotlib.sankey.Sankey.add "matplotlib.sankey.Sankey.add")
[`Sankey.finish`](#matplotlib.sankey.Sankey.finish "matplotlib.sankey.Sankey.finish")
#### Examples
([Source code](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics.py))
([png](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics_00_00.png))
([png](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics_00_01.png))
([png](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics_00_02.png))
add(*patchlabel=''*, *flows=None*, *orientations=None*, *labels=''*, *trunklength=1.0*, *pathlengths=0.25*, *prior=None*, *connect=(0, 0)*, *rotation=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sankey.py#L350-L779)
Add a simple Sankey diagram with flows at the same hierarchical level.
Parameters:
**patchlabel**str
Label to be placed at the center of the diagram. Note that *label* (not *patchlabel*) can be passed as keyword argument to create an entry in the legend.
**flows**list of float
Array of flow values. By convention, inputs are positive and outputs are negative.
Flows are placed along the top of the diagram from the inside out in order of their index within *flows*. They are placed along the sides of the diagram from the top down and along the bottom from the outside in.
If the sum of the inputs and outputs is nonzero, the discrepancy will appear as a cubic Bezier curve along the top and bottom edges of the trunk.
**orientations**list of {-1, 0, 1}
List of orientations of the flows (or a single orientation to be used for all flows). Valid values are 0 (inputs from the left, outputs to the right), 1 (from and to the top) or -1 (from and to the bottom).
**labels**list of (str or None)
List of labels for the flows (or a single label to be used for all flows). Each label may be *None* (no label), or a labeling string. If an entry is a (possibly empty) string, then the quantity for the corresponding flow will be shown below the string. However, if the *unit* of the main diagram is None, then quantities are never shown, regardless of the value of this argument.
**trunklength**float
Length between the bases of the input and output groups (in data-space units).
**pathlengths**list of float
List of lengths of the vertical arrows before break-in or after break-away. If a single value is given, then it will be applied to the first (inside) paths on the top and bottom, and the length of all other arrows will be justified accordingly. The *pathlengths* are not applied to the horizontal inputs and outputs.
**prior**int
Index of the prior diagram to which this diagram should be connected.
**connect**(int, int)
A (prior, this) tuple indexing the flow of the prior diagram and the flow of this diagram which should be connected. If this is the first diagram or *prior* is *None*, *connect* will be ignored.
**rotation**float
Angle of rotation of the diagram in degrees. The interpretation of the *orientations* argument will be rotated accordingly (e.g., if *rotation* == 90, an *orientations* entry of 1 means to/from the left). *rotation* is ignored if this diagram is connected to an existing one (using *prior* and *connect*).
Returns:
Sankey
The current [`Sankey`](#matplotlib.sankey.Sankey "matplotlib.sankey.Sankey") instance.
Other Parameters:
**\*\*kwargs**
Additional keyword arguments set [`matplotlib.patches.PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") properties, listed below. For example, one may want to use `fill=False` or `label="A legend entry"`.
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Sankey.finish`](#matplotlib.sankey.Sankey.finish "matplotlib.sankey.Sankey.finish")
finish()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sankey.py#L781-L825)
Adjust the axes and return a list of information about the Sankey subdiagram(s).
Return value is a list of subdiagrams represented with the following fields:
| Field | Description |
| --- | --- |
| *patch* | Sankey outline (an instance of [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch")) |
| *flows* | values of the flows (positive for input, negative for output) |
| *angles* | list of angles of the arrows [deg/90] For example, if the diagram has not been rotated, an input to the top side will have an angle of 3 (DOWN), and an output from the top side will have an angle of 1 (UP). If a flow has been skipped (because its magnitude is less than *tolerance*), then its angle will be *None*. |
| *tips* | array in which each row is an [x, y] pair indicating the positions of the tips (or "dips") of the flow paths If the magnitude of a flow is less the *tolerance* for the instance of [`Sankey`](#matplotlib.sankey.Sankey "matplotlib.sankey.Sankey"), the flow is skipped and its tip will be at the center of the diagram. |
| *text* | [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance for the label of the diagram |
| *texts* | list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instances for the labels of flows |
See also
[`Sankey.add`](#matplotlib.sankey.Sankey.add "matplotlib.sankey.Sankey.add")
| programming_docs |
matplotlib matplotlib.markers matplotlib.markers
==================
Functions to handle markers; used by the marker functionality of [`plot`](_as_gen/matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot"), [`scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter"), and [`errorbar`](_as_gen/matplotlib.axes.axes.errorbar#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar").
All possible markers are defined here:
| marker | symbol | description |
| --- | --- | --- |
| `"."` | | point |
| `","` | | pixel |
| `"o"` | | circle |
| `"v"` | | triangle\_down |
| `"^"` | | triangle\_up |
| `"<"` | | triangle\_left |
| `">"` | | triangle\_right |
| `"1"` | | tri\_down |
| `"2"` | | tri\_up |
| `"3"` | | tri\_left |
| `"4"` | | tri\_right |
| `"8"` | | octagon |
| `"s"` | | square |
| `"p"` | | pentagon |
| `"P"` | | plus (filled) |
| `"*"` | | star |
| `"h"` | | hexagon1 |
| `"H"` | | hexagon2 |
| `"+"` | | plus |
| `"x"` | | x |
| `"X"` | | x (filled) |
| `"D"` | | diamond |
| `"d"` | | thin\_diamond |
| `"|"` | | vline |
| `"_"` | | hline |
| `0` (`TICKLEFT`) | | tickleft |
| `1` (`TICKRIGHT`) | | tickright |
| `2` (`TICKUP`) | | tickup |
| `3` (`TICKDOWN`) | | tickdown |
| `4` (`CARETLEFT`) | | caretleft |
| `5` (`CARETRIGHT`) | | caretright |
| `6` (`CARETUP`) | | caretup |
| `7` (`CARETDOWN`) | | caretdown |
| `8` (`CARETLEFTBASE`) | | caretleft (centered at base) |
| `9` (`CARETRIGHTBASE`) | | caretright (centered at base) |
| `10` (`CARETUPBASE`) | | caretup (centered at base) |
| `11` (`CARETDOWNBASE`) | | caretdown (centered at base) |
| `"none"` or `"None"` | | nothing |
| `" "` or `""` | | nothing |
| `'$...$'` | | Render the string using mathtext. E.g `"$f$"` for marker showing the letter `f`. |
| `verts` | | A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0, 0) and the size is normalized, such that the created path is encapsulated inside the unit cell. |
| path | | A [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance. |
| `(numsides, 0, angle)` | | A regular polygon with `numsides` sides, rotated by `angle`. |
| `(numsides, 1, angle)` | | A star-like symbol with `numsides` sides, rotated by `angle`. |
| `(numsides, 2, angle)` | | An asterisk with `numsides` sides, rotated by `angle`. |
As a deprecated feature, `None` also means 'nothing' when directly constructing a [`MarkerStyle`](_as_gen/matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle"), but note that there are other contexts where `marker=None` instead means "the default marker" (e.g. `[rcParams["scatter.marker"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=scatter.marker#matplotlibrc-sample)` (default: `'o'`) for [`Axes.scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter")).
Note that special symbols can be defined via the [STIX math font](https://matplotlib.org/stable/tutorials/text/mathtext.html), e.g. `"$\u266B$"`. For an overview over the STIX font symbols refer to the [STIX font table](http://www.stixfonts.org/allGlyphs.html). Also see the [STIX Fonts](https://matplotlib.org/stable/gallery/text_labels_and_annotations/stix_fonts_demo.html).
Integer numbers from `0` to `11` create lines and triangles. Those are equally accessible via capitalized variables, like `CARETDOWNBASE`. Hence the following are equivalent:
```
plt.plot([1, 2, 3], marker=11)
plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE)
```
Markers join and cap styles can be customized by creating a new instance of MarkerStyle. A MarkerStyle can also have a custom [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") allowing it to be arbitrarily rotated or offset.
Examples showing the use of markers:
* [Marker reference](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html)
* [Marker examples](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_star_poly.html)
* [Mapping marker properties to multivariate data](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html)
Classes
-------
| | |
| --- | --- |
| [`MarkerStyle`](_as_gen/matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle")(marker[, fillstyle]) | A class representing marker types. |
matplotlib matplotlib.sphinxext.mathmpl matplotlib.sphinxext.mathmpl
============================
A role and directive to display mathtext in Sphinx
--------------------------------------------------
Warning
In most cases, you will likely want to use one of [Sphinx's builtin Math extensions](https://www.sphinx-doc.org/en/master/usage/extensions/math.html) instead of this one.
Mathtext may be included in two ways:
1. Inline, using the role:
```
This text uses inline math: :mathmpl:`\alpha > \beta`.
```
which produces:
This text uses inline math: .
2. Standalone, using the directive:
```
Here is some standalone math:
.. mathmpl::
\alpha > \beta
```
which produces:
Here is some standalone math:
### Options
The `mathmpl` role and directive both support the following options:
fontsetstr, default: 'cm'
The font set to use when displaying math. See `[rcParams["mathtext.fontset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=mathtext.fontset#matplotlibrc-sample)` (default: `'dejavusans'`).
fontsizefloat
The font size, in points. Defaults to the value from the extension configuration option defined below.
### Configuration options
The mathtext extension has the following configuration options:
mathmpl\_fontsizefloat, default: 10.0
Default font size, in points.
mathmpl\_srcsetlist of str, default: []
Additional image sizes to generate when embedding in HTML, to support [responsive resolution images](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images). The list should contain additional x-descriptors (`'1.5x'`, `'2x'`, etc.) to generate (1x is the default and always included.)
*class*matplotlib.sphinxext.mathmpl.MathDirective(*name*, *arguments*, *options*, *content*, *lineno*, *content\_offset*, *block\_text*, *state*, *state\_machine*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/mathmpl.py#L102-L120)
The `.. mathmpl::` directive, as documented in the module's docstring.
final\_argument\_whitespace*=False*
May the final argument contain whitespace?
has\_content*=True*
May the directive have content?
option\_spec*={'fontset': <function fontset\_choice>, 'fontsize': <function \_make\_type\_validator.<locals>.validate\_float\_or\_None>}*
Mapping of option names to validator functions.
optional\_arguments*=0*
Number of optional arguments after the required arguments.
required\_arguments*=0*
Number of required directive arguments.
matplotlib matplotlib.patheffects matplotlib.patheffects
======================
Defines classes for path effects. The path effects are supported in [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"), [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") and [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch").
See also
[Path effects guide](https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html)
*class*matplotlib.patheffects.AbstractPathEffect(*offset=(0.0, 0.0)*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L17-L68)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A base class for path effects.
Subclasses should override the `draw_path` method to add effect functionality.
Parameters:
**offset**(float, float), default: (0, 0)
The (x, y) offset to apply to the path, measured in points.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L59-L68)
Derived should override this method. The arguments are the same as [`matplotlib.backend_bases.RendererBase.draw_path()`](backend_bases_api#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path") except the first argument is a renderer.
*class*matplotlib.patheffects.Normal(*offset=(0.0, 0.0)*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L156-L162)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
The "identity" PathEffect.
The Normal PathEffect's sole purpose is to draw the original artist with no special path effect.
Parameters:
**offset**(float, float), default: (0, 0)
The (x, y) offset to apply to the path, measured in points.
*class*matplotlib.patheffects.PathEffectRenderer(*path\_effects*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L71-L153)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
Implements a Renderer which contains another renderer.
This proxy then intercepts draw calls, calling the appropriate [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") draw method.
Note
Not all methods have been overridden on this RendererBase subclass. It may be necessary to add further methods to extend the PathEffects capabilities further.
Parameters:
**path\_effects**iterable of [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
The path effects which this renderer represents.
**renderer**[`matplotlib.backend_bases.RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
copy\_with\_path\_effect(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L96-L97)
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L104-L120)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.patheffects.PathEffectRenderer.draw_path "matplotlib.patheffects.PathEffectRenderer.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_path(*gc*, *tpath*, *affine*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L99-L102)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_path\_collection(*gc*, *master\_transform*, *paths*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L122-L138)
Draw a collection of *paths*.
Each path is first transformed by the corresponding entry in *all\_transforms* (a list of (3, 3) matrices) and then by *master\_transform*. They are then translated by the corresponding entry in *offsets*, which has been first transformed by *offset\_trans*.
*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and *antialiased* are lists that set the corresponding properties.
*offset\_position* is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.patheffects.PathEffectRenderer.draw_path "matplotlib.patheffects.PathEffectRenderer.draw_path"). Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods `_iter_collection_raw_paths` and `_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of [`draw_path_collection`](#matplotlib.patheffects.PathEffectRenderer.draw_path_collection "matplotlib.patheffects.PathEffectRenderer.draw_path_collection") can be made globally.
*class*matplotlib.patheffects.PathPatchEffect(*offset=(0, 0)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L345-L373)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
Draws a [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") instance whose Path comes from the original PathEffect artist.
Parameters:
**offset**(float, float), default: (0, 0)
The (x, y) offset to apply to the path, in points.
**\*\*kwargs**
All keyword arguments are passed through to the [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") constructor. The properties which cannot be overridden are "path", "clip\_box" "transform" and "clip\_path".
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L366-L373)
Derived should override this method. The arguments are the same as [`matplotlib.backend_bases.RendererBase.draw_path()`](backend_bases_api#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path") except the first argument is a renderer.
*class*matplotlib.patheffects.SimpleLineShadow(*offset=(2, -2)*, *shadow\_color='k'*, *alpha=0.3*, *rho=0.3*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L288-L342)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
A simple shadow via a line.
Parameters:
**offset**(float, float), default: (2, -2)
The (x, y) offset to apply to the path, in points.
**shadow\_color**color, default: 'black'
The shadow color. A value of `None` takes the original artist's color with a scale factor of *rho*.
**alpha**float, default: 0.3
The alpha transparency of the created shadow patch.
**rho**float, default: 0.3
A scale factor to apply to the rgbFace color if *shadow\_color* is `None`.
**\*\*kwargs**
Extra keywords are stored and passed through to `AbstractPathEffect._update_gc()`.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L321-L342)
Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow.
*class*matplotlib.patheffects.SimplePatchShadow(*offset=(2, -2)*, *shadow\_rgbFace=None*, *alpha=None*, *rho=0.3*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L220-L282)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
A simple shadow via a filled patch.
Parameters:
**offset**(float, float), default: (2, -2)
The (x, y) offset of the shadow in points.
**shadow\_rgbFace**color
The shadow color.
**alpha**float, default: 0.3
The alpha transparency of the created shadow patch.
**rho**float, default: 0.3
A scale factor to apply to the rgbFace color if *shadow\_rgbFace* is not specified.
**\*\*kwargs**
Extra keywords are stored and passed through to `AbstractPathEffect._update_gc()`.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L259-L282)
Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow.
*class*matplotlib.patheffects.Stroke(*offset=(0, 0)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L195-L214)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
A line based PathEffect which re-draws a stroke.
The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L207-L214)
Draw the path with updated gc.
*class*matplotlib.patheffects.TickedStroke(*offset=(0, 0)*, *spacing=10.0*, *angle=45.0*, *length=1.4142135623730951*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L376-L513)
Bases: [`AbstractPathEffect`](#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
A line-based PathEffect which draws a path with a ticked style.
This line style is frequently used to represent constraints in optimization. The ticks may be used to indicate that one side of the line is invalid or to represent a closed boundary of a domain (i.e. a wall or the edge of a pipe).
The spacing, length, and angle of ticks can be controlled.
This line style is sometimes referred to as a hatched line.
See also the [contour demo example](https://matplotlib.org/stable/gallery/lines_bars_and_markers/lines_with_ticks_demo.html).
See also the [contours in optimization example](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html).
Parameters:
**offset**(float, float), default: (0, 0)
The (x, y) offset to apply to the path, in points.
**spacing**float, default: 10.0
The spacing between ticks in points.
**angle**float, default: 45.0
The angle between the path and the tick in degrees. The angle is measured as if you were an ant walking along the curve, with zero degrees pointing directly ahead, 90 to your left, -90 to your right, and 180 behind you.
**length**float, default: 1.414
The length of the tick relative to spacing. Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0 when angle=90 and length=2.0 when angle=60.
**\*\*kwargs**
Extra keywords are stored and passed through to `AbstractPathEffect._update_gc()`.
#### Examples
See [TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html).
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L430-L513)
Draw the path with updated gc.
*class*matplotlib.patheffects.withSimplePatchShadow(*offset=(2, -2)*, *shadow\_rgbFace=None*, *alpha=None*, *rho=0.3*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py)
Bases: [`SimplePatchShadow`](#matplotlib.patheffects.SimplePatchShadow "matplotlib.patheffects.SimplePatchShadow")
A shortcut PathEffect for applying [`SimplePatchShadow`](#matplotlib.patheffects.SimplePatchShadow "matplotlib.patheffects.SimplePatchShadow") and then drawing the original Artist.
With this class you can use
```
artist.set_path_effects([path_effects.withSimplePatchShadow()])
```
as a shortcut for
```
artist.set_path_effects([path_effects.SimplePatchShadow(),
path_effects.Normal()])
```
Parameters:
**offset**(float, float), default: (2, -2)
The (x, y) offset of the shadow in points.
**shadow\_rgbFace**color
The shadow color.
**alpha**float, default: 0.3
The alpha transparency of the created shadow patch.
**rho**float, default: 0.3
A scale factor to apply to the rgbFace color if *shadow\_rgbFace* is not specified.
**\*\*kwargs**
Extra keywords are stored and passed through to `AbstractPathEffect._update_gc()`.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L171-L173)
Overrides the standard draw\_path to add the shadow offset and necessary color changes for the shadow.
*class*matplotlib.patheffects.withStroke(*offset=(0, 0)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py)
Bases: [`Stroke`](#matplotlib.patheffects.Stroke "matplotlib.patheffects.Stroke")
A shortcut PathEffect for applying [`Stroke`](#matplotlib.patheffects.Stroke "matplotlib.patheffects.Stroke") and then drawing the original Artist.
With this class you can use
```
artist.set_path_effects([path_effects.withStroke()])
```
as a shortcut for
```
artist.set_path_effects([path_effects.Stroke(),
path_effects.Normal()])
```
The path will be stroked with its gc updated with the given keyword arguments, i.e., the keyword arguments should be valid gc parameter values.
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L171-L173)
Draw the path with updated gc.
*class*matplotlib.patheffects.withTickedStroke(*offset=(0, 0)*, *spacing=10.0*, *angle=45.0*, *length=1.4142135623730951*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py)
Bases: [`TickedStroke`](#matplotlib.patheffects.TickedStroke "matplotlib.patheffects.TickedStroke")
A shortcut PathEffect for applying [`TickedStroke`](#matplotlib.patheffects.TickedStroke "matplotlib.patheffects.TickedStroke") and then drawing the original Artist.
With this class you can use
```
artist.set_path_effects([path_effects.withTickedStroke()])
```
as a shortcut for
```
artist.set_path_effects([path_effects.TickedStroke(),
path_effects.Normal()])
```
Parameters:
**offset**(float, float), default: (0, 0)
The (x, y) offset to apply to the path, in points.
**spacing**float, default: 10.0
The spacing between ticks in points.
**angle**float, default: 45.0
The angle between the path and the tick in degrees. The angle is measured as if you were an ant walking along the curve, with zero degrees pointing directly ahead, 90 to your left, -90 to your right, and 180 behind you.
**length**float, default: 1.414
The length of the tick relative to spacing. Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0 when angle=90 and length=2.0 when angle=60.
**\*\*kwargs**
Extra keywords are stored and passed through to `AbstractPathEffect._update_gc()`.
#### Examples
See [TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html).
draw\_path(*renderer*, *gc*, *tpath*, *affine*, *rgbFace*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patheffects.py#L171-L173)
Draw the path with updated gc.
| programming_docs |
matplotlib backend_gtk3agg, backend_gtk3cairo backend\_gtk3agg, backend\_gtk3cairo
====================================
**NOTE** These backends are not documented here, to avoid adding a dependency to building the docs.
matplotlib matplotlib.tight_layout matplotlib.tight\_layout
========================
Attention
This module is considered internal.
Its use is deprecated and it will be removed in a future version.
Routines to adjust subplot params so that subplots are nicely fit in the figure. In doing so, only axis labels, tick labels, axes titles and offsetboxes that are anchored to axes are currently considered.
Internally, this module assumes that the margins (left margin, etc.) which are differences between `Axes.get_tightbbox` and `Axes.bbox` are independent of Axes position. This may fail if `Axes.adjustable` is `datalim` as well as such cases as when left or right margin are affected by xlabel.
matplotlib.\_tight\_layout.auto\_adjust\_subplotpars(*fig*, *renderer*, *nrows\_ncols*, *num1num2\_list*, *subplot\_list*, *ax\_bbox\_list=None*, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_tight_layout.py#L160-L199)
[*Deprecated*] Return a dict of subplot parameters to adjust spacing between subplots or `None` if resulting axes would have zero height or width.
Note that this function ignores geometry information of subplot itself, but uses what is given by the *nrows\_ncols* and *num1num2\_list* parameters. Also, the results could be incorrect if some subplots have `adjustable=datalim`.
Parameters:
**nrows\_ncols**tuple[int, int]
Number of rows and number of columns of the grid.
**num1num2\_list**list[tuple[int, int]]
List of numbers specifying the area occupied by the subplot
**subplot\_list**list of subplots
List of subplots that will be used to calculate optimal subplot\_params.
**pad**float
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
**h\_pad, w\_pad**float
Padding (height/width) between edges of adjacent subplots, as a fraction of the font size. Defaults to *pad*.
**rect**tuple
(left, bottom, right, top), default: None.
#### Notes
Deprecated since version 3.5.
matplotlib.\_tight\_layout.get\_subplotspec\_list(*axes\_list*, *grid\_spec=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_tight_layout.py#L202-L233)
Return a list of subplotspec from the given list of axes.
For an instance of axes that does not support subplotspec, None is inserted in the list.
If grid\_spec is given, None is inserted for those not from the given grid\_spec.
matplotlib.\_tight\_layout.get\_tight\_layout\_figure(*fig*, *axes\_list*, *subplotspec\_list*, *renderer*, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_tight_layout.py#L236-L340)
Return subplot parameters for tight-layouted-figure with specified padding.
Parameters:
**fig**Figure
**axes\_list**list of Axes
**subplotspec\_list**list of [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")
The subplotspecs of each axes.
**renderer**renderer
**pad**float
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
**h\_pad, w\_pad**float
Padding (height/width) between edges of adjacent subplots. Defaults to *pad*.
**rect**tuple (left, bottom, right, top), default: None.
rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Defaults to using the entire figure.
Returns:
subplotspec or None
subplotspec kwargs to be passed to [`Figure.subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust") or None if tight\_layout could not be accomplished.
matplotlib matplotlib.path matplotlib.path
===============
A module for dealing with the polylines used throughout Matplotlib.
The primary class for polyline handling in Matplotlib is [`Path`](#matplotlib.path.Path "matplotlib.path.Path"). Almost all vector drawing makes use of [`Path`](#matplotlib.path.Path "matplotlib.path.Path")s somewhere in the drawing pipeline.
Whilst a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") instance itself cannot be drawn, some [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") subclasses, such as [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") and [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection"), can be used for convenient [`Path`](#matplotlib.path.Path "matplotlib.path.Path") visualisation.
*class*matplotlib.path.Path(*vertices*, *codes=None*, *\_interpolation\_steps=1*, *closed=False*, *readonly=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L24-L1047)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A series of possibly disconnected, possibly closed, line and curve segments.
The underlying storage is made up of two parallel numpy arrays:
* *vertices*: an Nx2 float array of vertices
* *codes*: an N-length uint8 array of path codes, or None
These two arrays always have the same length in the first dimension. For example, to represent a cubic curve, you must provide three vertices and three `CURVE4` codes.
The code types are:
* `STOP`1 vertex (ignored)
A marker for the end of the entire path (currently not required and ignored)
* `MOVETO`1 vertex
Pick up the pen and move to the given vertex.
* `LINETO`1 vertex
Draw a line from the current position to the given vertex.
* `CURVE3`1 control point, 1 endpoint
Draw a quadratic Bezier curve from the current position, with the given control point, to the given end point.
* `CURVE4`2 control points, 1 endpoint
Draw a cubic Bezier curve from the current position, with the given control points, to the given end point.
* `CLOSEPOLY`1 vertex (ignored)
Draw a line segment to the start point of the current polyline.
If *codes* is None, it is interpreted as a `MOVETO` followed by a series of `LINETO`.
Users of Path objects should not access the vertices and codes arrays directly. Instead, they should use [`iter_segments`](#matplotlib.path.Path.iter_segments "matplotlib.path.Path.iter_segments") or [`cleaned`](#matplotlib.path.Path.cleaned "matplotlib.path.Path.cleaned") to get the vertex/code pairs. This helps, in particular, to consistently handle the case of *codes* being None.
Some behavior of Path objects can be controlled by rcParams. See the rcParams whose keys start with 'path.'.
Note
The vertices and codes arrays should be treated as immutable -- there are a number of optimizations and assumptions made up front in the constructor that will not change when the data changes.
Create a new path with the given vertices and codes.
Parameters:
**vertices**(N, 2) array-like
The path vertices, as an array, masked array or sequence of pairs. Masked values, if any, will be converted to NaNs, which are then handled correctly by the Agg PathIterator and other consumers of path data, such as [`iter_segments()`](#matplotlib.path.Path.iter_segments "matplotlib.path.Path.iter_segments").
**codes**array-like or None, optional
N-length array of integers representing the codes of the path. If not None, codes must be the same length as vertices. If None, *vertices* will be treated as a series of line segments.
**\_interpolation\_steps**int, optional
Used as a hint to certain projections, such as Polar, that this path should be linearly interpolated immediately before drawing. This attribute is primarily an implementation detail and is not intended for public use.
**closed**bool, optional
If *codes* is None and closed is True, vertices will be treated as line segments of a closed polygon. Note that the last vertex will then be ignored (as the corresponding code will be set to CLOSEPOLY).
**readonly**bool, optional
Makes the path behave in an immutable way and sets the vertices and codes as read-only arrays.
CLOSEPOLY*=79*
CURVE3*=3*
CURVE4*=4*
LINETO*=2*
MOVETO*=1*
NUM\_VERTICES\_FOR\_CODE*={0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 79: 1}*
A dictionary mapping Path codes to the number of vertices that the code expects.
STOP*=0*
*classmethod*arc(*theta1*, *theta2*, *n=None*, *is\_wedge=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L925-L1002)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") for the unit circle arc from angles *theta1* to *theta2* (in degrees).
*theta2* is unwrapped to produce the shortest arc within 360 degrees. That is, if *theta2* > *theta1* + 360, the arc will be from *theta1* to *theta2* - 360 and not a full circle plus some extra overlap.
If *n* is provided, it is the number of spline segments to make. If *n* is not provided, the number of spline segments is determined based on the delta between *theta1* and *theta2*.
Masionobe, L. 2003. [Drawing an elliptical arc using polylines, quadratic or cubic Bezier curves](http://www.spaceroots.org/documents/ellipse/index.html).
*classmethod*circle(*center=(0.0, 0.0)*, *radius=1.0*, *readonly=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L813-L879)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") representing a circle of a given radius and center.
Parameters:
**center**(float, float), default: (0, 0)
The center of the circle.
**radius**float, default: 1
The radius of the circle.
**readonly**bool
Whether the created path should have the "readonly" argument set when creating the Path instance.
#### Notes
The circle is approximated using 8 cubic Bezier curves, as described in
Lancaster, Don. [Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines](https://www.tinaja.com/glib/ellipse4.pdf).
cleaned(*transform=None*, *remove\_nans=False*, *clip=None*, *\**, *simplify=False*, *curves=False*, *stroke\_width=1.0*, *snap=False*, *sketch=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L467-L484)
Return a new Path with vertices and codes cleaned according to the parameters.
See also
[`Path.iter_segments`](#matplotlib.path.Path.iter_segments "matplotlib.path.Path.iter_segments")
for details of the keyword arguments.
clip\_to\_bbox(*bbox*, *inside=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L1034-L1047)
Clip the path to the given bounding box.
The path must be made up of one or more closed polygons. This algorithm will not behave correctly for unclosed paths.
If *inside* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), clip to the inside of the box, otherwise to the outside of the box.
code\_type
alias of `uint8`
*property*codes
The list of codes in the [`Path`](#matplotlib.path.Path "matplotlib.path.Path") as a 1D numpy array. Each code is one of [`STOP`](#matplotlib.path.Path.STOP "matplotlib.path.Path.STOP"), [`MOVETO`](#matplotlib.path.Path.MOVETO "matplotlib.path.Path.MOVETO"), [`LINETO`](#matplotlib.path.Path.LINETO "matplotlib.path.Path.LINETO"), [`CURVE3`](#matplotlib.path.Path.CURVE3 "matplotlib.path.Path.CURVE3"), [`CURVE4`](#matplotlib.path.Path.CURVE4 "matplotlib.path.Path.CURVE4") or [`CLOSEPOLY`](#matplotlib.path.Path.CLOSEPOLY "matplotlib.path.Path.CLOSEPOLY"). For codes that correspond to more than one vertex ([`CURVE3`](#matplotlib.path.Path.CURVE3 "matplotlib.path.Path.CURVE3") and [`CURVE4`](#matplotlib.path.Path.CURVE4 "matplotlib.path.Path.CURVE4")), that code will be repeated so that the length of [`vertices`](#matplotlib.path.Path.vertices "matplotlib.path.Path.vertices") and [`codes`](#matplotlib.path.Path.codes "matplotlib.path.Path.codes") is always the same.
contains\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L593-L602)
Return whether this (closed) path completely contains the given path.
If *transform* is not `None`, the path will be transformed before checking for containment.
contains\_point(*point*, *transform=None*, *radius=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L499-L547)
Return whether the area enclosed by the path contains the given point.
The path is always treated as closed; i.e. if the last code is not CLOSEPOLY an implicit segment connecting the last vertex to the first vertex is assumed.
Parameters:
**point**(float, float)
The point (x, y) to check.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
If not `None`, *point* will be compared to `self` transformed by *transform*; i.e. for a correct check, *transform* should transform the path into the coordinate system of *point*.
**radius**float, default: 0
Add an additional margin on the path in coordinates of *point*. The path is extended tangentially by *radius/2*; i.e. if you would draw the path with a linewidth of *radius*, all points on the line would still be considered to be contained in the area. Conversely, negative values shrink the area: Points on the imaginary line will be considered outside the area.
Returns:
bool
#### Notes
The current algorithm has some limitations:
* The result is undefined for points exactly at the boundary (i.e. at the path shifted by *radius/2*).
* The result is undefined if there is no enclosed area, i.e. all vertices are on a straight line.
* If bounding lines start to cross each other due to *radius* shift, the result is not guaranteed to be correct.
contains\_points(*points*, *transform=None*, *radius=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L549-L591)
Return whether the area enclosed by the path contains the given points.
The path is always treated as closed; i.e. if the last code is not CLOSEPOLY an implicit segment connecting the last vertex to the first vertex is assumed.
Parameters:
**points**(N, 2) array
The points to check. Columns contain x and y values.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
If not `None`, *points* will be compared to `self` transformed by *transform*; i.e. for a correct check, *transform* should transform the path into the coordinate system of *points*.
**radius**float, default: 0
Add an additional margin on the path in coordinates of *points*. The path is extended tangentially by *radius/2*; i.e. if you would draw the path with a linewidth of *radius*, all points on the line would still be considered to be contained in the area. Conversely, negative values shrink the area: Points on the imaginary line will be considered outside the area.
Returns:
length-N bool array
#### Notes
The current algorithm has some limitations:
* The result is undefined for points exactly at the boundary (i.e. at the path shifted by *radius/2*).
* The result is undefined if there is no enclosed area, i.e. all vertices are on a straight line.
* If bounding lines start to cross each other due to *radius* shift, the result is not guaranteed to be correct.
copy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L274-L279)
Return a shallow copy of the [`Path`](#matplotlib.path.Path "matplotlib.path.Path"), which will share the vertices and codes with the source [`Path`](#matplotlib.path.Path "matplotlib.path.Path").
deepcopy(*memo=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L281-L289)
Return a deepcopy of the [`Path`](#matplotlib.path.Path "matplotlib.path.Path"). The [`Path`](#matplotlib.path.Path "matplotlib.path.Path") will not be readonly, even if the source [`Path`](#matplotlib.path.Path "matplotlib.path.Path") is.
get\_extents(*transform=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L604-L643)
Get Bbox of the path.
Parameters:
**transform**matplotlib.transforms.Transform, optional
Transform to apply to path before computing extents, if any.
**\*\*kwargs**
Forwarded to [`iter_bezier`](#matplotlib.path.Path.iter_bezier "matplotlib.path.Path.iter_bezier").
Returns:
matplotlib.transforms.Bbox
The extents of the path Bbox([[xmin, ymin], [xmax, ymax]])
*static*hatch(*hatchpattern*, *density=6*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L1022-L1032)
Given a hatch specifier, *hatchpattern*, generates a Path that can be used in a repeated hatching pattern. *density* is the number of lines per unit square.
interpolated(*steps*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L666-L683)
Return a new path resampled to length N x steps.
Codes other than LINETO are not handled correctly.
intersects\_bbox(*bbox*, *filled=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L654-L664)
Return whether this path intersects a given [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
If *filled* is True, then this also returns True if the path completely encloses the [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") (i.e., the path is treated as filled).
The bounding box is always considered filled.
intersects\_path(*other*, *filled=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L645-L652)
Return whether if this path intersects another given path.
If *filled* is True, then this also returns True if one path completely encloses the other (i.e., the paths are treated as filled).
iter\_bezier(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L420-L465)
Iterate over each bezier curve (lines included) in a Path.
Parameters:
**\*\*kwargs**
Forwarded to [`iter_segments`](#matplotlib.path.Path.iter_segments "matplotlib.path.Path.iter_segments").
Yields:
**B**matplotlib.bezier.BezierSegment
The bezier curves that make up the current path. Note in particular that freestanding points are bezier curves of order 0, and lines are bezier curves of order 1 (with two control points).
**code**Path.code\_type
The code describing what kind of curve is being returned. Path.MOVETO, Path.LINETO, Path.CURVE3, Path.CURVE4 correspond to bezier curves with 1, 2, 3, and 4 control points (respectively). Path.CLOSEPOLY is a Path.LINETO with the control points correctly chosen based on the start/end points of the current stroke.
iter\_segments(*transform=None*, *remove\_nans=True*, *clip=None*, *snap=False*, *stroke\_width=1.0*, *simplify=None*, *curves=True*, *sketch=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L354-L418)
Iterate over all curve segments in the path.
Each iteration returns a pair `(vertices, code)`, where `vertices` is a sequence of 1-3 coordinate pairs, and `code` is a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") code.
Additionally, this method can provide a number of standard cleanups and conversions to the path.
Parameters:
**transform**None or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
If not None, the given affine transformation will be applied to the path.
**remove\_nans**bool, optional
Whether to remove all NaNs from the path and skip over them using MOVETO commands.
**clip**None or (float, float, float, float), optional
If not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path.
**snap**None or bool, optional
If True, snap all nodes to pixels; if False, don't snap them. If None, snap if the path contains only segments parallel to the x or y axes, and no more than 1024 of them.
**stroke\_width**float, optional
The width of the stroke being drawn (used for path snapping).
**simplify**None or bool, optional
Whether to simplify the path by removing vertices that do not affect its appearance. If None, use the [`should_simplify`](#matplotlib.path.Path.should_simplify "matplotlib.path.Path.should_simplify") attribute. See also `[rcParams["path.simplify"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=path.simplify#matplotlibrc-sample)` (default: `True`) and `[rcParams["path.simplify\_threshold"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=path.simplify_threshold#matplotlibrc-sample)` (default: `0.111111111111`).
**curves**bool, optional
If True, curve segments will be returned as curve segments. If False, all curves will be converted to line segments.
**sketch**None or sequence, optional
If not None, must be a 3-tuple of the form (scale, length, randomness), representing the sketch parameters.
*classmethod*make\_compound\_path(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L322-L346)
Make a compound path from a list of [`Path`](#matplotlib.path.Path "matplotlib.path.Path") objects. Blindly removes all [`Path.STOP`](#matplotlib.path.Path.STOP "matplotlib.path.Path.STOP") control points.
*classmethod*make\_compound\_path\_from\_polys(*XY*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L293-L320)
Make a compound path object to draw a number of polygons with equal numbers of sides XY is a (numpolys x numsides x 2) numpy array of vertices. Return object is a [`Path`](#matplotlib.path.Path "matplotlib.path.Path").
([Source code](https://matplotlib.org/stable/gallery/misc/histogram_path.py), [png](https://matplotlib.org/stable/gallery/misc/histogram_path_00_00.png))
*property*readonly
[`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") if the [`Path`](#matplotlib.path.Path "matplotlib.path.Path") is read-only.
*property*should\_simplify
[`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") if the vertices array should be simplified.
*property*simplify\_threshold
The fraction of a pixel difference below which vertices will be simplified out.
to\_polygons(*transform=None*, *width=0*, *height=0*, *closed\_only=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L685-L727)
Convert this path to a list of polygons or polylines. Each polygon/polyline is an Nx2 array of vertices. In other words, each polygon has no `MOVETO` instructions or curves. This is useful for displaying in backends that do not support compound paths or Bezier curves.
If *width* and *height* are both non-zero then the lines will be simplified so that vertices outside of (0, 0), (width, height) will be clipped.
If *closed\_only* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") (default), only closed polygons, with the last point being the same as the first point, will be returned. Any unclosed polylines in the path will be explicitly closed. If *closed\_only* is [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)"), any unclosed polygons in the path will be returned as unclosed polygons, and the closed polygons will be returned explicitly closed by setting the last point to the same as the first point.
transformed(*transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L486-L497)
Return a transformed copy of the path.
See also
[`matplotlib.transforms.TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath")
A specialized path class that will cache the transformed result and automatically update when the transform changes.
*classmethod*unit\_circle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L801-L811)
Return the readonly [`Path`](#matplotlib.path.Path "matplotlib.path.Path") of the unit circle.
For most cases, [`Path.circle()`](#matplotlib.path.Path.circle "matplotlib.path.Path.circle") will be what you want.
*classmethod*unit\_circle\_righthalf()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L883-L923)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") of the right half of a unit circle.
See [`Path.circle`](#matplotlib.path.Path.circle "matplotlib.path.Path.circle") for the reference on the approximation used.
*classmethod*unit\_rectangle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L731-L739)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") instance of the unit rectangle from (0, 0) to (1, 1).
*classmethod*unit\_regular\_asterisk(*numVertices*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L791-L797)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") for a unit regular asterisk with the given numVertices and radius of 1.0, centered at (0, 0).
*classmethod*unit\_regular\_polygon(*numVertices*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L743-L763)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") instance for a unit regular polygon with the given *numVertices* such that the circumscribing circle has radius 1.0, centered at (0, 0).
*classmethod*unit\_regular\_star(*numVertices*, *innerCircle=0.5*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L767-L789)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") for a unit regular star with the given numVertices and radius of 1.0, centered at (0, 0).
*property*vertices
The list of vertices in the [`Path`](#matplotlib.path.Path "matplotlib.path.Path") as an Nx2 numpy array.
*classmethod*wedge(*theta1*, *theta2*, *n=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L1004-L1020)
Return a [`Path`](#matplotlib.path.Path "matplotlib.path.Path") for the unit circle wedge from angles *theta1* to *theta2* (in degrees).
*theta2* is unwrapped to produce the shortest wedge within 360 degrees. That is, if *theta2* > *theta1* + 360, the wedge will be from *theta1* to *theta2* - 360 and not a full circle plus some extra overlap.
If *n* is provided, it is the number of spline segments to make. If *n* is not provided, the number of spline segments is determined based on the delta between *theta1* and *theta2*.
See [`Path.arc`](#matplotlib.path.Path.arc "matplotlib.path.Path.arc") for the reference on the approximation used.
matplotlib.path.get\_path\_collection\_extents(*master\_transform*, *paths*, *transforms*, *offsets*, *offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/path.py#L1050-L1082)
Given a sequence of [`Path`](#matplotlib.path.Path "matplotlib.path.Path")s, [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")s objects, and offsets, as found in a [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection"), returns the bounding box that encapsulates all of them.
Parameters:
**master\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Global transformation applied to all paths.
**paths**list of [`Path`](#matplotlib.path.Path "matplotlib.path.Path")
**transforms**list of [`Affine2D`](transformations#matplotlib.transforms.Affine2D "matplotlib.transforms.Affine2D")
**offsets**(N, 2) array-like
**offset\_transform**[`Affine2D`](transformations#matplotlib.transforms.Affine2D "matplotlib.transforms.Affine2D")
Transform applied to the offsets before offsetting the path.
#### Notes
The way that *paths*, *transforms* and *offsets* are combined follows the same method as for collections: Each is iterated over independently, so if you have 3 paths, 2 transforms and 1 offset, their combinations are as follows:
(A, A, A), (B, B, A), (C, A, A)
| programming_docs |
matplotlib backend_qtagg, backend_qtcairo backend\_qtagg, backend\_qtcairo
================================
**NOTE** These backends are not (auto) documented here, to avoid adding a dependency to building the docs.
Qt Bindings
-----------
There are currently 2 actively supported Qt versions, Qt5 and Qt6, and two supported Python bindings per version -- [PyQt5](https://www.riverbankcomputing.com/static/Docs/PyQt5/) and [PySide2](https://doc.qt.io/qtforpython-5/contents.html) for Qt5 and [PyQt6](https://www.riverbankcomputing.com/static/Docs/PyQt6/) and [PySide6](https://doc.qt.io/qtforpython/contents.html) for Qt6 [[1]](#id5). While both PyQt and Qt for Python (aka PySide) closely mirror the underlying C++ API they are wrapping, they are not drop-in replacements for each other [[2]](#id6). To account for this, Matplotlib has an internal API compatibility layer in [`matplotlib.backends.qt_compat`](#module-matplotlib.backends.qt_compat "matplotlib.backends.qt_compat") which covers our needs. Despite being a public module, we do not consider this to be a stable user-facing API and it may change without warning [[3]](#id7).
Previously Matplotlib's Qt backends had the Qt version number in the name, both in the module and the `[rcParams["backend"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=backend#matplotlibrc-sample)` value (e.g. `matplotlib.backends.backend_qt4agg` and `matplotlib.backends.backend_qt5agg`). However as part of adding support for Qt6 we were able to support both Qt5 and Qt6 with a single implementation with all of the Qt version and binding support handled in [`qt_compat`](#module-matplotlib.backends.qt_compat "matplotlib.backends.qt_compat"). A majority of the renderer agnostic Qt code is now in [`matplotlib.backends.backend_qt`](#module-matplotlib.backends.backend_qt "matplotlib.backends.backend_qt") with specialization for AGG in `backend_qtagg` and cairo in `backend_qtcairo`.
The binding is selected at run time based on what bindings are already imported (by checking for the `QtCore` sub-package), then by the [`QT_API`](https://matplotlib.org/stable/users/faq/environment_variables_faq.html#envvar-QT_API) environment variable, and finally by the `[rcParams["backend"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=backend#matplotlibrc-sample)`. In all cases when we need to search, the order is `PyQt6`, `PySide6`, `PyQt5`, `PySide2`. See [How do I select the Qt implementation?](https://matplotlib.org/stable/users/explain/backends.html#qt-api-usage) for usage instructions.
The `backend_qt5`, `backend_qt5agg`, and `backend_qt5cairo` are provided and force the use of a Qt5 binding for backwards compatibility. Their use is discouraged (but not deprecated) and `backend_qt`, `backend_qtagg`, or `backend_qtcairo` should be preferred instead. However, these modules will not be deprecated until we drop support for Qt5.
matplotlib matplotlib.rcsetup matplotlib.rcsetup
==================
The rcsetup module contains the validation code for customization using Matplotlib's rc settings.
Each rc setting is assigned a function used to validate any attempted changes to that setting. The validation functions are defined in the rcsetup module, and are used to construct the rcParams global object which stores the settings and is referenced throughout Matplotlib.
The default values of the rc settings are set in the default matplotlibrc file. Any additions or deletions to the parameter set listed here should also be propagated to the `matplotlibrc.template` in Matplotlib's root source directory.
*class*matplotlib.rcsetup.ValidateInStrings(*key*, *valid*, *ignorecase=False*, *\**, *\_deprecated\_since=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L51-L82)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
*valid* is a list of legal strings.
matplotlib.rcsetup.cycler(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L632-L714)
Create a [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") object much like [`cycler.cycler()`](https://matplotlib.org/cycler/generated/cycler.cycler.html#cycler.cycler "(in cycler v0.11.0)"), but includes input validation.
Call signatures:
```
cycler(cycler)
cycler(label=values[, label2=values2[, ...]])
cycler(label, values)
```
Form 1 copies a given [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") object.
Form 2 creates a [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") which cycles over one or more properties simultaneously. If multiple properties are given, their value lists must have the same length.
Form 3 creates a [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") for a single property. This form exists for compatibility with the original cycler. Its use is discouraged in favor of the kwarg form, i.e. `cycler(label=values)`.
Parameters:
**cycler**Cycler
Copy constructor for Cycler.
**label**str
The property key. Must be a valid [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") property. For example, 'color' or 'linestyle'. Aliases are allowed, such as 'c' for 'color' and 'lw' for 'linewidth'.
**values**iterable
Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid.
Returns:
Cycler
A new [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") for the given properties.
#### Examples
Creating a cycler for a single property:
```
>>> c = cycler(color=['red', 'green', 'blue'])
```
Creating a cycler for simultaneously cycling over multiple properties (e.g. red circle, green plus, blue cross):
```
>>> c = cycler(color=['red', 'green', 'blue'],
... marker=['o', '+', 'x'])
```
matplotlib.rcsetup.validate\_any(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L126-L127)
matplotlib.rcsetup.validate\_anylist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
matplotlib.rcsetup.validate\_aspect(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L344-L350)
matplotlib.rcsetup.validate\_axisbelow(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L152-L160)
matplotlib.rcsetup.validate\_backend(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L252-L256)
matplotlib.rcsetup.validate\_bbox(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L533-L544)
matplotlib.rcsetup.validate\_bool(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L140-L149)
Convert b to `bool` or raise.
matplotlib.rcsetup.validate\_color(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L310-L332)
Return a valid color arg.
matplotlib.rcsetup.validate\_color\_for\_prop\_cycle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L282-L286)
matplotlib.rcsetup.validate\_color\_or\_auto(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L276-L279)
matplotlib.rcsetup.validate\_color\_or\_inherit(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L269-L273)
Return a valid color arg.
matplotlib.rcsetup.validate\_colorlist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
return a list of colorspecs
matplotlib.rcsetup.validate\_cycler(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L724-L780)
Return a Cycler object from a string repr or the object itself.
matplotlib.rcsetup.validate\_dashlist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
return a list of floats
matplotlib.rcsetup.validate\_dpi(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L163-L171)
Confirm s is string 'figure' or convert s to float or raise.
matplotlib.rcsetup.validate\_fillstylelist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
matplotlib.rcsetup.validate\_float(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_float\_or\_None(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_floatlist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
return a list of floats
matplotlib.rcsetup.validate\_font\_properties(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L404-L406)
matplotlib.rcsetup.validate\_fontsize(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L360-L371)
matplotlib.rcsetup.validate\_fontsize\_None(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L353-L357)
matplotlib.rcsetup.validate\_fontsizelist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
matplotlib.rcsetup.validate\_fontstretch(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L390-L401)
matplotlib.rcsetup.validate\_fonttype(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L224-L244)
Confirm that this is a Postscript or PDF font type that we know how to convert to.
matplotlib.rcsetup.validate\_fontweight(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L377-L387)
matplotlib.rcsetup.validate\_hatch(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L580-L592)
Validate a hatch pattern. A hatch pattern string can have any sequence of the following characters: `\ / | - + * . x o O`.
matplotlib.rcsetup.validate\_hatchlist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
Validate a hatch pattern. A hatch pattern string can have any sequence of the following characters: `\ / | - + * . x o O`.
matplotlib.rcsetup.validate\_hist\_bins(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L783-L796)
matplotlib.rcsetup.validate\_int(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_int\_or\_None(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_markevery(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L496-L527)
Validate the markevery property of a Line2D object.
Parameters:
**s**None, int, (int, int), slice, float, (float, float), or list[int]
Returns:
None, int, (int, int), slice, float, (float, float), or list[int]
matplotlib.rcsetup.validate\_markeverylist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
Validate the markevery property of a Line2D object.
Parameters:
**s**None, int, (int, int), slice, float, (float, float), or list[int]
Returns:
None, int, (int, int), slice, float, (float, float), or list[int]
matplotlib.rcsetup.validate\_ps\_distiller(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L435-L441)
matplotlib.rcsetup.validate\_sketch(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L547-L555)
matplotlib.rcsetup.validate\_string(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_string\_or\_None(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L180-L193)
matplotlib.rcsetup.validate\_stringlist(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L88-L115)
return a list of strings
matplotlib.rcsetup.validate\_whiskers(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/rcsetup.py#L424-L432)
matplotlib matplotlib.cbook matplotlib.cbook
================
A collection of utility functions and classes. Originally, many (but not all) were from the Python Cookbook -- hence the name cbook.
This module is safe to import from anywhere within Matplotlib; it imports Matplotlib only at runtime.
*class*matplotlib.cbook.CallbackRegistry(*exception\_handler=<function \_exception\_printer>*, *\**, *signals=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L129-L339)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Handle registering, processing, blocking, and disconnecting for a set of signals and callbacks:
```
>>> def oneat(x):
... print('eat', x)
>>> def ondrink(x):
... print('drink', x)
```
```
>>> from matplotlib.cbook import CallbackRegistry
>>> callbacks = CallbackRegistry()
```
```
>>> id_eat = callbacks.connect('eat', oneat)
>>> id_drink = callbacks.connect('drink', ondrink)
```
```
>>> callbacks.process('drink', 123)
drink 123
>>> callbacks.process('eat', 456)
eat 456
>>> callbacks.process('be merry', 456) # nothing will be called
```
```
>>> callbacks.disconnect(id_eat)
>>> callbacks.process('eat', 456) # nothing will be called
```
```
>>> with callbacks.blocked(signal='drink'):
... callbacks.process('drink', 123) # nothing will be called
>>> callbacks.process('drink', 123)
drink 123
```
In practice, one should always disconnect all callbacks when they are no longer needed to avoid dangling references (and thus memory leaks). However, real code in Matplotlib rarely does so, and due to its design, it is rather difficult to place this kind of code. To get around this, and prevent this class of memory leaks, we instead store weak references to bound methods only, so when the destination object needs to die, the CallbackRegistry won't keep it alive.
Parameters:
**exception\_handler**callable, optional
If not None, *exception\_handler* must be a function that takes an [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.10)") as single parameter. It gets called with any [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.10)") raised by the callbacks during [`CallbackRegistry.process`](#matplotlib.cbook.CallbackRegistry.process "matplotlib.cbook.CallbackRegistry.process"), and may either re-raise the exception or handle it in another manner.
The default handler prints the exception (with [`traceback.print_exc`](https://docs.python.org/3/library/traceback.html#traceback.print_exc "(in Python v3.10)")) if an interactive event loop is running; it re-raises the exception if no interactive event loop is running.
**signals**list, optional
If not None, *signals* is a list of signals that this registry handles: attempting to [`process`](#matplotlib.cbook.CallbackRegistry.process "matplotlib.cbook.CallbackRegistry.process") or to [`connect`](#matplotlib.cbook.CallbackRegistry.connect "matplotlib.cbook.CallbackRegistry.connect") to a signal not in the list throws a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)"). The default, None, does not restrict the handled signals.
blocked(*\**, *signal=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L316-L339)
Block callback signals from being processed.
A context manager to temporarily block/disable callback signals from being processed by the registered listeners.
Parameters:
**signal**str, optional
The callback signal to block. The default is to block all signals.
connect(*signal*, *func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L221-L236)
Register *func* to be called when signal *signal* is generated.
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L268-L292)
Disconnect the callback registered with callback id *cid*.
No error is raised if such a callback does not exist.
process(*s*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L294-L314)
Process signal *s*.
All of the functions registered to receive callbacks on *s* will be called with `*args` and `**kwargs`.
*class*matplotlib.cbook.Grouper(*init=()*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L825-L918)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A disjoint-set data structure.
Objects can be joined using [`join()`](#matplotlib.cbook.Grouper.join "matplotlib.cbook.Grouper.join"), tested for connectedness using [`joined()`](#matplotlib.cbook.Grouper.joined "matplotlib.cbook.Grouper.joined"), and all disjoint sets can be retrieved by using the object as an iterator.
The objects being joined must be hashable and weak-referenceable.
#### Examples
```
>>> from matplotlib.cbook import Grouper
>>> class Foo:
... def __init__(self, s):
... self.s = s
... def __repr__(self):
... return self.s
...
>>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef']
>>> grp = Grouper()
>>> grp.join(a, b)
>>> grp.join(b, c)
>>> grp.join(d, e)
>>> list(grp)
[[a, b, c], [d, e]]
>>> grp.joined(a, b)
True
>>> grp.joined(a, c)
True
>>> grp.joined(a, d)
False
```
clean()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L865-L871)
Clean dead weak references from the dictionary.
get\_siblings(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L914-L918)
Return all of the items joined with *a*, including itself.
join(*a*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L873-L889)
Join given arguments into the same set. Accepts one or more arguments.
joined(*a*, *b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L891-L895)
Return whether *a* and *b* are members of the same set.
remove(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L897-L901)
*class*matplotlib.cbook.GrouperView(*grouper*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L921-L946)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Immutable view over a [`Grouper`](#matplotlib.cbook.Grouper "matplotlib.cbook.Grouper").
clean()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L865-L871)
[*Deprecated*] Clean dead weak references from the dictionary.
#### Notes
Deprecated since version 3.6.
get\_siblings(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L914-L918)
Return all of the items joined with *a*, including itself.
join(*a*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L873-L889)
[*Deprecated*] Join given arguments into the same set. Accepts one or more arguments.
#### Notes
Deprecated since version 3.6.
joined(*a*, *b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L891-L895)
Return whether *a* and *b* are members of the same set.
remove(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L897-L901)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
*class*matplotlib.cbook.Stack(*default=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L605-L708)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Stack of elements with a movable cursor.
Mimics home/back/forward in a web browser.
back()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L634-L638)
Move the position back and return the current element.
bubble(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L670-L691)
Raise all references of *o* to the top of the stack, and return it.
Raises:
ValueError
If *o* is not in the stack.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L665-L668)
Empty the stack.
empty()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L661-L663)
Return whether the stack is empty.
forward()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L629-L632)
Move the position forward and return the current element.
home()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L650-L659)
Push the first element onto the top of the stack.
The first element is returned.
push(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L640-L648)
Push *o* to the stack at current position. Discard all later elements.
*o* is returned.
remove(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L693-L708)
Remove *o* from the stack.
Raises:
ValueError
If *o* is not in the stack.
matplotlib.cbook.boxplot\_stats(*X*, *whis=1.5*, *bootstrap=None*, *labels=None*, *autorange=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1115-L1313)
Return a list of dictionaries of statistics used to draw a series of box and whisker plots using [`bxp`](_as_gen/matplotlib.axes.axes.bxp#matplotlib.axes.Axes.bxp "matplotlib.axes.Axes.bxp").
Parameters:
**X**array-like
Data that will be represented in the boxplots. Should have 2 or fewer dimensions.
**whis**float or (float, float), default: 1.5
The position of the whiskers.
If a float, the lower whisker is at the lowest datum above `Q1 - whis*(Q3-Q1)`, and the upper whisker at the highest datum below `Q3 + whis*(Q3-Q1)`, where Q1 and Q3 are the first and third quartiles. The default value of `whis = 1.5` corresponds to Tukey's original definition of boxplots.
If a pair of floats, they indicate the percentiles at which to draw the whiskers (e.g., (5, 95)). In particular, setting this to (0, 100) results in whiskers covering the whole range of the data.
In the edge case where `Q1 == Q3`, *whis* is automatically set to (0, 100) (cover the whole range of the data) if *autorange* is True.
Beyond the whiskers, data are considered outliers and are plotted as individual points.
**bootstrap**int, optional
Number of times the confidence intervals around the median should be bootstrapped (percentile method).
**labels**array-like, optional
Labels for each dataset. Length must be compatible with dimensions of *X*.
**autorange**bool, optional (False)
When [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") and the data are distributed such that the 25th and 75th percentiles are equal, `whis` is set to (0, 100) such that the whisker ends are at the minimum and maximum of the data.
Returns:
list of dict
A list of dictionaries containing the results for each column of data. Keys of each dictionary are the following:
| Key | Value Description |
| --- | --- |
| label | tick label for the boxplot |
| mean | arithmetic mean value |
| med | 50th percentile |
| q1 | first quartile (25th percentile) |
| q3 | third quartile (75th percentile) |
| iqr | interquartile range |
| cilo | lower notch around the median |
| cihi | upper notch around the median |
| whislo | end of the lower whisker |
| whishi | end of the upper whisker |
| fliers | outliers |
#### Notes
Non-bootstrapping approach to confidence interval uses Gaussian-based asymptotic approximation:
\[\mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}\] General approach from: McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of Boxplots", The American Statistician, 32:12-16.
matplotlib.cbook.contiguous\_regions(*mask*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1322-L1345)
Return a list of (ind0, ind1) such that `mask[ind0:ind1].all()` is True and we cover all such regions.
matplotlib.cbook.delete\_masked\_points(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L973-L1047)
Find all masked and/or non-finite points in a set of arguments, and return the arguments with only the unmasked points remaining.
Arguments can be in any of 5 categories:
1. 1-D masked arrays
2. 1-D ndarrays
3. ndarrays with more than one dimension
4. other non-string iterables
5. anything else
The first argument must be in one of the first four categories; any argument with a length differing from that of the first argument (and hence anything in category 5) then will be passed through unchanged.
Masks are obtained from all arguments of the correct length in categories 1, 2, and 4; a point is bad if masked in a masked array or if it is a nan or inf. No attempt is made to extract a mask from categories 2, 3, and 4 if [`numpy.isfinite`](https://numpy.org/doc/stable/reference/generated/numpy.isfinite.html#numpy.isfinite "(in NumPy v1.23)") does not yield a Boolean array.
All input arguments that are not passed unchanged are returned as ndarrays after removing the points or rows corresponding to masks in any of the arguments.
A vastly simpler version of this function was originally written as a helper for Axes.scatter().
matplotlib.cbook.file\_requires\_unicode(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L439-L449)
Return whether the given writable file-like object requires Unicode to be written to it.
matplotlib.cbook.flatten(*seq*, *scalarp=<function is\_scalar\_or\_string>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L562-L581)
Return a generator of flattened nested containers.
For example:
```
>>> from matplotlib.cbook import flatten
>>> l = (('John', ['Hunter']), (1, 23), [[([42, (5, 23)], )]])
>>> print(list(flatten(l)))
['John', 'Hunter', 1, 23, 42, 5, 23]
```
By: Composite of Holger Krekel and Luther Blissett From: <https://code.activestate.com/recipes/121294/> and Recipe 1.12 in cookbook
matplotlib.cbook.get\_sample\_data(*fname*, *asfileobj=True*, *\**, *np\_load=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L515-L550)
Return a sample data file. *fname* is a path relative to the `mpl-data/sample_data` directory. If *asfileobj* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") return a file object, otherwise just a file path.
Sample data files are stored in the 'mpl-data/sample\_data' directory within the Matplotlib package.
If the filename ends in .gz, the file is implicitly ungzipped. If the filename ends with .npy or .npz, *asfileobj* is True, and *np\_load* is True, the file is loaded with [`numpy.load`](https://numpy.org/doc/stable/reference/generated/numpy.load.html#numpy.load "(in NumPy v1.23)"). *np\_load* currently defaults to False but will default to True in a future release.
matplotlib.cbook.index\_of(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1664-L1696)
A helper function to create reasonable x values for the given *y*.
This is used for plotting (x, y) if x values are not explicitly given.
First try `y.index` (assuming *y* is a [`pandas.Series`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html#pandas.Series "(in pandas v1.4.4)")), if that fails, use `range(len(y))`.
This will be extended in the future to deal with more types of labeled data.
Parameters:
**y**float or array-like
Returns:
**x, y**ndarray
The x and y values to plot.
matplotlib.cbook.is\_math\_text(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1348-L1358)
Return whether the string *s* contains math expressions.
This is done by checking whether *s* contains an even number of non-escaped dollar signs.
matplotlib.cbook.is\_scalar\_or\_string(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L510-L512)
Return whether the given object is a scalar or string like.
matplotlib.cbook.is\_writable\_file\_like(*obj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L434-L436)
Return whether *obj* looks like a file object with a *write* method.
matplotlib.cbook.ls\_mapper*={'-': 'solid', '--': 'dashed', '-.': 'dashdot', ':': 'dotted'}*
Maps short codes for line style to their full name used by backends.
matplotlib.cbook.ls\_mapper\_r*={'dashdot': '-.', 'dashed': '--', 'dotted': ':', 'solid': '-'}*
Maps full names for line styles used by backends to their short codes.
*class*matplotlib.cbook.maxdict(*maxsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L584-L602)
Bases: [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)")
[*Deprecated*] A dictionary with a maximum size.
#### Notes
This doesn't override all the relevant methods to constrain the size, just `__setitem__`, so use with caution.
Deprecated since version 3.6: Use functools.lru\_cache instead.
matplotlib.cbook.normalize\_kwargs(*kw*, *alias\_mapping=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1749-L1802)
Helper function to normalize kwarg inputs.
Parameters:
**kw**dict or None
A dict of keyword arguments. None is explicitly supported and treated as an empty dict, to support functions with an optional parameter of the form `props=None`.
**alias\_mapping**dict or Artist subclass or Artist instance, optional
A mapping between a canonical name to a list of aliases, in order of precedence from lowest to highest.
If the canonical value is not in the list it is assumed to have the highest priority.
If an Artist subclass or instance is passed, use its properties alias mapping.
Raises:
TypeError
To match what Python raises if invalid arguments/keyword arguments are passed to a callable.
matplotlib.cbook.open\_file\_cm(*path\_or\_file*, *mode='r'*, *encoding=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L504-L507)
Pass through file objects and context-manage path-likes.
matplotlib.cbook.print\_cycles(*objects*, *outstream=<\_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>*, *show\_progress=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L756-L822)
Print loops of cyclic references in the given *objects*.
It is often useful to pass in `gc.garbage` to find the cycles that are preventing some objects from being garbage collected.
Parameters:
**objects**
A list of objects to find cycles in.
**outstream**
The stream for output.
**show\_progress**bool
If True, print the number of objects reached as they are found.
matplotlib.cbook.pts\_to\_midstep(*x*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1619-L1654)
Convert continuous line to mid-steps.
Given a set of `N` points convert to `2N` points which when connected linearly give a step function which changes values at the middle of the intervals.
Parameters:
**x**array
The x location of the steps. May be empty.
**y1, ..., yp**array
y arrays to be turned into steps; all must be the same length as `x`.
Returns:
array
The x and y values converted to steps in the same order as the input; can be unpacked as `x_out, y1_out, ..., yp_out`. If the input is length `N`, each of these arrays will be length `2N`.
#### Examples
```
>>> x_s, y1_s, y2_s = pts_to_midstep(x, y1, y2)
```
matplotlib.cbook.pts\_to\_poststep(*x*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1583-L1616)
Convert continuous line to post-steps.
Given a set of `N` points convert to `2N + 1` points, which when connected linearly give a step function which changes values at the end of the intervals.
Parameters:
**x**array
The x location of the steps. May be empty.
**y1, ..., yp**array
y arrays to be turned into steps; all must be the same length as `x`.
Returns:
array
The x and y values converted to steps in the same order as the input; can be unpacked as `x_out, y1_out, ..., yp_out`. If the input is length `N`, each of these arrays will be length `2N + 1`. For `N=0`, the length will be 0.
#### Examples
```
>>> x_s, y1_s, y2_s = pts_to_poststep(x, y1, y2)
```
matplotlib.cbook.pts\_to\_prestep(*x*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1545-L1580)
Convert continuous line to pre-steps.
Given a set of `N` points, convert to `2N - 1` points, which when connected linearly give a step function which changes values at the beginning of the intervals.
Parameters:
**x**array
The x location of the steps. May be empty.
**y1, ..., yp**array
y arrays to be turned into steps; all must be the same length as `x`.
Returns:
array
The x and y values converted to steps in the same order as the input; can be unpacked as `x_out, y1_out, ..., yp_out`. If the input is length `N`, each of these arrays will be length `2N + 1`. For `N=0`, the length will be 0.
#### Examples
```
>>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2)
```
matplotlib.cbook.report\_memory(*i=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L711-L739)
[*Deprecated*] Return the memory consumed by the process.
#### Notes
Deprecated since version 3.5: Use psutil.virtual\_memory instead.
matplotlib.cbook.safe\_first\_element(*obj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1699-L1706)
Return the first element in *obj*.
This is an type-independent way of obtaining the first element, supporting both index access and the iterator protocol.
matplotlib.cbook.safe\_masked\_invalid(*x*, *copy=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L742-L753)
matplotlib.cbook.sanitize\_sequence(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1741-L1746)
Convert dictview objects to list. Other inputs are returned unchanged.
*class*matplotlib.cbook.silent\_list(*type*, *seq=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L342-L373)
Bases: [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)")
A list with a short `repr()`.
This is meant to be used for a homogeneous list of artists, so that they don't cause long, meaningless output.
Instead of
```
[<matplotlib.lines.Line2D object at 0x7f5749fed3c8>,
<matplotlib.lines.Line2D object at 0x7f5749fed4e0>,
<matplotlib.lines.Line2D object at 0x7f5758016550>]
```
one will get
```
<a list of 3 Line2D objects>
```
If `self.type` is None, the type name is obtained from the first item in the list (if any).
matplotlib.cbook.simple\_linear\_interpolation(*a*, *steps*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L949-L970)
Resample an array with `steps - 1` points between original point pairs.
Along each column of *a*, `(steps - 1)` points are introduced between each original values; the values are linearly interpolated.
Parameters:
**a**array, shape (n, ...)
**steps**int
Returns:
array
shape `((n - 1) * steps + 1, ...)`
matplotlib.cbook.strip\_math(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L391-L411)
Remove latex formatting from mathtext.
Only handles fully math and fully non-math strings.
matplotlib.cbook.to\_filehandle(*fname*, *flag='r'*, *return\_opened=False*, *encoding=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L452-L501)
Convert a path to an open file handle or pass-through a file-like object.
Consider using [`open_file_cm`](#matplotlib.cbook.open_file_cm "matplotlib.cbook.open_file_cm") instead, as it allows one to properly close newly created file objects more easily.
Parameters:
**fname**str or path-like or file-like
If [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`os.PathLike`](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.10)"), the file is opened using the flags specified by *flag* and *encoding*. If a file-like object, it is passed through.
**flag**str, default: 'r'
Passed as the *mode* argument to [`open`](https://docs.python.org/3/library/functions.html#open "(in Python v3.10)") when *fname* is [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`os.PathLike`](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.10)"); ignored if *fname* is file-like.
**return\_opened**bool, default: False
If True, return both the file object and a boolean indicating whether this was a new file (that the caller needs to close). If False, return only the new file.
**encoding**str or None, default: None
Passed as the *mode* argument to [`open`](https://docs.python.org/3/library/functions.html#open "(in Python v3.10)") when *fname* is [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`os.PathLike`](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.10)"); ignored if *fname* is file-like.
Returns:
**fh**file-like
**opened**bool
*opened* is only returned if *return\_opened* is True.
matplotlib.cbook.violin\_stats(*X*, *method*, *points=100*, *quantiles=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cbook/__init__.py#L1447-L1542)
Return a list of dictionaries of data which can be used to draw a series of violin plots.
See the `Returns` section below to view the required keys of the dictionary.
Users can skip this function and pass a user-defined set of dictionaries with the same keys to [`violinplot`](_as_gen/matplotlib.axes.axes.violinplot#matplotlib.axes.Axes.violinplot "matplotlib.axes.Axes.violinplot") instead of using Matplotlib to do the calculations. See the *Returns* section below for the keys that must be present in the dictionaries.
Parameters:
**X**array-like
Sample data that will be used to produce the gaussian kernel density estimates. Must have 2 or fewer dimensions.
**method**callable
The method used to calculate the kernel density estimate for each column of data. When called via `method(v, coords)`, it should return a vector of the values of the KDE evaluated at the values specified in coords.
**points**int, default: 100
Defines the number of points to evaluate each of the gaussian kernel density estimates at.
**quantiles**array-like, default: None
Defines (if not None) a list of floats in interval [0, 1] for each column of data, which represents the quantiles that will be rendered for that column of data. Must have 2 or fewer dimensions. 1D array will be treated as a singleton list containing them.
Returns:
list of dict
A list of dictionaries containing the results for each column of data. The dictionaries contain at least the following:
* coords: A list of scalars containing the coordinates this particular kernel density estimate was evaluated at.
* vals: A list of scalars containing the values of the kernel density estimate at each of the coordinates given in *coords*.
* mean: The mean value for this column of data.
* median: The median value for this column of data.
* min: The minimum value for this column of data.
* max: The maximum value for this column of data.
* quantiles: The quantile values for this column of data.
| programming_docs |
matplotlib matplotlib.ticker matplotlib.ticker
=================
Tick locating and formatting
----------------------------
This module contains classes for configuring tick locating and formatting. Generic tick locators and formatters are provided, as well as domain specific custom ones.
Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting.
### Tick locating
The Locator class is the base class for all tick locators. The locators handle autoscaling of the view limits based on the data limits, and the choosing of tick locations. A useful semi-automatic tick locator is [`MultipleLocator`](#matplotlib.ticker.MultipleLocator "matplotlib.ticker.MultipleLocator"). It is initialized with a base, e.g., 10, and it picks axis limits and ticks that are multiples of that base.
The Locator subclasses defined here are:
| | |
| --- | --- |
| [`AutoLocator`](#matplotlib.ticker.AutoLocator "matplotlib.ticker.AutoLocator") | [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator") with simple defaults. This is the default tick locator for most plotting. |
| [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator") | Finds up to a max number of intervals with ticks at nice locations. |
| [`LinearLocator`](#matplotlib.ticker.LinearLocator "matplotlib.ticker.LinearLocator") | Space ticks evenly from min to max. |
| [`LogLocator`](#matplotlib.ticker.LogLocator "matplotlib.ticker.LogLocator") | Space ticks logarithmically from min to max. |
| [`MultipleLocator`](#matplotlib.ticker.MultipleLocator "matplotlib.ticker.MultipleLocator") | Ticks and range are a multiple of base; either integer or float. |
| [`FixedLocator`](#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator") | Tick locations are fixed. |
| [`IndexLocator`](#matplotlib.ticker.IndexLocator "matplotlib.ticker.IndexLocator") | Locator for index plots (e.g., where `x = range(len(y))`). |
| [`NullLocator`](#matplotlib.ticker.NullLocator "matplotlib.ticker.NullLocator") | No ticks. |
| [`SymmetricalLogLocator`](#matplotlib.ticker.SymmetricalLogLocator "matplotlib.ticker.SymmetricalLogLocator") | Locator for use with the symlog norm; works like [`LogLocator`](#matplotlib.ticker.LogLocator "matplotlib.ticker.LogLocator") for the part outside of the threshold and adds 0 if inside the limits. |
| [`AsinhLocator`](#matplotlib.ticker.AsinhLocator "matplotlib.ticker.AsinhLocator") | Locator for use with the asinh norm, attempting to space ticks approximately uniformly. |
| [`LogitLocator`](#matplotlib.ticker.LogitLocator "matplotlib.ticker.LogitLocator") | Locator for logit scaling. |
| [`AutoMinorLocator`](#matplotlib.ticker.AutoMinorLocator "matplotlib.ticker.AutoMinorLocator") | Locator for minor ticks when the axis is linear and the major ticks are uniformly spaced. Subdivides the major tick interval into a specified number of minor intervals, defaulting to 4 or 5 depending on the major interval. |
There are a number of locators specialized for date locations - see the [`dates`](dates_api#module-matplotlib.dates "matplotlib.dates") module.
You can define your own locator by deriving from Locator. You must override the `__call__` method, which returns a sequence of locations, and you will probably want to override the autoscale method to set the view limits from the data limits.
If you want to override the default locator, use one of the above or a custom locator and pass it to the x or y axis instance. The relevant methods are:
```
ax.xaxis.set_major_locator(xmajor_locator)
ax.xaxis.set_minor_locator(xminor_locator)
ax.yaxis.set_major_locator(ymajor_locator)
ax.yaxis.set_minor_locator(yminor_locator)
```
The default minor locator is [`NullLocator`](#matplotlib.ticker.NullLocator "matplotlib.ticker.NullLocator"), i.e., no minor ticks on by default.
Note
[`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator") instances should not be used with more than one [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") or [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). So instead of:
```
locator = MultipleLocator(5)
ax.xaxis.set_major_locator(locator)
ax2.xaxis.set_major_locator(locator)
```
do the following instead:
```
ax.xaxis.set_major_locator(MultipleLocator(5))
ax2.xaxis.set_major_locator(MultipleLocator(5))
```
### Tick formatting
Tick formatting is controlled by classes derived from Formatter. The formatter operates on a single tick value and returns a string to the axis.
| | |
| --- | --- |
| [`NullFormatter`](#matplotlib.ticker.NullFormatter "matplotlib.ticker.NullFormatter") | No labels on the ticks. |
| [`FixedFormatter`](#matplotlib.ticker.FixedFormatter "matplotlib.ticker.FixedFormatter") | Set the strings manually for the labels. |
| [`FuncFormatter`](#matplotlib.ticker.FuncFormatter "matplotlib.ticker.FuncFormatter") | User defined function sets the labels. |
| [`StrMethodFormatter`](#matplotlib.ticker.StrMethodFormatter "matplotlib.ticker.StrMethodFormatter") | Use string [`format`](https://docs.python.org/3/library/functions.html#format "(in Python v3.10)") method. |
| [`FormatStrFormatter`](#matplotlib.ticker.FormatStrFormatter "matplotlib.ticker.FormatStrFormatter") | Use an old-style sprintf format string. |
| [`ScalarFormatter`](#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") | Default formatter for scalars: autopick the format string. |
| [`LogFormatter`](#matplotlib.ticker.LogFormatter "matplotlib.ticker.LogFormatter") | Formatter for log axes. |
| [`LogFormatterExponent`](#matplotlib.ticker.LogFormatterExponent "matplotlib.ticker.LogFormatterExponent") | Format values for log axis using `exponent = log_base(value)`. |
| [`LogFormatterMathtext`](#matplotlib.ticker.LogFormatterMathtext "matplotlib.ticker.LogFormatterMathtext") | Format values for log axis using `exponent = log_base(value)` using Math text. |
| [`LogFormatterSciNotation`](#matplotlib.ticker.LogFormatterSciNotation "matplotlib.ticker.LogFormatterSciNotation") | Format values for log axis using scientific notation. |
| [`LogitFormatter`](#matplotlib.ticker.LogitFormatter "matplotlib.ticker.LogitFormatter") | Probability formatter. |
| [`EngFormatter`](#matplotlib.ticker.EngFormatter "matplotlib.ticker.EngFormatter") | Format labels in engineering notation. |
| [`PercentFormatter`](#matplotlib.ticker.PercentFormatter "matplotlib.ticker.PercentFormatter") | Format labels as a percentage. |
You can derive your own formatter from the Formatter base class by simply overriding the `__call__` method. The formatter class has access to the axis view and data limits.
To control the major and minor tick label formats, use one of the following methods:
```
ax.xaxis.set_major_formatter(xmajor_formatter)
ax.xaxis.set_minor_formatter(xminor_formatter)
ax.yaxis.set_major_formatter(ymajor_formatter)
ax.yaxis.set_minor_formatter(yminor_formatter)
```
In addition to a [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") instance, [`set_major_formatter`](_as_gen/matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") and [`set_minor_formatter`](_as_gen/matplotlib.axis.axis.set_minor_formatter#matplotlib.axis.Axis.set_minor_formatter "matplotlib.axis.Axis.set_minor_formatter") also accept a `str` or function. `str` input will be internally replaced with an autogenerated [`StrMethodFormatter`](#matplotlib.ticker.StrMethodFormatter "matplotlib.ticker.StrMethodFormatter") with the input `str`. For function input, a [`FuncFormatter`](#matplotlib.ticker.FuncFormatter "matplotlib.ticker.FuncFormatter") with the input function will be generated and used.
See [Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html) for an example of setting major and minor ticks. See the [`matplotlib.dates`](dates_api#module-matplotlib.dates "matplotlib.dates") module for more information and examples of using date locators and formatters.
*class*matplotlib.ticker.AsinhLocator(*linear\_width*, *numticks=11*, *symthresh=0.2*, *base=10*, *subs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2640-L2749)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
An axis tick locator specialized for the inverse-sinh scale
This is very unlikely to have any use beyond the [`AsinhScale`](scale_api#matplotlib.scale.AsinhScale "matplotlib.scale.AsinhScale") class.
Note
This API is provisional and may be revised in the future based on early user feedback.
Parameters:
**linear\_width**float
The scale parameter defining the extent of the quasi-linear region.
**numticks**int, default: 11
The approximate number of major ticks that will fit along the entire axis
**symthresh**float, default: 0.2
The fractional threshold beneath which data which covers a range that is approximately symmetric about zero will have ticks that are exactly symmetric.
**base**int, default: 10
The number base used for rounding tick locations on a logarithmic scale. If this is less than one, then rounding is to the nearest integer multiple of powers of ten.
**subs**tuple, default: None
Multiples of the number base, typically used for the minor ticks, e.g. (2, 5) when base=10.
set\_params(*numticks=None*, *symthresh=None*, *base=None*, *subs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2683-L2693)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2704-L2749)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.ticker.AutoLocator[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2900-L2917)
Bases: [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
Dynamically find major tick positions. This is actually a subclass of [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), with parameters *nbins = 'auto'* and *steps = [1, 2, 2.5, 5, 10]*.
To know the values of the non-public parameters, please have a look to the defaults of [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
*class*matplotlib.ticker.AutoMinorLocator(*n=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2920-L2978)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Dynamically find minor tick positions based on the positions of major ticks. The scale must be linear with major ticks evenly spaced.
*n* is the number of subdivisions of the interval between major ticks; e.g., n=2 will place a single minor tick midway between major ticks.
If *n* is omitted or None, it will be set to 5 or 4.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2976-L2978)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.ticker.EngFormatter(*unit=''*, *places=None*, *sep=' '*, *\**, *usetex=None*, *useMathText=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1340-L1488)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Format axis values using engineering prefixes to represent powers of 1000, plus a specified unit, e.g., 10 MHz instead of 1e7.
Parameters:
**unit**str, default: ""
Unit symbol to use, suitable for use with single-letter representations of powers of 1000. For example, 'Hz' or 'm'.
**places**int, default: None
Precision with which to display the number, specified in digits after the decimal point (there will be between one and three digits before the decimal point). If it is None, the formatting falls back to the floating point format '%g', which displays up to 6 *significant* digits, i.e. the equivalent value for *places* varies between 0 and 5 (inclusive).
**sep**str, default: " "
Separator used between the value and the prefix/unit. For example, one get '3.14 mV' if `sep` is " " (default) and '3.14mV' if `sep` is "". Besides the default behavior, some other useful options may be:
* `sep=""` to append directly the prefix/unit to the value;
* `sep="\N{THIN SPACE}"` (`U+2009`);
* `sep="\N{NARROW NO-BREAK SPACE}"` (`U+202F`);
* `sep="\N{NO-BREAK SPACE}"` (`U+00A0`).
**usetex**bool, default: `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`)
To enable/disable the use of TeX's math mode for rendering the numbers in the formatter.
**useMathText**bool, default: `[rcParams["axes.formatter.use\_mathtext"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#matplotlibrc-sample)` (default: `False`)
To enable/disable the use mathtext for rendering the numbers in the formatter.
ENG\_PREFIXES*={-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'µ', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'}*
format\_eng(*num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1438-L1488)
Format a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples:
```
>>> format_eng(0) # for self.places = 0
'0'
```
```
>>> format_eng(1000000) # for self.places = 1
'1.0 M'
```
```
>>> format_eng("-1e-6") # for self.places = 2
'-1.00 µ'
```
get\_useMathText()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1420-L1421)
get\_usetex()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1409-L1410)
set\_useMathText(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1423-L1427)
set\_usetex(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1412-L1416)
*property*useMathText
*property*usetex
*class*matplotlib.ticker.FixedFormatter(*seq*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L287-L318)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Return fixed strings for tick labels based only on position, not value.
Note
[`FixedFormatter`](#matplotlib.ticker.FixedFormatter "matplotlib.ticker.FixedFormatter") should only be used together with [`FixedLocator`](#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator"). Otherwise, the labels may end up in unexpected positions.
Set the sequence *seq* of strings that will be used for labels.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L314-L315)
set\_offset\_string(*ofs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L317-L318)
*class*matplotlib.ticker.FixedLocator(*locs*, *nbins=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1723-L1764)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Tick locations are fixed. If nbins is not None, the array of possible positions will be subsampled to keep the number of ticks <= nbins +1. The subsampling will be done so as to include the smallest absolute value; for example, if zero is included in the array of possibilities, then it is guaranteed to be one of the chosen ticks.
set\_params(*nbins=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1738-L1741)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1746-L1764)
Return the locations of the ticks.
Note
Because the values are fixed, vmin and vmax are not used in this method.
*class*matplotlib.ticker.FormatStrFormatter(*fmt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L349-L369)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Use an old-style ('%' operator) format string to format the tick.
The format string should have a single variable format (%) in it. It will be applied to the value (not the position) of the tick.
Negative numeric values will use a dash, not a Unicode minus; use mathtext to get a Unicode minus by wrapping the format specifier with $ (e.g. "$%g$").
*class*matplotlib.ticker.Formatter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L215-L276)
Bases: [`TickHelper`](#matplotlib.ticker.TickHelper "matplotlib.ticker.TickHelper")
Create a string based on a tick value and location.
*static*fix\_minus(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L262-L272)
Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via `[rcParams["axes.unicode\_minus"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.unicode_minus#matplotlibrc-sample)` (default: `True`).
format\_data(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L235-L240)
Return the full string representation of the value with the position unspecified.
format\_data\_short(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L242-L248)
Return a short string version of the tick value.
Defaults to the position-independent long value.
format\_ticks(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L230-L233)
Return the tick labels for all the ticks at once.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L250-L251)
locs*=[]*
set\_locs(*locs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L253-L260)
Set the locations of the ticks.
This method is called before computing the tick labels because some formatters need to know all tick locations to do so.
*class*matplotlib.ticker.FuncFormatter(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L321-L346)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Use a user-defined function for formatting.
The function should take in two inputs (a tick value `x` and a position `pos`), and return a string containing the corresponding tick label.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L342-L343)
set\_offset\_string(*ofs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L345-L346)
*class*matplotlib.ticker.IndexLocator(*base*, *offset*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1694-L1720)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Place a tick on every multiple of some base number of points plotted, e.g., on every 5th point. It is assumed that you are doing index plotting; i.e., the axis is 0, len(data). This is mainly useful for x ticks.
Place ticks every *base* data point, starting at *offset*.
set\_params(*base=None*, *offset=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1706-L1711)
Set parameters within this locator
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1718-L1720)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.ticker.LinearLocator(*numticks=None*, *presets=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1787-L1860)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Determine the tick locations
The first time this function is called it will try to set the number of ticks to make a nice tick partitioning. Thereafter the number of ticks will be fixed so that interactive navigation will be nice
Use presets to set locs based on lom. A dict mapping vmin, vmax->locs
*property*numticks
set\_params(*numticks=None*, *presets=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1816-L1821)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1828-L1840)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1842-L1860)
Try to choose the view limits intelligently.
*class*matplotlib.ticker.Locator[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1604-L1691)
Bases: [`TickHelper`](#matplotlib.ticker.TickHelper "matplotlib.ticker.TickHelper")
Determine the tick locations;
Note that the same locator should not be used across multiple [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") because the locator stores references to the Axis data and view limits.
MAXTICKS*=1000*
nonsingular(*v0*, *v1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1669-L1683)
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with `(v0, v1)` set to the data limits on the axes if the axes contains any data, or `(-inf, +inf)` if not.
* If `v0 == v1` (possibly up to some floating point slop), this method returns an expanded interval around this value.
* If `(v0, v1) == (-inf, +inf)`, this method returns appropriate default view limits.
* Otherwise, `(v0, v1)` is returned without modification.
raise\_if\_exceeds(*locs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1651-L1667)
Log at WARNING level if *locs* is longer than [`Locator.MAXTICKS`](#matplotlib.ticker.Locator.MAXTICKS "matplotlib.ticker.Locator.MAXTICKS").
This is intended to be called immediately before returning *locs* from `__call__` to inform users in case their Locator returns a huge number of ticks, causing Matplotlib to run out of memory.
The "strange" name of this method dates back to when it would raise an exception instead of emitting a log.
set\_params(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1636-L1643)
Do nothing, and raise a warning. Any locator class not supporting the set\_params() function will call this.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1619-L1634)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1685-L1691)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
*class*matplotlib.ticker.LogFormatter(*base=10.0*, *labelOnlyBase=False*, *minor\_thresholds=None*, *linthresh=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L827-L1061)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Base class for formatting ticks on a log or symlog scale.
It may be instantiated directly, or subclassed.
Parameters:
**base**float, default: 10.
Base of the logarithm used in all calculations.
**labelOnlyBase**bool, default: False
If True, label ticks only at integer powers of base. This is normally True for major ticks and False for minor ticks.
**minor\_thresholds**(subset, all), default: (1, 0.4)
If labelOnlyBase is False, these two numbers control the labeling of ticks that are not at integer powers of base; normally these are the minor ticks. The controlling parameter is the log of the axis data range. In the typical case where base is 10 it is the number of decades spanned by the axis, so we can call it 'numdec'. If `numdec <= all`, all minor ticks will be labeled. If `all < numdec <= subset`, then only a subset of minor ticks will be labeled, so as to avoid crowding. If `numdec > subset` then no minor ticks will be labeled.
**linthresh**None or float, default: None
If a symmetric log scale is in use, its `linthresh` parameter must be supplied here.
#### Notes
The [`set_locs`](#matplotlib.ticker.LogFormatter.set_locs "matplotlib.ticker.LogFormatter.set_locs") method must be called to enable the subsetting logic controlled by the `minor_thresholds` parameter.
In some cases such as the colorbar, there is no distinction between major and minor ticks; the tick locations might be set manually, or by a locator that puts ticks at integer powers of base and at intermediate locations. For this situation, disable the minor\_thresholds logic by using `minor_thresholds=(np.inf, np.inf)`, so that all ticks will be labeled.
To disable labeling of minor ticks when 'labelOnlyBase' is False, use `minor_thresholds=(0, 0)`. This is the default for the "classic" style.
#### Examples
To label a subset of minor ticks when the view limits span up to 2 decades, and all of the ticks when zoomed in to 0.5 decades or less, use `minor_thresholds=(2, 0.5)`.
To label all minor ticks when the view limits span up to 1.5 decades, use `minor_thresholds=(1.5, 1.5)`.
base(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L900-L908)
[*Deprecated*] Change the *base* for labeling.
Warning
Should always match the base used for [`LogLocator`](#matplotlib.ticker.LogLocator "matplotlib.ticker.LogLocator")
#### Notes
Deprecated since version 3.6: Use set\_base() instead.
format\_data(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1033-L1035)
Return the full string representation of the value with the position unspecified.
format\_data\_short(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1037-L1039)
Return a short string version of the tick value.
Defaults to the position-independent long value.
label\_minor(*labelOnlyBase*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L919-L929)
[*Deprecated*] Switch minor tick labeling on or off.
Parameters:
**labelOnlyBase**bool
If True, label ticks only at integer powers of base.
#### Notes
Deprecated since version 3.6: Use set\_label\_minor() instead.
set\_base(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L910-L917)
Change the *base* for labeling.
Warning
Should always match the base used for [`LogLocator`](#matplotlib.ticker.LogLocator "matplotlib.ticker.LogLocator")
set\_label\_minor(*labelOnlyBase*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L931-L940)
Switch minor tick labeling on or off.
Parameters:
**labelOnlyBase**bool
If True, label ticks only at integer powers of base.
set\_locs(*locs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L942-L999)
Use axis view limits to control which ticks are labeled.
The *locs* parameter is ignored in the present algorithm.
*class*matplotlib.ticker.LogFormatterExponent(*base=10.0*, *labelOnlyBase=False*, *minor\_thresholds=None*, *linthresh=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1064-L1077)
Bases: [`LogFormatter`](#matplotlib.ticker.LogFormatter "matplotlib.ticker.LogFormatter")
Format values for log axis using `exponent = log_base(value)`.
*class*matplotlib.ticker.LogFormatterMathtext(*base=10.0*, *labelOnlyBase=False*, *minor\_thresholds=None*, *linthresh=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1080-L1125)
Bases: [`LogFormatter`](#matplotlib.ticker.LogFormatter "matplotlib.ticker.LogFormatter")
Format values for log axis using `exponent = log_base(value)`.
*class*matplotlib.ticker.LogFormatterSciNotation(*base=10.0*, *labelOnlyBase=False*, *minor\_thresholds=None*, *linthresh=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1128-L1141)
Bases: [`LogFormatterMathtext`](#matplotlib.ticker.LogFormatterMathtext "matplotlib.ticker.LogFormatterMathtext")
Format values following scientific notation in a logarithmic axis.
*class*matplotlib.ticker.LogLocator(*base=10.0*, *subs=(1.0,)*, *numdecs=4*, *numticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2258-L2479)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Determine the tick locations for log axes
Place ticks on the locations : subs[j] \* base\*\*i
Parameters:
**base**float, default: 10.0
The base of the log used, so major ticks are placed at `base**n`, n integer.
**subs**None or str or sequence of float, default: (1.0,)
Gives the multiples of integer powers of the base at which to place ticks. The default places ticks only at integer powers of the base. The permitted string values are `'auto'` and `'all'`, both of which use an algorithm based on the axis view limits to determine whether and how to put ticks between integer powers of the base. With `'auto'`, ticks are placed only between integer powers; with `'all'`, the integer powers are included. A value of None is equivalent to `'auto'`.
**numticks**None or int, default: None
The maximum number of ticks to allow on a given axis. The default of `None` will try to choose intelligently as long as this Locator has already been assigned to an axis using [`get_tick_space`](_as_gen/matplotlib.axis.axis.get_tick_space#matplotlib.axis.Axis.get_tick_space "matplotlib.axis.Axis.get_tick_space"), but otherwise falls back to 9.
base(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2310-L2313)
[*Deprecated*] Set the log base (major tick every `base**i`, i integer).
#### Notes
Deprecated since version 3.6: Use set\_params(base=...) instead.
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2460-L2479)
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with `(v0, v1)` set to the data limits on the axes if the axes contains any data, or `(-inf, +inf)` if not.
* If `v0 == v1` (possibly up to some floating point slop), this method returns an expanded interval around this value.
* If `(v0, v1) == (-inf, +inf)`, this method returns appropriate default view limits.
* Otherwise, `(v0, v1)` is returned without modification.
set\_params(*base=None*, *subs=None*, *numdecs=None*, *numticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2299-L2308)
Set parameters within this locator.
subs(*subs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2315-L2320)
[*Deprecated*] Set the minor ticks for the log scaling every `base**i*subs[j]`.
#### Notes
Deprecated since version 3.6: Use set\_params(subs=...) instead.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2348-L2442)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2444-L2458)
Try to choose the view limits intelligently.
*class*matplotlib.ticker.LogitFormatter(*\**, *use\_overline=False*, *one\_half='\\frac{1}{2}'*, *minor=False*, *minor\_threshold=25*, *minor\_number=6*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1144-L1337)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Probability formatter (using Math text).
Parameters:
**use\_overline**bool, default: False
If x > 1/2, with x = 1-v, indicate if x should be displayed as $overline{v}$. The default is to display $1-v$.
**one\_half**str, default: r"frac{1}{2}"
The string used to represent 1/2.
**minor**bool, default: False
Indicate if the formatter is formatting minor ticks or not. Basically minor ticks are not labelled, except when only few ticks are provided, ticks with most space with neighbor ticks are labelled. See other parameters to change the default behavior.
**minor\_threshold**int, default: 25
Maximum number of locs for labelling some minor ticks. This parameter have no effect if minor is False.
**minor\_number**int, default: 6
Number of ticks which are labelled when the number of ticks is below the threshold.
format\_data\_short(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1330-L1337)
Return a short string version of the tick value.
Defaults to the position-independent long value.
set\_locs(*locs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1235-L1275)
Set the locations of the ticks.
This method is called before computing the tick labels because some formatters need to know all tick locations to do so.
set\_minor\_number(*minor\_number*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1222-L1233)
Set the number of minor ticks to label when some minor ticks are labelled.
Parameters:
**minor\_number**int
Number of ticks which are labelled when the number of ticks is below the threshold.
set\_minor\_threshold(*minor\_threshold*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1210-L1220)
Set the threshold for labelling minors ticks.
Parameters:
**minor\_threshold**int
Maximum number of locations for labelling some minor ticks. This parameter have no effect if minor is False.
set\_one\_half(*one\_half*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1201-L1208)
Set the way one half is displayed.
one\_halfstr, default: r"frac{1}{2}"
The string used to represent 1/2.
use\_overline(*use\_overline*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1189-L1199)
Switch display mode with overline for labelling p>1/2.
Parameters:
**use\_overline**bool, default: False
If x > 1/2, with x = 1-v, indicate if x should be displayed as $overline{v}$. The default is to display $1-v$.
*class*matplotlib.ticker.LogitLocator(*minor=False*, *\**, *nbins='auto'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2752-L2897)
Bases: [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
Determine the tick locations for logit axes
Place ticks on the logit locations
Parameters:
**nbins**int or 'auto', optional
Number of ticks. Only used if minor is False.
**minor**bool, default: False
Indicate if this locator is for minor ticks or not.
*property*minor
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2863-L2897)
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with `(v0, v1)` set to the data limits on the axes if the axes contains any data, or `(-inf, +inf)` if not.
* If `v0 == v1` (possibly up to some floating point slop), this method returns an expanded interval around this value.
* If `(v0, v1) == (-inf, +inf)`, this method returns appropriate default view limits.
* Otherwise, `(v0, v1)` is returned without modification.
set\_params(*minor=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2772-L2776)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2786-L2861)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.ticker.MaxNLocator(*nbins=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1962-L2173)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Find nice tick locations with no more than N being within the view limits. Locations beyond the limits are added to support autoscaling.
Parameters:
**nbins**int or 'auto', default: 10
Maximum number of intervals; one less than max number of ticks. If the string 'auto', the number of bins will be automatically determined based on the length of the axis.
**steps**array-like, optional
Sequence of nice numbers starting with 1 and ending with 10; e.g., [1, 2, 4, 5, 10], where the values are acceptable tick multiples. i.e. for the example, 20, 40, 60 would be an acceptable set of ticks, as would 0.4, 0.6, 0.8, because they are multiples of 2. However, 30, 60, 90 would not be allowed because 3 does not appear in the list of steps.
**integer**bool, default: False
If True, ticks will take only integer values, provided at least *min\_n\_ticks* integers are found within the view limits.
**symmetric**bool, default: False
If True, autoscaling will result in a range symmetric about zero.
**prune**{'lower', 'upper', 'both', None}, default: None
Remove edge ticks -- useful for stacked or ganged plots where the upper tick of one axes overlaps with the lower tick of the axes above it, primarily when `[rcParams["axes.autolimit\_mode"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.autolimit_mode#matplotlibrc-sample)` (default: `'data'`) is `'round_numbers'`. If `prune=='lower'`, the smallest tick will be removed. If `prune == 'upper'`, the largest tick will be removed. If `prune == 'both'`, the largest and smallest ticks will be removed. If *prune* is *None*, no ticks will be removed.
**min\_n\_ticks**int, default: 2
Relax *nbins* and *integer* constraints if necessary to obtain this minimum number of ticks.
default\_params*={'integer': False, 'min\_n\_ticks': 2, 'nbins': 10, 'prune': None, 'steps': None, 'symmetric': False}*
set\_params(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2036-L2079)
Set parameters for this locator.
Parameters:
**nbins**int or 'auto', optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
**steps**array-like, optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
**integer**bool, optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
**symmetric**bool, optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
**prune**{'lower', 'upper', 'both', None}, optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
**min\_n\_ticks**int, optional
see [`MaxNLocator`](#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator")
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2145-L2160)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*dmin*, *dmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2162-L2173)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
*class*matplotlib.ticker.MultipleLocator(*base=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1863-L1905)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Set a tick on each integer multiple of a base within the view interval.
set\_params(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1871-L1874)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1881-L1888)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*dmin*, *dmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1890-L1905)
Set the view limits to the nearest multiples of base that contain the data.
*class*matplotlib.ticker.NullFormatter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L279-L284)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Always return the empty string.
*class*matplotlib.ticker.NullLocator[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1767-L1784)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
No ticks
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1775-L1784)
Return the locations of the ticks.
Note
Because the values are Null, vmin and vmax are not used in this method.
*class*matplotlib.ticker.PercentFormatter(*xmax=100*, *decimals=None*, *symbol='%'*, *is\_latex=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1491-L1601)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Format numbers as a percentage.
Parameters:
**xmax**float
Determines how the number is converted into a percentage. *xmax* is the data value that corresponds to 100%. Percentages are computed as `x / xmax * 100`. So if the data is already scaled to be percentages, *xmax* will be 100. Another common situation is where *xmax* is 1.0.
**decimals**None or int
The number of decimal places to place after the point. If *None* (the default), the number will be computed automatically.
**symbol**str or None
A string that will be appended to the label. It may be *None* or empty to indicate that no symbol should be used. LaTeX special characters are escaped in *symbol* whenever latex mode is enabled, unless *is\_latex* is *True*.
**is\_latex**bool
If *False*, reserved LaTeX characters in *symbol* will be escaped.
convert\_to\_pct(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1576-L1577)
format\_pct(*x*, *display\_range*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L1529-L1574)
Format the number as a percentage number with the correct number of decimals and adds the percent symbol, if any.
If `self.decimals` is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), the number of digits after the decimal point is set based on the *display\_range* of the axis as follows:
| | | |
| --- | --- | --- |
| display\_range | decimals | sample |
| >50 | 0 | `x = 34.5` => 35% |
| >5 | 1 | `x = 34.5` => 34.5% |
| >0.5 | 2 | `x = 34.5` => 34.50% |
| ... | ... | ... |
This method will not be very good for tiny axis ranges or extremely large ones. It assumes that the values on the chart are percentages displayed on a reasonable scale.
*property*symbol
The configured percent symbol as a string.
If LaTeX is enabled via `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`), the special characters `{'#', '$', '%', '&', '~', '_', '^', '\', '{', '}'}` are automatically escaped in the string.
*class*matplotlib.ticker.ScalarFormatter(*useOffset=None*, *useMathText=None*, *useLocale=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L392-L824)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Format tick values as a number.
Parameters:
**useOffset**bool or float, default: `[rcParams["axes.formatter.useoffset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.useoffset#matplotlibrc-sample)` (default: `True`)
Whether to use offset notation. See [`set_useOffset`](#matplotlib.ticker.ScalarFormatter.set_useOffset "matplotlib.ticker.ScalarFormatter.set_useOffset").
**useMathText**bool, default: `[rcParams["axes.formatter.use\_mathtext"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#matplotlibrc-sample)` (default: `False`)
Whether to use fancy math formatting. See [`set_useMathText`](#matplotlib.ticker.ScalarFormatter.set_useMathText "matplotlib.ticker.ScalarFormatter.set_useMathText").
**useLocale**bool, default: `[rcParams["axes.formatter.use\_locale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_locale#matplotlibrc-sample)` (default: `False`).
Whether to use locale settings for decimal sign and positive sign. See [`set_useLocale`](#matplotlib.ticker.ScalarFormatter.set_useLocale "matplotlib.ticker.ScalarFormatter.set_useLocale").
#### Notes
In addition to the parameters above, the formatting of scientific vs. floating point representation can be configured via [`set_scientific`](#matplotlib.ticker.ScalarFormatter.set_scientific "matplotlib.ticker.ScalarFormatter.set_scientific") and [`set_powerlimits`](#matplotlib.ticker.ScalarFormatter.set_powerlimits "matplotlib.ticker.ScalarFormatter.set_powerlimits")).
**Offset notation and scientific notation**
Offset notation and scientific notation look quite similar at first sight. Both split some information from the formatted tick values and display it at the end of the axis.
* The scientific notation splits up the order of magnitude, i.e. a multiplicative scaling factor, e.g. `1e6`.
* The offset notation separates an additive constant, e.g. `+1e6`. The offset notation label is always prefixed with a `+` or `-` sign and is thus distinguishable from the order of magnitude label.
The following plot with x limits `1_000_000` to `1_000_010` illustrates the different formatting. Note the labels at the right edge of the x axis.
([Source code](ticker_api-1.py), [png](ticker_api-1.png))
format\_data(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L667-L681)
Return the full string representation of the value with the position unspecified.
format\_data\_short(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L639-L665)
Return a short string version of the tick value.
Defaults to the position-independent long value.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L683-L709)
Return scientific notation, plus offset.
get\_useLocale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L505-L513)
Return whether locale settings are used for formatting.
See also
[`ScalarFormatter.set_useLocale`](#matplotlib.ticker.ScalarFormatter.set_useLocale "matplotlib.ticker.ScalarFormatter.set_useLocale")
get\_useMathText()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L538-L546)
Return whether to use fancy math formatting.
See also
[`ScalarFormatter.set_useMathText`](#matplotlib.ticker.ScalarFormatter.set_useMathText "matplotlib.ticker.ScalarFormatter.set_useMathText")
get\_useOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L456-L467)
Return whether automatic mode for offset notation is active.
This returns True if `set_useOffset(True)`; it returns False if an explicit offset was set, e.g. `set_useOffset(1000)`.
See also
[`ScalarFormatter.set_useOffset`](#matplotlib.ticker.ScalarFormatter.set_useOffset "matplotlib.ticker.ScalarFormatter.set_useOffset")
set\_locs(*locs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L711-L718)
Set the locations of the ticks.
This method is called before computing the tick labels because some formatters need to know all tick locations to do so.
set\_powerlimits(*lims*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L605-L637)
Set size thresholds for scientific notation.
Parameters:
**lims**(int, int)
A tuple *(min\_exp, max\_exp)* containing the powers of 10 that determine the switchover threshold. For a number representable as \(a \times 10^\mathrm{exp}\) with \(1 <= |a| < 10\), scientific notation will be used if `exp <= min_exp` or `exp >= max_exp`.
The default limits are controlled by `[rcParams["axes.formatter.limits"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.limits#matplotlibrc-sample)` (default: `[-5, 6]`).
In particular numbers with *exp* equal to the thresholds are written in scientific notation.
Typically, *min\_exp* will be negative and *max\_exp* will be positive.
For example, `formatter.set_powerlimits((-3, 4))` will provide the following formatting: \(1 \times 10^{-3}, 9.9 \times 10^{-3}, 0.01,\) \(9999, 1 \times 10^4\).
See also
[`ScalarFormatter.set_scientific`](#matplotlib.ticker.ScalarFormatter.set_scientific "matplotlib.ticker.ScalarFormatter.set_scientific")
set\_scientific(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L595-L603)
Turn scientific notation on or off.
See also
[`ScalarFormatter.set_powerlimits`](#matplotlib.ticker.ScalarFormatter.set_powerlimits "matplotlib.ticker.ScalarFormatter.set_powerlimits")
set\_useLocale(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L515-L527)
Set whether to use locale settings for decimal sign and positive sign.
Parameters:
**val**bool or None
*None* resets to `[rcParams["axes.formatter.use\_locale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_locale#matplotlibrc-sample)` (default: `False`).
set\_useMathText(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L548-L579)
Set whether to use fancy math formatting.
If active, scientific notation is formatted as \(1.2 \times 10^3\).
Parameters:
**val**bool or None
*None* resets to `[rcParams["axes.formatter.use\_mathtext"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#matplotlibrc-sample)` (default: `False`).
set\_useOffset(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L469-L501)
Set whether to use offset notation.
When formatting a set numbers whose value is large compared to their range, the formatter can separate an additive constant. This can shorten the formatted numbers so that they are less likely to overlap when drawn on an axis.
Parameters:
**val**bool or float
* If False, do not use offset notation.
* If True (=automatic mode), use offset notation if it can make the residual numbers significantly shorter. The exact behavior is controlled by `[rcParams["axes.formatter.offset\_threshold"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.offset_threshold#matplotlibrc-sample)` (default: `4`).
* If a number, force an offset of the given value.
#### Examples
With active offset notation, the values
`100_000, 100_002, 100_004, 100_006, 100_008`
will be formatted as `0, 2, 4, 6, 8` plus an offset `+1e5`, which is written to the edge of the axis.
*property*useLocale
Return whether locale settings are used for formatting.
See also
[`ScalarFormatter.set_useLocale`](#matplotlib.ticker.ScalarFormatter.set_useLocale "matplotlib.ticker.ScalarFormatter.set_useLocale")
*property*useMathText
Return whether to use fancy math formatting.
See also
[`ScalarFormatter.set_useMathText`](#matplotlib.ticker.ScalarFormatter.set_useMathText "matplotlib.ticker.ScalarFormatter.set_useMathText")
*property*useOffset
Return whether automatic mode for offset notation is active.
This returns True if `set_useOffset(True)`; it returns False if an explicit offset was set, e.g. `set_useOffset(1000)`.
See also
[`ScalarFormatter.set_useOffset`](#matplotlib.ticker.ScalarFormatter.set_useOffset "matplotlib.ticker.ScalarFormatter.set_useOffset")
*class*matplotlib.ticker.StrMethodFormatter(*fmt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L372-L389)
Bases: [`Formatter`](#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Use a new-style format string (as used by [`str.format`](https://docs.python.org/3/library/stdtypes.html#str.format "(in Python v3.10)")) to format the tick.
The field used for the tick value must be labeled *x* and the field used for the tick position must be labeled *pos*.
*class*matplotlib.ticker.SymmetricalLogLocator(*transform=None*, *subs=None*, *linthresh=None*, *base=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2482-L2637)
Bases: [`Locator`](#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Determine the tick locations for symmetric log axes.
Parameters:
**transform**[`SymmetricalLogTransform`](scale_api#matplotlib.scale.SymmetricalLogTransform "matplotlib.scale.SymmetricalLogTransform"), optional
If set, defines the *base* and *linthresh* of the symlog transform.
**base, linthresh**float, optional
The *base* and *linthresh* of the symlog transform, as documented for [`SymmetricalLogScale`](scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale"). These parameters are only used if *transform* is not set.
**subs**sequence of float, default: [1]
The multiples of integer powers of the base where ticks are placed, i.e., ticks are placed at `[sub * base**i for i in ... for sub in subs]`.
#### Notes
Either *transform*, or both *base* and *linthresh*, must be given.
set\_params(*subs=None*, *numticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2521-L2526)
Set parameters within this locator.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2534-L2621)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L2623-L2637)
Try to choose the view limits intelligently.
*class*matplotlib.ticker.TickHelper[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L189-L212)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
axis*=None*
create\_dummy\_axis(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L195-L197)
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L192-L193)
set\_bounds(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L207-L212)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`Axis.set_view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") and [`Axis.set_data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") instead.
set\_data\_interval(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L203-L205)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`Axis.set_data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") instead.
set\_view\_interval(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/ticker.py#L199-L201)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`Axis.set_view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") instead.
| programming_docs |
matplotlib matplotlib.afm matplotlib.afm
==============
Attention
This module is considered internal.
Its use is deprecated and it will be removed in a future version.
A python interface to Adobe Font Metrics Files.
Although a number of other Python implementations exist, and may be more complete than this, it was decided not to go with them because they were either:
1. copyrighted or used a non-BSD compatible license
2. had too many dependencies and a free standing lib was needed
3. did more than needed and it was easier to write afresh rather than figure out how to get just what was needed.
It is pretty easy to use, and has no external dependencies:
```
>>> import matplotlib as mpl
>>> from pathlib import Path
>>> afm_path = Path(mpl.get_data_path(), 'fonts', 'afm', 'ptmr8a.afm')
>>>
>>> from matplotlib.afm import AFM
>>> with afm_path.open('rb') as fh:
... afm = AFM(fh)
>>> afm.string_width_height('What the heck?')
(6220.0, 694)
>>> afm.get_fontname()
'Times-Roman'
>>> afm.get_kern_dist('A', 'f')
0
>>> afm.get_kern_dist('A', 'y')
-92.0
>>> afm.get_bbox_char('!')
[130, -9, 238, 676]
```
As in the Adobe Font Metrics File Format Specification, all dimensions are given in units of 1/1000 of the scale factor (point size) of the font being used.
*class*matplotlib.\_afm.AFM(*fh*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L358-L532)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Parse the AFM file in file object *fh*.
*property*family\_name
The font family name, e.g., 'Times'.
get\_angle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L504-L506)
Return the fontangle as float.
get\_bbox\_char(*c*, *isord=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L366-L369)
get\_capheight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L508-L510)
Return the cap height as float.
get\_familyname()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L483-L493)
Return the font family name, e.g., 'Times'.
get\_fontname()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L468-L470)
Return the font name, e.g., 'Times-Roman'.
get\_fullname()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L476-L481)
Return the font full name, e.g., 'Times-Roman'.
get\_height\_char(*c*, *isord=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L448-L452)
Get the bounding box (ink) height of character *c* (space is 0).
get\_horizontal\_stem\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L520-L525)
Return the standard horizontal stem width as float, or *None* if not specified in AFM file.
get\_kern\_dist(*c1*, *c2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L454-L459)
Return the kerning pair distance (possibly 0) for chars *c1* and *c2*.
get\_kern\_dist\_from\_name(*name1*, *name2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L461-L466)
Return the kerning pair distance (possibly 0) for chars *name1* and *name2*.
get\_name\_char(*c*, *isord=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L430-L434)
Get the name of the character, i.e., ';' is 'semicolon'.
get\_str\_bbox(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L426-L428)
Return the string bounding box.
get\_str\_bbox\_and\_descent(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L396-L424)
Return the string bounding box and the maximal descent.
get\_underline\_thickness()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L516-L518)
Return the underline thickness as float.
get\_vertical\_stem\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L527-L532)
Return the standard vertical stem width as float, or *None* if not specified in AFM file.
get\_weight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L500-L502)
Return the font weight, e.g., 'Bold' or 'Roman'.
get\_width\_char(*c*, *isord=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L436-L442)
Get the width of the character from the character metric WX field.
get\_width\_from\_char\_name(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L444-L446)
Get the width of the character from a type1 character name.
get\_xheight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L512-L514)
Return the xheight as float.
*property*postscript\_name
string\_width\_height(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py#L371-L394)
Return the string width (including kerning) and string height as a (*w*, *h*) tuple.
*class*matplotlib.\_afm.CharMetrics(*width*, *name*, *bbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
Represents the character metrics of a single character.
#### Notes
The fields do currently only describe a subset of character metrics information defined in the AFM standard.
Create new instance of CharMetrics(width, name, bbox)
bbox
The bbox of the character (B) as a tuple (*llx*, *lly*, *urx*, *ury*).
name
The character name (N).
width
The character width (WX).
*class*matplotlib.\_afm.CompositePart(*name*, *dx*, *dy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_afm.py)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
Represents the information on a composite element of a composite char.
Create new instance of CompositePart(name, dx, dy)
dx
x-displacement of the part from the origin.
dy
y-displacement of the part from the origin.
name
Name of the part, e.g. 'acute'.
matplotlib backend_gtk4agg, backend_gtk4cairo backend\_gtk4agg, backend\_gtk4cairo
====================================
**NOTE** These backends are not documented here, to avoid adding a dependency to building the docs.
matplotlib matplotlib.transforms matplotlib.transforms
=====================
Matplotlib includes a framework for arbitrary geometric transformations that is used determine the final position of all elements drawn on the canvas.
Transforms are composed into trees of [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode") objects whose actual value depends on their children. When the contents of children change, their parents are automatically invalidated. The next time an invalidated transform is accessed, it is recomputed to reflect those changes. This invalidation/caching approach prevents unnecessary recomputations of transforms, and contributes to better interactive performance.
For example, here is a graph of the transform tree used to plot data to the graph:
The framework can be used for both affine and non-affine transformations. However, for speed, we want use the backend renderers to perform affine transformations whenever possible. Therefore, it is possible to perform just the affine or non-affine part of a transformation on a set of data. The affine is always assumed to occur after the non-affine. For any transform:
```
full transform == non-affine part + affine part
```
The backends are not expected to handle non-affine transformations themselves.
See the tutorial [Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html) for examples of how to use transforms.
*class*matplotlib.transforms.Affine2D(*matrix=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1881-L2111)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A mutable 2D affine transformation.
Initialize an Affine transform from a 3x3 numpy float array:
```
a c e
b d f
0 0 1
```
If *matrix* is None, initialize with the identity transform.
\_\_init\_\_(*matrix=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1886-L1901)
Initialize an Affine transform from a 3x3 numpy float array:
```
a c e
b d f
0 0 1
```
If *matrix* is None, initialize with the identity transform.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1905-L1910)
Return str(self).
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1974-L1981)
Reset the underlying matrix to the identity transform.
*static*from\_values(*a*, *b*, *c*, *d*, *e*, *f*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1912-L1924)
Create a new Affine2D instance from the given values:
```
a c e
b d f
0 0 1
```
.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1926-L1939)
Get the underlying transformation matrix as a 3x3 numpy array:
```
a c e
b d f
0 0 1
```
.
*static*identity()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1963-L1972)
[*Deprecated*] Return a new [`Affine2D`](#matplotlib.transforms.Affine2D "matplotlib.transforms.Affine2D") object that is the identity transform.
Unless this transform will be mutated later on, consider using the faster [`IdentityTransform`](#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform") class instead.
#### Notes
Deprecated since version 3.6: Use Affine2D() instead.
rotate(*theta*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1983-L2004)
Add a rotation (in radians) to this transform in place.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
rotate\_around(*x*, *y*, *theta*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2016-L2024)
Add a rotation (in radians) around the point (x, y) in place.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
rotate\_deg(*degrees*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2006-L2014)
Add a rotation (in degrees) to this transform in place.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
rotate\_deg\_around(*x*, *y*, *degrees*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2026-L2036)
Add a rotation (in degrees) around the point (x, y) in place.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
scale(*sx*, *sy=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2051-L2072)
Add a scale in place.
If *sy* is None, the same scale is applied in both the *x*- and *y*-directions.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
set(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1954-L1961)
Set this transformation from the frozen copy of another [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase") object.
set\_matrix(*mtx*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1941-L1952)
Set the underlying transformation matrix from a 3x3 numpy array:
```
a c e
b d f
0 0 1
```
.
skew(*xShear*, *yShear*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2074-L2098)
Add a skew in place.
*xShear* and *yShear* are the shear angles along the *x*- and *y*-axes, respectively, in radians.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
skew\_deg(*xShear*, *yShear*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2100-L2111)
Add a skew in place.
*xShear* and *yShear* are the shear angles along the *x*- and *y*-axes, respectively, in degrees.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
translate(*tx*, *ty*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2038-L2049)
Add a translation in place.
Returns *self*, so this method can easily be chained with more calls to [`rotate()`](#matplotlib.transforms.Affine2D.rotate "matplotlib.transforms.Affine2D.rotate"), [`rotate_deg()`](#matplotlib.transforms.Affine2D.rotate_deg "matplotlib.transforms.Affine2D.rotate_deg"), [`translate()`](#matplotlib.transforms.Affine2D.translate "matplotlib.transforms.Affine2D.translate") and [`scale()`](#matplotlib.transforms.Affine2D.scale "matplotlib.transforms.Affine2D.scale").
*class*matplotlib.transforms.Affine2DBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1813-L1878)
Bases: [`AffineBase`](#matplotlib.transforms.AffineBase "matplotlib.transforms.AffineBase")
The base class of all 2D affine transformations.
2D affine transformations are performed using a 3x3 numpy array:
```
a c e
b d f
0 0 1
```
This class provides the read-only interface. For a mutable 2D affine transformation, use [`Affine2D`](#matplotlib.transforms.Affine2D "matplotlib.transforms.Affine2D").
Subclasses of this class will generally only need to override a constructor and `get_matrix()` that generates a custom 3x3 matrix.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_module\_\_*='matplotlib.transforms'*
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1832-L1834)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1869-L1878)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
*property*is\_separable
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
to\_values()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1841-L1846)
Return the values of the matrix as an `(a, b, c, d, e, f)` tuple.
transform\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1848-L1853)
Apply only the affine part of this transformation on the given array of values.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to `transform(values)`.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.transforms.Affine2DBase.input_dims "matplotlib.transforms.Affine2DBase.input_dims") or shape (N x [`input_dims`](#matplotlib.transforms.Affine2DBase.input_dims "matplotlib.transforms.Affine2DBase.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.transforms.Affine2DBase.output_dims "matplotlib.transforms.Affine2DBase.output_dims") or shape (N x [`output_dims`](#matplotlib.transforms.Affine2DBase.output_dims "matplotlib.transforms.Affine2DBase.output_dims")), depending on the input.
*class*matplotlib.transforms.AffineBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1763-L1810)
Bases: [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The base class of all affine transformations of any number of dimensions.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_array\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1773-L1775)
Array interface to get at this Transform's affine matrix.
\_\_eq\_\_(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1777-L1780)
Return self==value.
\_\_hash\_\_*=None*
\_\_init\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1769-L1771)
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_module\_\_*='matplotlib.transforms'*
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1808-L1810)
Get the affine part of this transform.
is\_affine*=True*
transform(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1782-L1784)
Apply this transformation on the given array of *values*.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_affine(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1786-L1789)
Apply only the affine part of this transformation on the given array of values.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to `transform(values)`.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_non\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1791-L1793)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1795-L1797)
Apply the transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
In some cases, this transform may insert curves into the path that began as line segments.
transform\_path\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1799-L1802)
Apply the affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1804-L1806)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
*class*matplotlib.transforms.AffineDeltaTransform(*transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2699-L2726)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A transform wrapper for transforming displacements between pairs of points.
This class is intended to be used to transform displacements ("position deltas") between pairs of points (e.g., as the `offset_transform` of [`Collection`](collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection")s): given a transform `t` such that `t =
AffineDeltaTransform(t) + offset`, `AffineDeltaTransform` satisfies `AffineDeltaTransform(a - b) == AffineDeltaTransform(a) -
AffineDeltaTransform(b)`.
This is implemented by forcing the offset components of the transform matrix to zero.
This class is experimental as of 3.3, and the API may change.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_init\_\_(*transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2716-L2718)
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2722-L2726)
Get the matrix for the affine part of this transform.
*class*matplotlib.transforms.Bbox(*points*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L673-L1077)
Bases: [`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
A mutable bounding box.
#### Examples
**Create from known bounds**
The default constructor takes the boundary "points" `[[xmin, ymin],
[xmax, ymax]]`.
```
>>> Bbox([[1, 1], [3, 7]])
Bbox([[1.0, 1.0], [3.0, 7.0]])
```
Alternatively, a Bbox can be created from the flattened points array, the so-called "extents" `(xmin, ymin, xmax, ymax)`
```
>>> Bbox.from_extents(1, 1, 3, 7)
Bbox([[1.0, 1.0], [3.0, 7.0]])
```
or from the "bounds" `(xmin, ymin, width, height)`.
```
>>> Bbox.from_bounds(1, 1, 2, 6)
Bbox([[1.0, 1.0], [3.0, 7.0]])
```
**Create from collections of points**
The "empty" object for accumulating Bboxs is the null bbox, which is a stand-in for the empty set.
```
>>> Bbox.null()
Bbox([[inf, inf], [-inf, -inf]])
```
Adding points to the null bbox will give you the bbox of those points.
```
>>> box = Bbox.null()
>>> box.update_from_data_xy([[1, 1]])
>>> box
Bbox([[1.0, 1.0], [1.0, 1.0]])
>>> box.update_from_data_xy([[2, 3], [3, 2]], ignore=False)
>>> box
Bbox([[1.0, 1.0], [3.0, 3.0]])
```
Setting `ignore=True` is equivalent to starting over from a null bbox.
```
>>> box.update_from_data_xy([[1, 1]], ignore=True)
>>> box
Bbox([[1.0, 1.0], [1.0, 1.0]])
```
Warning
It is recommended to always specify `ignore` explicitly. If not, the default value of `ignore` can be changed at any time by code with access to your Bbox, for example using the method [`ignore`](#matplotlib.transforms.Bbox.ignore "matplotlib.transforms.Bbox.ignore").
**Properties of the ``null`` bbox**
Note
The current behavior of [`Bbox.null()`](#matplotlib.transforms.Bbox.null "matplotlib.transforms.Bbox.null") may be surprising as it does not have all of the properties of the "empty set", and as such does not behave like a "zero" object in the mathematical sense. We may change that in the future (with a deprecation period).
The null bbox is the identity for intersections
```
>>> Bbox.intersection(Bbox([[1, 1], [3, 7]]), Bbox.null())
Bbox([[1.0, 1.0], [3.0, 7.0]])
```
except with itself, where it returns the full space.
```
>>> Bbox.intersection(Bbox.null(), Bbox.null())
Bbox([[-inf, -inf], [inf, inf]])
```
A union containing null will always return the full space (not the other set!)
```
>>> Bbox.union([Bbox([[0, 0], [0, 0]]), Bbox.null()])
Bbox([[-inf, -inf], [inf, inf]])
```
Parameters:
**points**ndarray
A 2x2 numpy array of the form `[[x0, y0], [x1, y1]]`.
\_\_annotations\_\_*={}*
\_\_format\_\_(*fmt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L831-L834)
Default object formatter.
\_\_init\_\_(*points*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L754-L772)
Parameters:
**points**ndarray
A 2x2 numpy array of the form `[[x0, y0], [x1, y1]]`.
\_\_module\_\_*='matplotlib.transforms'*
\_\_repr\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L839-L840)
Return repr(self).
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L836-L837)
Return str(self).
*property*bounds
Return ([`x0`](#matplotlib.transforms.Bbox.x0 "matplotlib.transforms.Bbox.x0"), [`y0`](#matplotlib.transforms.Bbox.y0 "matplotlib.transforms.Bbox.y0"), `width`, `height`).
*static*from\_bounds(*x0*, *y0*, *width*, *height*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L800-L807)
Create a new [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") from *x0*, *y0*, *width* and *height*.
*width* and *height* may be negative.
*static*from\_extents(*\*args*, *minpos=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L809-L829)
Create a new Bbox from *left*, *bottom*, *right* and *top*.
The *y*-axis increases upwards.
Parameters:
**left, bottom, right, top**float
The four extents of the bounding box.
**minpos**float or None
If this is supplied, the Bbox will have a minimum positive value set. This is useful when dealing with logarithmic scales and other scales where negative bounds result in floating point errors.
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L784-L788)
The base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values.
get\_points()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1039-L1045)
Get the points of the bounding box directly as a numpy array of the form: `[[x0, y0], [x1, y1]]`.
ignore(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L842-L854)
Set whether the existing bounds of the box should be ignored by subsequent calls to [`update_from_data_xy()`](#matplotlib.transforms.Bbox.update_from_data_xy "matplotlib.transforms.Bbox.update_from_data_xy").
valuebool
* When `True`, subsequent calls to [`update_from_data_xy()`](#matplotlib.transforms.Bbox.update_from_data_xy "matplotlib.transforms.Bbox.update_from_data_xy") will ignore the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `False`, subsequent calls to [`update_from_data_xy()`](#matplotlib.transforms.Bbox.update_from_data_xy "matplotlib.transforms.Bbox.update_from_data_xy") will include the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
*property*intervalx
The pair of *x* coordinates that define the bounding box.
This is not guaranteed to be sorted from left to right.
*property*intervaly
The pair of *y* coordinates that define the bounding box.
This is not guaranteed to be sorted from bottom to top.
*property*minpos
The minimum positive value in both directions within the Bbox.
This is useful when dealing with logarithmic scales and other scales where negative bounds result in floating point errors, and will be used as the minimum extent instead of *p0*.
*property*minposx
The minimum positive value in the *x*-direction within the Bbox.
This is useful when dealing with logarithmic scales and other scales where negative bounds result in floating point errors, and will be used as the minimum *x*-extent instead of *x0*.
*property*minposy
The minimum positive value in the *y*-direction within the Bbox.
This is useful when dealing with logarithmic scales and other scales where negative bounds result in floating point errors, and will be used as the minimum *y*-extent instead of *y0*.
mutated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1065-L1067)
Return whether the bbox has changed since init.
mutatedx()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1069-L1072)
Return whether the x-limits have changed since init.
mutatedy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1074-L1077)
Return whether the y-limits have changed since init.
*static*null()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L795-L798)
Create a new null [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") from (inf, inf) to (-inf, -inf).
*property*p0
The first pair of (*x*, *y*) coordinates that define the bounding box.
This is not guaranteed to be the bottom-left corner (for that, use `min`).
*property*p1
The second pair of (*x*, *y*) coordinates that define the bounding box.
This is not guaranteed to be the top-right corner (for that, use `max`).
set(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1057-L1063)
Set this bounding box from the "frozen" bounds of another [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
set\_points(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1047-L1055)
Set the points of the bounding box directly from a numpy array of the form: `[[x0, y0], [x1, y1]]`. No error checking is performed, as this method is mainly for internal use.
*static*unit()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L790-L793)
Create a new unit [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") from (0, 0) to (1, 1).
update\_from\_data\_x(*x*, *ignore=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L892-L910)
Update the x-bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") based on the passed in data. After updating, the bounds will have positive *width*, and *x0* will be the minimal value.
Parameters:
**x**ndarray
Array of x-values.
**ignore**bool, optional
* When `True`, ignore the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `False`, include the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `None`, use the last value passed to [`ignore()`](#matplotlib.transforms.Bbox.ignore "matplotlib.transforms.Bbox.ignore").
update\_from\_data\_xy(*xy*, *ignore=None*, *updatex=True*, *updatey=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L932-L956)
Update the bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") based on the passed in data. After updating, the bounds will have positive *width* and *height*; *x0* and *y0* will be the minimal values.
Parameters:
**xy**ndarray
A numpy array of 2D points.
**ignore**bool, optional
* When `True`, ignore the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `False`, include the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `None`, use the last value passed to [`ignore()`](#matplotlib.transforms.Bbox.ignore "matplotlib.transforms.Bbox.ignore").
**updatex, updatey**bool, default: True
When `True`, update the x/y values.
update\_from\_data\_y(*y*, *ignore=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L912-L930)
Update the y-bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") based on the passed in data. After updating, the bounds will have positive *height*, and *y0* will be the minimal value.
Parameters:
**y**ndarray
Array of y-values.
**ignore**bool, optional
* When `True`, ignore the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `False`, include the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* When `None`, use the last value passed to [`ignore()`](#matplotlib.transforms.Bbox.ignore "matplotlib.transforms.Bbox.ignore").
update\_from\_path(*path*, *ignore=None*, *updatex=True*, *updatey=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L856-L890)
Update the bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") to contain the vertices of the provided path. After updating, the bounds will have positive *width* and *height*; *x0* and *y0* will be the minimal values.
Parameters:
**path**[`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
**ignore**bool, optional
* when `True`, ignore the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* when `False`, include the existing bounds of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
* when `None`, use the last value passed to [`ignore()`](#matplotlib.transforms.Bbox.ignore "matplotlib.transforms.Bbox.ignore").
**updatex, updatey**bool, default: True
When `True`, update the x/y values.
*property*x0
The first of the pair of *x* coordinates that define the bounding box.
This is not guaranteed to be less than [`x1`](#matplotlib.transforms.Bbox.x1 "matplotlib.transforms.Bbox.x1") (for that, use `xmin`).
*property*x1
The second of the pair of *x* coordinates that define the bounding box.
This is not guaranteed to be greater than [`x0`](#matplotlib.transforms.Bbox.x0 "matplotlib.transforms.Bbox.x0") (for that, use `xmax`).
*property*y0
The first of the pair of *y* coordinates that define the bounding box.
This is not guaranteed to be less than [`y1`](#matplotlib.transforms.Bbox.y1 "matplotlib.transforms.Bbox.y1") (for that, use `ymin`).
*property*y1
The second of the pair of *y* coordinates that define the bounding box.
This is not guaranteed to be greater than [`y0`](#matplotlib.transforms.Bbox.y0 "matplotlib.transforms.Bbox.y0") (for that, use `ymax`).
*class*matplotlib.transforms.BboxBase(*shorthand\_name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L222-L670)
Bases: [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode")
The base class of all bounding boxes.
This class is immutable; [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") is a mutable subclass.
The canonical representation is as two points, with no restrictions on their ordering. Convenience properties are provided to get the left, bottom, right and top edges and width and height, but these are not stored explicitly.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_array\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L250-L251)
\_\_module\_\_*='matplotlib.transforms'*
anchored(*c*, *container=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L493-L521)
Return a copy of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") anchored to *c* within *container*.
Parameters:
**c**(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
Either an (*x*, *y*) pair of relative coordinates (0 is left or bottom, 1 is right or top), 'C' (center), or a cardinal direction ('SW', southwest, is bottom left, etc.).
**container**[`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), optional
The box within which the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") is positioned; it defaults to the initial [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
See also
[`Axes.set_anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor")
*property*bounds
Return ([`x0`](#matplotlib.transforms.BboxBase.x0 "matplotlib.transforms.BboxBase.x0"), [`y0`](#matplotlib.transforms.BboxBase.y0 "matplotlib.transforms.BboxBase.y0"), [`width`](#matplotlib.transforms.BboxBase.width "matplotlib.transforms.BboxBase.width"), [`height`](#matplotlib.transforms.BboxBase.height "matplotlib.transforms.BboxBase.height")).
coefs*={'C': (0.5, 0.5), 'E': (1.0, 0.5), 'N': (0.5, 1.0), 'NE': (1.0, 1.0), 'NW': (0, 1.0), 'S': (0.5, 0), 'SE': (1.0, 0), 'SW': (0, 0), 'W': (0, 0.5)}*
contains(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L407-L411)
Return whether `(x, y)` is in the bounding box or on its edge.
containsx(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L393-L398)
Return whether *x* is in the closed ([`x0`](#matplotlib.transforms.BboxBase.x0 "matplotlib.transforms.BboxBase.x0"), [`x1`](#matplotlib.transforms.BboxBase.x1 "matplotlib.transforms.BboxBase.x1")) interval.
containsy(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L400-L405)
Return whether *y* is in the closed ([`y0`](#matplotlib.transforms.BboxBase.y0 "matplotlib.transforms.BboxBase.y0"), [`y1`](#matplotlib.transforms.BboxBase.y1 "matplotlib.transforms.BboxBase.y1")) interval.
corners()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L628-L636)
Return the corners of this rectangle as an array of points.
Specifically, this returns the array `[[x0, y0], [x0, y1], [x1, y0], [x1, y1]]`.
count\_contains(*vertices*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L580-L594)
Count the number of vertices contained in the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"). Any vertices with a non-finite x or y value are ignored.
Parameters:
**vertices**Nx2 Numpy array.
count\_overlaps(*bboxes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L596-L605)
Count the number of bounding boxes that overlap this one.
Parameters:
**bboxes**sequence of [`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
expanded(*sw*, *sh*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L607-L617)
Construct a [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") by expanding this one around its center by the factors *sw* and *sh*.
*property*extents
Return ([`x0`](#matplotlib.transforms.BboxBase.x0 "matplotlib.transforms.BboxBase.x0"), [`y0`](#matplotlib.transforms.BboxBase.y0 "matplotlib.transforms.BboxBase.y0"), [`x1`](#matplotlib.transforms.BboxBase.x1 "matplotlib.transforms.BboxBase.x1"), [`y1`](#matplotlib.transforms.BboxBase.y1 "matplotlib.transforms.BboxBase.y1")).
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L246-L247)
The base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values.
fully\_contains(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L447-L451)
Return whether `x, y` is in the bounding box, but not on its edge.
fully\_containsx(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L433-L438)
Return whether *x* is in the open ([`x0`](#matplotlib.transforms.BboxBase.x0 "matplotlib.transforms.BboxBase.x0"), [`x1`](#matplotlib.transforms.BboxBase.x1 "matplotlib.transforms.BboxBase.x1")) interval.
fully\_containsy(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L440-L445)
Return whether *y* is in the open ([`y0`](#matplotlib.transforms.BboxBase.y0 "matplotlib.transforms.BboxBase.y0"), [`y1`](#matplotlib.transforms.BboxBase.y1 "matplotlib.transforms.BboxBase.y1")) interval.
fully\_overlaps(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L453-L472)
Return whether this bounding box overlaps with the other bounding box, not including the edges.
Parameters:
**other**[`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
get\_points()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L390-L391)
*property*height
The (signed) height of the bounding box.
*static*intersection(*bbox1*, *bbox2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L660-L670)
Return the intersection of *bbox1* and *bbox2* if they intersect, or None if they don't.
*property*intervalx
The pair of *x* coordinates that define the bounding box.
This is not guaranteed to be sorted from left to right.
*property*intervaly
The pair of *y* coordinates that define the bounding box.
This is not guaranteed to be sorted from bottom to top.
is\_affine*=True*
is\_bbox*=True*
*property*max
The top-right corner of the bounding box.
*property*min
The bottom-left corner of the bounding box.
overlaps(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L413-L431)
Return whether this bounding box overlaps with the other bounding box.
Parameters:
**other**[`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
*property*p0
The first pair of (*x*, *y*) coordinates that define the bounding box.
This is not guaranteed to be the bottom-left corner (for that, use [`min`](#matplotlib.transforms.BboxBase.min "matplotlib.transforms.BboxBase.min")).
*property*p1
The second pair of (*x*, *y*) coordinates that define the bounding box.
This is not guaranteed to be the top-right corner (for that, use [`max`](#matplotlib.transforms.BboxBase.max "matplotlib.transforms.BboxBase.max")).
padded(*p*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L619-L622)
Construct a [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") by padding this one on all four sides by *p*.
rotated(*radians*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L638-L647)
Return the axes-aligned bounding box that bounds the result of rotating this [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") by an angle of *radians*.
shrunk(*mx*, *my*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L523-L532)
Return a copy of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), shrunk by the factor *mx* in the *x* direction and the factor *my* in the *y* direction. The lower left corner of the box remains unchanged. Normally *mx* and *my* will be less than 1, but this is not enforced.
shrunk\_to\_aspect(*box\_aspect*, *container=None*, *fig\_aspect=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L534-L556)
Return a copy of the [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), shrunk so that it is as large as it can be while having the desired aspect ratio, *box\_aspect*. If the box coordinates are relative (i.e. fractions of a larger box such as a figure) then the physical aspect ratio of that figure is specified with *fig\_aspect*, so that *box\_aspect* can also be given as a ratio of the absolute dimensions, not the relative dimensions.
*property*size
The (signed) width and height of the bounding box.
splitx(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L558-L567)
Return a list of new [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") objects formed by splitting the original one with vertical lines at fractional positions given by *args*.
splity(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L569-L578)
Return a list of new [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") objects formed by splitting the original one with horizontal lines at fractional positions given by *args*.
transformed(*transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L474-L481)
Construct a [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") by statically transforming this one by *transform*.
translated(*tx*, *ty*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L624-L626)
Construct a [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") by translating this one by *tx* and *ty*.
*static*union(*bboxes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L649-L658)
Return a [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") that contains all of the given *bboxes*.
*property*width
The (signed) width of the bounding box.
*property*x0
The first of the pair of *x* coordinates that define the bounding box.
This is not guaranteed to be less than [`x1`](#matplotlib.transforms.BboxBase.x1 "matplotlib.transforms.BboxBase.x1") (for that, use [`xmin`](#matplotlib.transforms.BboxBase.xmin "matplotlib.transforms.BboxBase.xmin")).
*property*x1
The second of the pair of *x* coordinates that define the bounding box.
This is not guaranteed to be greater than [`x0`](#matplotlib.transforms.BboxBase.x0 "matplotlib.transforms.BboxBase.x0") (for that, use [`xmax`](#matplotlib.transforms.BboxBase.xmax "matplotlib.transforms.BboxBase.xmax")).
*property*xmax
The right edge of the bounding box.
*property*xmin
The left edge of the bounding box.
*property*y0
The first of the pair of *y* coordinates that define the bounding box.
This is not guaranteed to be less than [`y1`](#matplotlib.transforms.BboxBase.y1 "matplotlib.transforms.BboxBase.y1") (for that, use [`ymin`](#matplotlib.transforms.BboxBase.ymin "matplotlib.transforms.BboxBase.ymin")).
*property*y1
The second of the pair of *y* coordinates that define the bounding box.
This is not guaranteed to be greater than [`y0`](#matplotlib.transforms.BboxBase.y0 "matplotlib.transforms.BboxBase.y0") (for that, use [`ymax`](#matplotlib.transforms.BboxBase.ymax "matplotlib.transforms.BboxBase.ymax")).
*property*ymax
The top edge of the bounding box.
*property*ymin
The bottom edge of the bounding box.
*class*matplotlib.transforms.BboxTransform(*boxin*, *boxout*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2535-L2575)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
[`BboxTransform`](#matplotlib.transforms.BboxTransform "matplotlib.transforms.BboxTransform") linearly transforms points from one [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") to another.
Create a new [`BboxTransform`](#matplotlib.transforms.BboxTransform "matplotlib.transforms.BboxTransform") that linearly transforms points from *boxin* to *boxout*.
\_\_annotations\_\_*={}*
\_\_init\_\_(*boxin*, *boxout*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2542-L2555)
Create a new [`BboxTransform`](#matplotlib.transforms.BboxTransform "matplotlib.transforms.BboxTransform") that linearly transforms points from *boxin* to *boxout*.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2559-L2575)
Get the matrix for the affine part of this transform.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
*class*matplotlib.transforms.BboxTransformFrom(*boxin*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2637-L2670)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
[`BboxTransformFrom`](#matplotlib.transforms.BboxTransformFrom "matplotlib.transforms.BboxTransformFrom") linearly transforms points from a given [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") to the unit bounding box.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_init\_\_(*boxin*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2644-L2652)
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2656-L2670)
Get the matrix for the affine part of this transform.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
*class*matplotlib.transforms.BboxTransformTo(*boxout*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2578-L2614)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
[`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo") is a transformation that linearly transforms points from the unit bounding box to a given [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Create a new [`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo") that linearly transforms points from the unit bounding box to *boxout*.
\_\_annotations\_\_*={}*
\_\_init\_\_(*boxout*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2586-L2598)
Create a new [`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo") that linearly transforms points from the unit bounding box to *boxout*.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2602-L2614)
Get the matrix for the affine part of this transform.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
*class*matplotlib.transforms.BboxTransformToMaxOnly(*boxout*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2617-L2634)
Bases: [`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo")
[`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo") is a transformation that linearly transforms points from the unit bounding box to a given [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") with a fixed upper left of (0, 0).
Create a new [`BboxTransformTo`](#matplotlib.transforms.BboxTransformTo "matplotlib.transforms.BboxTransformTo") that linearly transforms points from the unit bounding box to *boxout*.
\_\_annotations\_\_*={}*
\_\_module\_\_*='matplotlib.transforms'*
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2622-L2634)
Get the matrix for the affine part of this transform.
*class*matplotlib.transforms.BlendedAffine2D(*x\_transform*, *y\_transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2275-L2325)
Bases: `_BlendedMixin`, [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A "blended" transform uses one transform for the *x*-direction, and another transform for the *y*-direction.
This version is an optimization for the case where both child transforms are of type [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase").
Create a new "blended" transform using *x\_transform* to transform the *x*-axis and *y\_transform* to transform the *y*-axis.
Both *x\_transform* and *y\_transform* must be 2D affine transforms.
You will generally not call this constructor directly but use the [`blended_transform_factory`](#matplotlib.transforms.blended_transform_factory "matplotlib.transforms.blended_transform_factory") function instead, which can determine automatically which kind of blended transform to create.
\_\_annotations\_\_*={}*
\_\_init\_\_(*x\_transform*, *y\_transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2286-L2310)
Create a new "blended" transform using *x\_transform* to transform the *x*-axis and *y\_transform* to transform the *y*-axis.
Both *x\_transform* and *y\_transform* must be 2D affine transforms.
You will generally not call this constructor directly but use the [`blended_transform_factory`](#matplotlib.transforms.blended_transform_factory "matplotlib.transforms.blended_transform_factory") function instead, which can determine automatically which kind of blended transform to create.
\_\_module\_\_*='matplotlib.transforms'*
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2312-L2325)
Get the matrix for the affine part of this transform.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
*class*matplotlib.transforms.BlendedGenericTransform(*x\_transform*, *y\_transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2182-L2272)
Bases: `_BlendedMixin`, [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
A "blended" transform uses one transform for the *x*-direction, and another transform for the *y*-direction.
This "generic" version can handle any given child transform in the *x*- and *y*-directions.
Create a new "blended" transform using *x\_transform* to transform the *x*-axis and *y\_transform* to transform the *y*-axis.
You will generally not call this constructor directly but use the [`blended_transform_factory`](#matplotlib.transforms.blended_transform_factory "matplotlib.transforms.blended_transform_factory") function instead, which can determine automatically which kind of blended transform to create.
\_\_annotations\_\_*={}*
\_\_init\_\_(*x\_transform*, *y\_transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2195-L2208)
Create a new "blended" transform using *x\_transform* to transform the *x*-axis and *y\_transform* to transform the *y*-axis.
You will generally not call this constructor directly but use the [`blended_transform_factory`](#matplotlib.transforms.blended_transform_factory "matplotlib.transforms.blended_transform_factory") function instead, which can determine automatically which kind of blended transform to create.
\_\_module\_\_*='matplotlib.transforms'*
contains\_branch(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2214-L2217)
Return whether the given transform is a sub-tree of this transform.
This routine uses transform equality to identify sub-trees, therefore in many situations it is object id which will be used.
For the case where the given transform represents the whole of this transform, returns True.
*property*depth
Return the number of transforms which have been chained together to form this Transform instance.
Note
For the special case of a Composite transform, the maximum depth of the two is returned.
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2223-L2225)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2259-L2272)
Get the affine part of this transform.
*property*has\_inverse
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2255-L2257)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
*property*is\_affine
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
is\_separable*=True*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
pass\_through*=True*
If pass\_through is True, all ancestors will always be invalidated, even if 'self' is already invalid.
transform\_non\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2227-L2253)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.transforms.BlendedGenericTransform.input_dims "matplotlib.transforms.BlendedGenericTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.transforms.BlendedGenericTransform.input_dims "matplotlib.transforms.BlendedGenericTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.transforms.BlendedGenericTransform.output_dims "matplotlib.transforms.BlendedGenericTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.transforms.BlendedGenericTransform.output_dims "matplotlib.transforms.BlendedGenericTransform.output_dims")), depending on the input.
*class*matplotlib.transforms.CompositeAffine2D(*a*, *b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2455-L2505)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A composite transform formed by applying transform *a* then transform *b*.
This version is an optimization that handles the case where both *a* and *b* are 2D affines.
Create a new composite transform that is the result of applying [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase") *a* then [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase") *b*.
You will generally not call this constructor directly but write `a +
b` instead, which will automatically choose the best kind of composite transform instance to create.
\_\_annotations\_\_*={}*
\_\_init\_\_(*a*, *b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2462-L2483)
Create a new composite transform that is the result of applying [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase") *a* then [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase") *b*.
You will generally not call this constructor directly but write `a +
b` instead, which will automatically choose the best kind of composite transform instance to create.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
*property*depth
Return the number of transforms which have been chained together to form this Transform instance.
Note
For the special case of a Composite transform, the maximum depth of the two is returned.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2497-L2505)
Get the matrix for the affine part of this transform.
*class*matplotlib.transforms.CompositeGenericTransform(*a*, *b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2342-L2452)
Bases: [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
A composite transform formed by applying transform *a* then transform *b*.
This "generic" version can handle any two arbitrary transformations.
Create a new composite transform that is the result of applying transform *a* then transform *b*.
You will generally not call this constructor directly but write `a +
b` instead, which will automatically choose the best kind of composite transform instance to create.
\_\_annotations\_\_*={}*
\_\_eq\_\_(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2396-L2401)
Return self==value.
\_\_hash\_\_*=None*
\_\_init\_\_(*a*, *b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2352-L2370)
Create a new composite transform that is the result of applying transform *a* then transform *b*.
You will generally not call this constructor directly but write `a +
b` instead, which will automatically choose the best kind of composite transform instance to create.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
*property*depth
Return the number of transforms which have been chained together to form this Transform instance.
Note
For the special case of a Composite transform, the maximum depth of the two is returned.
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2372-L2379)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2441-L2447)
Get the affine part of this transform.
*property*has\_inverse
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2449-L2452)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
*property*is\_affine
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
*property*is\_separable
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
pass\_through*=True*
If pass\_through is True, all ancestors will always be invalidated, even if 'self' is already invalid.
transform\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2418-L2420)
Apply only the affine part of this transformation on the given array of values.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to `transform(values)`.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_non\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2422-L2429)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2431-L2439)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
*class*matplotlib.transforms.IdentityTransform(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2114-L2161)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A special class that does one thing, the identity transform, in a fast way.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2121-L2123)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2155-L2157)
Get the affine part of this transform.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2127-L2129)
Get the matrix for the affine part of this transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2159-L2161)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2131-L2133)
Apply this transformation on the given array of *values*.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2135-L2137)
Apply only the affine part of this transformation on the given array of values.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to `transform(values)`.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_non\_affine(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2139-L2141)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
transform\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2143-L2145)
Apply the transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
In some cases, this transform may insert curves into the path that began as line segments.
transform\_path\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2147-L2149)
Apply the affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2151-L2153)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
*class*matplotlib.transforms.LockableBbox(*bbox*, *x0=None*, *y0=None*, *x1=None*, *y1=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1148-L1268)
Bases: [`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
A [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") where some elements may be locked at certain values.
When the child bounding box changes, the bounds of this bbox will update accordingly with the exception of the locked elements.
Parameters:
**bbox**[`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The child bounding box to wrap.
**x0**float or None
The locked value for x0, or None to leave unlocked.
**y0**float or None
The locked value for y0, or None to leave unlocked.
**x1**float or None
The locked value for x1, or None to leave unlocked.
**y1**float or None
The locked value for y1, or None to leave unlocked.
\_\_annotations\_\_*={}*
\_\_init\_\_(*bbox*, *x0=None*, *y0=None*, *x1=None*, *y1=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1155-L1184)
Parameters:
**bbox**[`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The child bounding box to wrap.
**x0**float or None
The locked value for x0, or None to leave unlocked.
**y0**float or None
The locked value for y0, or None to leave unlocked.
**x1**float or None
The locked value for x1, or None to leave unlocked.
**y1**float or None
The locked value for y1, or None to leave unlocked.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_points()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1188-L1196)
*property*locked\_x0
float or None: The value used for the locked x0.
*property*locked\_x1
float or None: The value used for the locked x1.
*property*locked\_y0
float or None: The value used for the locked y0.
*property*locked\_y1
float or None: The value used for the locked y1.
*class*matplotlib.transforms.ScaledTranslation(*xt*, *yt*, *scale\_trans*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2673-L2696)
Bases: [`Affine2DBase`](#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
A transformation that translates by *xt* and *yt*, after *xt* and *yt* have been transformed by *scale\_trans*.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_annotations\_\_*={}*
\_\_init\_\_(*xt*, *yt*, *scale\_trans*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2678-L2684)
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2688-L2696)
Get the matrix for the affine part of this transform.
*class*matplotlib.transforms.Transform(*shorthand\_name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1271-L1677)
Bases: [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode")
The base class of all [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode") instances that actually perform a transformation.
All non-affine transformations should be subclasses of this class. New affine transformations should be subclasses of [`Affine2D`](#matplotlib.transforms.Affine2D "matplotlib.transforms.Affine2D").
Subclasses of this class should override the following members (at minimum):
* [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims")
* [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims")
* [`transform()`](#matplotlib.transforms.Transform.transform "matplotlib.transforms.Transform.transform")
* [`inverted()`](#matplotlib.transforms.Transform.inverted "matplotlib.transforms.Transform.inverted") (if an inverse exists)
The following attributes may be overridden if the default is unsuitable:
* [`is_separable`](#matplotlib.transforms.Transform.is_separable "matplotlib.transforms.Transform.is_separable") (defaults to True for 1D -> 1D transforms, False otherwise)
* [`has_inverse`](#matplotlib.transforms.Transform.has_inverse "matplotlib.transforms.Transform.has_inverse") (defaults to True if [`inverted()`](#matplotlib.transforms.Transform.inverted "matplotlib.transforms.Transform.inverted") is overridden, False otherwise)
If the transform needs to do something non-standard with [`matplotlib.path.Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") objects, such as adding curves where there were once line segments, it should override:
* [`transform_path()`](#matplotlib.transforms.Transform.transform_path "matplotlib.transforms.Transform.transform_path")
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_add\_\_(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1335-L1344)
Compose two transforms together so that *self* is followed by *other*.
`A + B` returns a transform `C` so that `C.transform(x) == B.transform(A.transform(x))`.
\_\_annotations\_\_*={}*
\_\_array\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1463-L1465)
Array interface to get at this Transform's affine matrix.
*classmethod*\_\_init\_subclass\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1319-L1333)
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
\_\_module\_\_*='matplotlib.transforms'*
\_\_sub\_\_(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1413-L1461)
Compose *self* with the inverse of *other*, cancelling identical terms if any:
```
# In general:
A - B == A + B.inverted()
# (but see note regarding frozen transforms below).
# If A "ends with" B (i.e. A == A' + B for some A') we can cancel
# out B:
(A' + B) - B == A'
# Likewise, if B "starts with" A (B = A + B'), we can cancel out A:
A - (A + B') == B'.inverted() == B'^-1
```
Cancellation (rather than naively returning `A + B.inverted()`) is important for multiple reasons:
* It avoids floating-point inaccuracies when computing the inverse of B: `B - B` is guaranteed to cancel out exactly (resulting in the identity transform), whereas `B + B.inverted()` may differ by a small epsilon.
* `B.inverted()` always returns a frozen transform: if one computes `A + B + B.inverted()` and later mutates `B`, then `B.inverted()` won't be updated and the last two terms won't cancel out anymore; on the other hand, `A + B - B` will always be equal to `A` even if `B` is mutated.
contains\_branch(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1376-L1393)
Return whether the given transform is a sub-tree of this transform.
This routine uses transform equality to identify sub-trees, therefore in many situations it is object id which will be used.
For the case where the given transform represents the whole of this transform, returns True.
contains\_branch\_seperately(*other\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1395-L1411)
Return whether the given branch is a sub-tree of this transform on each separate dimension.
A common use for this method is to identify if a transform is a blended transform containing an Axes' data transform. e.g.:
```
x_isdata, y_isdata = trans.contains_branch_seperately(ax.transData)
```
*property*depth
Return the number of transforms which have been chained together to form this Transform instance.
Note
For the special case of a Composite transform, the maximum depth of the two is returned.
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1564-L1566)
Get the affine part of this transform.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1568-L1570)
Get the matrix for the affine part of this transform.
has\_inverse*=False*
True if this transform has a corresponding inverse transform.
input\_dims*=None*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1667-L1677)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
is\_separable*=False*
True if this transform is separable in the x- and y- dimensions.
output\_dims*=None*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1467-L1502)
Apply this transformation on the given array of *values*.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims") or shape (N x [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims") or shape (N x [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims")), depending on the input.
transform\_affine(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1504-L1528)
Apply only the affine part of this transformation on the given array of values.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally a no-op. In affine transformations, this is equivalent to `transform(values)`.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims") or shape (N x [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims") or shape (N x [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims")), depending on the input.
transform\_angles(*angles*, *pts*, *radians=False*, *pushoff=1e-05*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1618-L1665)
Transform a set of angles anchored at specific locations.
Parameters:
**angles**(N,) array-like
The angles to transform.
**pts**(N, 2) array-like
The points where the angles are anchored.
**radians**bool, default: False
Whether *angles* are radians or degrees.
**pushoff**float
For each point in *pts* and angle in *angles*, the transformed angle is computed by transforming a segment of length *pushoff* starting at that point and making that angle relative to the horizontal axis, and measuring the angle between the horizontal axis and the transformed segment.
Returns:
(N,) array
transform\_bbox(*bbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1555-L1562)
Transform the given bounding box.
For smarter transforms including caching (a common requirement in Matplotlib), see [`TransformedBbox`](#matplotlib.transforms.TransformedBbox "matplotlib.transforms.TransformedBbox").
transform\_non\_affine(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1530-L1553)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims") or shape (N x [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims") or shape (N x [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims")), depending on the input.
transform\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1588-L1595)
Apply the transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
In some cases, this transform may insert curves into the path that began as line segments.
transform\_path\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1597-L1605)
Apply the affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1607-L1616)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
transform\_point(*point*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1572-L1586)
Return a transformed point.
This function is only kept for backcompatibility; the more general [`transform`](#matplotlib.transforms.Transform.transform "matplotlib.transforms.Transform.transform") method is capable of transforming both a list of points and a single point.
The point is given as a sequence of length [`input_dims`](#matplotlib.transforms.Transform.input_dims "matplotlib.transforms.Transform.input_dims"). The transformed point is returned as a sequence of length [`output_dims`](#matplotlib.transforms.Transform.output_dims "matplotlib.transforms.Transform.output_dims").
*class*matplotlib.transforms.TransformNode(*shorthand\_name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L84-L219)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
INVALID*=3*
INVALID\_AFFINE*=2*
INVALID\_NON\_AFFINE*=1*
\_\_annotations\_\_*={}*
\_\_copy\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L145-L155)
\_\_dict\_\_*=mappingproxy({'\_\_module\_\_': 'matplotlib.transforms', '\_\_doc\_\_': '\n The base class for anything that participates in the transform tree\n and needs to invalidate its parents or be invalidated. This includes\n classes that are not really transforms, such as bounding boxes, since some\n transforms depend on bounding boxes to compute their values.\n ', 'INVALID\_NON\_AFFINE': 1, 'INVALID\_AFFINE': 2, 'INVALID': 3, 'is\_affine': False, 'is\_bbox': False, 'pass\_through': False, '\_\_init\_\_': <function TransformNode.\_\_init\_\_>, '\_\_getstate\_\_': <function TransformNode.\_\_getstate\_\_>, '\_\_setstate\_\_': <function TransformNode.\_\_setstate\_\_>, '\_\_copy\_\_': <function TransformNode.\_\_copy\_\_>, 'invalidate': <function TransformNode.invalidate>, '\_invalidate\_internal': <function TransformNode.\_invalidate\_internal>, 'set\_children': <function TransformNode.set\_children>, 'frozen': <function TransformNode.frozen>, '\_\_dict\_\_': <attribute '\_\_dict\_\_' of 'TransformNode' objects>, '\_\_weakref\_\_': <attribute '\_\_weakref\_\_' of 'TransformNode' objects>, '\_\_annotations\_\_': {}})*
\_\_getstate\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L131-L134)
\_\_init\_\_(*shorthand\_name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L110-L124)
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
\_\_module\_\_*='matplotlib.transforms'*
\_\_setstate\_\_(*data\_dict*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L136-L143)
\_\_weakref\_\_
list of weak references to the object (if defined)
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L212-L219)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
invalidate()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L157-L165)
Invalidate this [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode") and triggers an invalidation of its ancestors. Should be called any time the transform changes.
is\_affine*=False*
is\_bbox*=False*
pass\_through*=False*
If pass\_through is True, all ancestors will always be invalidated, even if 'self' is already invalid.
set\_children(*\*children*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L194-L210)
Set the children of the transform, to let the invalidation system know which transforms can invalidate this transform. Should be called from the constructor of any transforms that depend on other transforms.
*class*matplotlib.transforms.TransformWrapper(*child*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1680-L1760)
Bases: [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
A helper class that holds a single child transform and acts equivalently to it.
This is useful if a node of the transform tree must be replaced at run time with a transform of a different type. This class allows that replacement to correctly trigger invalidation.
[`TransformWrapper`](#matplotlib.transforms.TransformWrapper "matplotlib.transforms.TransformWrapper") instances must have the same input and output dimensions during their entire lifetime, so the child transform may only be replaced with another child transform of the same dimensions.
*child*: A [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance. This child may later be replaced with [`set()`](#matplotlib.transforms.TransformWrapper.set "matplotlib.transforms.TransformWrapper.set").
\_\_annotations\_\_*={}*
\_\_eq\_\_(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1712-L1713)
Return self==value.
\_\_hash\_\_*=None*
\_\_init\_\_(*child*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1696-L1703)
*child*: A [`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance. This child may later be replaced with [`set()`](#matplotlib.transforms.TransformWrapper.set "matplotlib.transforms.TransformWrapper.set").
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
frozen()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1717-L1719)
Return a frozen copy of this transform node. The frozen copy will not be updated when its children change. Useful for storing a previously known state of a transform where `copy.deepcopy()` might normally be used.
*property*has\_inverse
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
*property*is\_affine
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
*property*is\_separable
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
pass\_through*=True*
If pass\_through is True, all ancestors will always be invalidated, even if 'self' is already invalid.
set(*child*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1738-L1756)
Replace the current child of this transform with another one.
The new child must have the same number of input and output dimensions as the current child.
*class*matplotlib.transforms.TransformedBbox(*bbox*, *transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1080-L1145)
Bases: [`BboxBase`](#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
A [`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") that is automatically transformed by a given transform. When either the child bounding box or transform changes, the bounds of this bbox will update accordingly.
Parameters:
**bbox**[`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
**transform**[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
\_\_annotations\_\_*={}*
\_\_init\_\_(*bbox*, *transform*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1087-L1105)
Parameters:
**bbox**[`Bbox`](#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
**transform**[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
\_\_module\_\_*='matplotlib.transforms'*
\_\_str\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L75-L81)
Return str(self).
get\_points()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L1109-L1137)
*class*matplotlib.transforms.TransformedPatchPath(*patch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2800-L2824)
Bases: [`TransformedPath`](#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath")
A [`TransformedPatchPath`](#matplotlib.transforms.TransformedPatchPath "matplotlib.transforms.TransformedPatchPath") caches a non-affine transformed copy of the [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch"). This cached copy is automatically updated when the non-affine part of the transform or the patch changes.
Parameters:
**patch**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
\_\_annotations\_\_*={}*
\_\_init\_\_(*patch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2807-L2815)
Parameters:
**patch**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
\_\_module\_\_*='matplotlib.transforms'*
*class*matplotlib.transforms.TransformedPath(*path*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2729-L2797)
Bases: [`TransformNode`](#matplotlib.transforms.TransformNode "matplotlib.transforms.TransformNode")
A [`TransformedPath`](#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") caches a non-affine transformed copy of the [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"). This cached copy is automatically updated when the non-affine part of the transform changes.
Note
Paths are considered immutable by this class. Any update to the path's vertices/codes will not trigger a transform recomputation.
Parameters:
**path**[`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
**transform**[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
\_\_annotations\_\_*={}*
\_\_init\_\_(*path*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2741-L2754)
Parameters:
**path**[`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
**transform**[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
\_\_module\_\_*='matplotlib.transforms'*
get\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2796-L2797)
get\_fully\_transformed\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2789-L2794)
Return a fully-transformed copy of the child path.
get\_transformed\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2780-L2787)
Return a copy of the child path, with the non-affine part of the transform already applied, along with the affine part of the path necessary to complete the transformation.
get\_transformed\_points\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2769-L2778)
Return a copy of the child path, with the non-affine part of the transform already applied, along with the affine part of the path necessary to complete the transformation. Unlike [`get_transformed_path_and_affine()`](#matplotlib.transforms.TransformedPath.get_transformed_path_and_affine "matplotlib.transforms.TransformedPath.get_transformed_path_and_affine"), no interpolation will be performed.
matplotlib.transforms.blended\_transform\_factory(*x\_transform*, *y\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2328-L2339)
Create a new "blended" transform using *x\_transform* to transform the *x*-axis and *y\_transform* to transform the *y*-axis.
A faster version of the blended transform is returned for the case where both child transforms are affine.
matplotlib.transforms.composite\_transform\_factory(*a*, *b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2508-L2532)
Create a new composite transform that is the result of applying transform a then transform b.
Shortcut versions of the blended transform are provided for the case where both child transforms are affine, or one or the other is the identity transform.
Composite transforms may also be created using the '+' operator, e.g.:
```
c = a + b
```
matplotlib.transforms.interval\_contains(*interval*, *val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2885-L2904)
Check, inclusively, whether an interval includes a given value.
Parameters:
**interval**(float, float)
The endpoints of the interval.
**val**float
Value to check is within interval.
Returns:
bool
Whether *val* is within the *interval*.
matplotlib.transforms.interval\_contains\_open(*interval*, *val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2936-L2953)
Check, excluding endpoints, whether an interval includes a given value.
Parameters:
**interval**(float, float)
The endpoints of the interval.
**val**float
Value to check is within interval.
Returns:
bool
Whether *val* is within the *interval*.
matplotlib.transforms.nonsingular(*vmin*, *vmax*, *expander=0.001*, *tiny=1e-15*, *increasing=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2827-L2882)
Modify the endpoints of a range as needed to avoid singularities.
Parameters:
**vmin, vmax**float
The initial endpoints.
**expander**float, default: 0.001
Fractional amount by which *vmin* and *vmax* are expanded if the original interval is too small, based on *tiny*.
**tiny**float, default: 1e-15
Threshold for the ratio of the interval to the maximum absolute value of its endpoints. If the interval is smaller than this, it will be expanded. This value should be around 1e-15 or larger; otherwise the interval will be approaching the double precision resolution limit.
**increasing**bool, default: True
If True, swap *vmin*, *vmax* if *vmin* > *vmax*.
Returns:
**vmin, vmax**float
Endpoints, expanded and/or swapped if necessary. If either input is inf or NaN, or if both inputs are 0 or very close to zero, it returns -*expander*, *expander*.
matplotlib.transforms.offset\_copy(*trans*, *fig=None*, *x=0.0*, *y=0.0*, *units='inches'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/transforms.py#L2956-L2987)
Return a new transform with an added offset.
Parameters:
**trans**[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform") subclass
Any transform, to which offset will be applied.
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure"), default: None
Current figure. It can be None if *units* are 'dots'.
**x, y**float, default: 0.0
The offset to apply.
**units**{'inches', 'points', 'dots'}, default: 'inches'
Units of the offset.
Returns:
[`Transform`](#matplotlib.transforms.Transform "matplotlib.transforms.Transform") subclass
Transform with applied offset.
| programming_docs |
matplotlib matplotlib.bezier matplotlib.bezier
=================
A module providing some utility functions regarding Bezier path manipulation.
*class*matplotlib.bezier.BezierSegment(*control\_points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L181-L305)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A d-dimensional Bezier segment.
Parameters:
**control\_points**(N, d) array
Location of the *N* control points.
axis\_aligned\_extrema()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L275-L305)
Return the dimension and location of the curve's interior extrema.
The extrema are the points along the curve where one of its partial derivatives is zero.
Returns:
**dims**array of int
Index \(i\) of the partial derivative which is zero at each interior extrema.
**dzeros**array of float
Of same size as dims. The \(t\) such that \(d/dx\_i B(t) = 0\)
*property*control\_points
The control points of the curve.
*property*degree
Degree of the polynomial. One less the number of control points.
*property*dimension
The dimension of the curve.
point\_at\_t(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L218-L222)
Evaluate the curve at a single point, returning a tuple of *d* floats.
*property*polynomial\_coefficients
The polynomial coefficients of the Bezier curve.
Warning
Follows opposite convention from [`numpy.polyval`](https://numpy.org/doc/stable/reference/generated/numpy.polyval.html#numpy.polyval "(in NumPy v1.23)").
Returns:
(n+1, d) array
Coefficients after expanding in polynomial basis, where \(n\) is the degree of the bezier curve and \(d\) its dimension. These are the numbers (\(C\_j\)) such that the curve can be written \(\sum\_{j=0}^n C\_j t^j\).
#### Notes
The coefficients are calculated as
\[{n \choose j} \sum\_{i=0}^j (-1)^{i+j} {j \choose i} P\_i\] where \(P\_i\) are the control points of the curve.
*exception*matplotlib.bezier.NonIntersectingPathException[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L25-L26)
Bases: [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)")
matplotlib.bezier.check\_if\_parallel(*dx1*, *dy1*, *dx2*, *dy2*, *tolerance=1e-05*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L432-L459)
Check if two lines are parallel.
Parameters:
**dx1, dy1, dx2, dy2**float
The gradients *dy*/*dx* of the two lines.
**tolerance**float
The angular tolerance in radians up to which the lines are considered parallel.
Returns:
is\_parallel
* 1 if two lines are parallel in same direction.
* -1 if two lines are parallel in opposite direction.
* False otherwise.
matplotlib.bezier.find\_bezier\_t\_intersecting\_with\_closedpath(*bezier\_point\_at\_t*, *inside\_closedpath*, *t0=0.0*, *t1=1.0*, *tolerance=0.01*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L113-L178)
Find the intersection of the Bezier curve with a closed path.
The intersection point *t* is approximated by two parameters *t0*, *t1* such that *t0* <= *t* <= *t1*.
Search starts from *t0* and *t1* and uses a simple bisecting algorithm therefore one of the end points must be inside the path while the other doesn't. The search stops when the distance of the points parametrized by *t0* and *t1* gets smaller than the given *tolerance*.
Parameters:
**bezier\_point\_at\_t**callable
A function returning x, y coordinates of the Bezier at parameter *t*. It must have the signature:
```
bezier_point_at_t(t: float) -> tuple[float, float]
```
**inside\_closedpath**callable
A function returning True if a given point (x, y) is inside the closed path. It must have the signature:
```
inside_closedpath(point: tuple[float, float]) -> bool
```
**t0, t1**float
Start parameters for the search.
**tolerance**float
Maximal allowed distance between the final points.
Returns:
**t0, t1**float
The Bezier path parameters.
matplotlib.bezier.find\_control\_points(*c1x*, *c1y*, *mmx*, *mmy*, *c2x*, *c2y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L536-L543)
Find control points of the Bezier curve passing through (*c1x*, *c1y*), (*mmx*, *mmy*), and (*c2x*, *c2y*), at parametric values 0, 0.5, and 1.
matplotlib.bezier.get\_cos\_sin(*x0*, *y0*, *x1*, *y1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L423-L429)
matplotlib.bezier.get\_intersection(*cx1*, *cy1*, *cos\_t1*, *sin\_t1*, *cx2*, *cy2*, *cos\_t2*, *sin\_t2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L32-L62)
Return the intersection between the line through (*cx1*, *cy1*) at angle *t1* and the line through (*cx2*, *cy2*) at angle *t2*.
matplotlib.bezier.get\_normal\_points(*cx*, *cy*, *cos\_t*, *sin\_t*, *length*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L65-L81)
For a line passing through (*cx*, *cy*) and having an angle *t*, return locations of the two points located along its perpendicular line at the distance of *length*.
matplotlib.bezier.get\_parallels(*bezier2*, *width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L462-L533)
Given the quadratic Bezier control points *bezier2*, returns control points of quadratic Bezier lines roughly parallel to given one separated by *width*.
matplotlib.bezier.inside\_circle(*cx*, *cy*, *r*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L404-L418)
Return a function that checks whether a point is in a circle with center (*cx*, *cy*) and radius *r*.
The returned function has the signature:
```
f(xy: tuple[float, float]) -> bool
```
matplotlib.bezier.make\_wedged\_bezier2(*bezier2*, *width*, *w1=1.0*, *wm=0.5*, *w2=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L546-L594)
Being similar to get\_parallels, returns control points of two quadratic Bezier lines having a width roughly parallel to given one separated by *width*.
matplotlib.bezier.split\_bezier\_intersecting\_with\_closedpath(*bezier*, *inside\_closedpath*, *tolerance=0.01*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L308-L337)
Split a Bezier curve into two at the intersection with a closed path.
Parameters:
**bezier**(N, 2) array-like
Control points of the Bezier segment. See [`BezierSegment`](#matplotlib.bezier.BezierSegment "matplotlib.bezier.BezierSegment").
**inside\_closedpath**callable
A function returning True if a given point (x, y) is inside the closed path. See also [`find_bezier_t_intersecting_with_closedpath`](#matplotlib.bezier.find_bezier_t_intersecting_with_closedpath "matplotlib.bezier.find_bezier_t_intersecting_with_closedpath").
**tolerance**float
The tolerance for the intersection. See also [`find_bezier_t_intersecting_with_closedpath`](#matplotlib.bezier.find_bezier_t_intersecting_with_closedpath "matplotlib.bezier.find_bezier_t_intersecting_with_closedpath").
Returns:
left, right
Lists of control points for the two Bezier segments.
matplotlib.bezier.split\_de\_casteljau(*beta*, *t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L95-L110)
Split a Bezier segment defined by its control points *beta* into two separate segments divided at *t* and return their control points.
matplotlib.bezier.split\_path\_inout(*path*, *inside*, *tolerance=0.01*, *reorder\_inout=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/bezier.py#L343-L401)
Divide a path into two segments at the point where `inside(x, y)` becomes False.
matplotlib matplotlib.category matplotlib.category
===================
Plotting of string "category" data: `plot(['d', 'f', 'a'], [1, 2, 3])` will plot three points with x-axis values of 'd', 'f', 'a'.
See [Plotting categorical variables](https://matplotlib.org/stable/gallery/lines_bars_and_markers/categorical_variables.html) for an example.
The module uses Matplotlib's [`matplotlib.units`](units_api#module-matplotlib.units "matplotlib.units") mechanism to convert from strings to integers and provides a tick locator, a tick formatter, and the [`UnitData`](#matplotlib.category.UnitData "matplotlib.category.UnitData") class that creates and stores the string-to-integer mapping.
*class*matplotlib.category.StrCategoryConverter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L26-L126)
Bases: [`ConversionInterface`](units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface")
*static*axisinfo(*unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L71-L96)
Set the default axis ticks and labels.
Parameters:
**unit**[`UnitData`](#matplotlib.category.UnitData "matplotlib.category.UnitData")
object string unit information for value
**axis**[`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
axis for which information is being set
Note
*axis* is not used
Returns:
[`AxisInfo`](units_api#matplotlib.units.AxisInfo "matplotlib.units.AxisInfo")
Information to support default tick labeling
*static*convert(*value*, *unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L27-L69)
Convert strings in *value* to floats using mapping information stored in the *unit* object.
Parameters:
**value**str or iterable
Value or list of values to be converted.
**unit**[`UnitData`](#matplotlib.category.UnitData "matplotlib.category.UnitData")
An object mapping strings to integers.
**axis**[`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
The axis on which the converted value is plotted.
Note
*axis* is unused.
Returns:
float or ndarray[float]
*static*default\_units(*data*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L98-L119)
Set and update the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") units.
Parameters:
**data**str or iterable of str
**axis**[`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis")
axis on which the data is plotted
Returns:
[`UnitData`](#matplotlib.category.UnitData "matplotlib.category.UnitData")
object storing string to integer mapping
*class*matplotlib.category.StrCategoryFormatter(*units\_mapping*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L149-L176)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
String representation of the data at every tick.
Parameters:
**units\_mapping**dict
Mapping of category names (str) to indices (int).
format\_ticks(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L164-L167)
Return the tick labels for all the ticks at once.
*class*matplotlib.category.StrCategoryLocator(*units\_mapping*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L129-L146)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Tick at every integer mapping of the string data.
Parameters:
**units\_mapping**dict
Mapping of category names (str) to indices (int).
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L144-L146)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.category.UnitData(*data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L179-L237)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Create mapping between unique categorical values and integer ids.
Parameters:
**data**iterable
sequence of string values
update(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/category.py#L209-L237)
Map new values to integer identifiers.
Parameters:
**data**iterable of str or bytes
Raises:
TypeError
If elements in *data* are neither str nor bytes.
matplotlib matplotlib.dates matplotlib.dates
================
Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python [`datetime`](https://docs.python.org/3/library/datetime.html#module-datetime "(in Python v3.10)") and the add-on module [dateutil](https://dateutil.readthedocs.io).
By default, Matplotlib uses the units machinery described in [`units`](units_api#module-matplotlib.units "matplotlib.units") to convert [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)"), and [`numpy.datetime64`](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.datetime64 "(in NumPy v1.23)") objects when plotted on an x- or y-axis. The user does not need to do anything for dates to be formatted, but dates often have strict formatting needs, so this module provides many axis locators and formatters. A basic example using [`numpy.datetime64`](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.datetime64 "(in NumPy v1.23)") is:
```
import numpy as np
times = np.arange(np.datetime64('2001-01-02'),
np.datetime64('2002-02-03'), np.timedelta64(75, 'm'))
y = np.random.randn(len(times))
fig, ax = plt.subplots()
ax.plot(times, y)
```
See also
* [Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html)
* [Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html)
* [Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html)
Matplotlib date format
----------------------
Matplotlib represents dates using floating point numbers specifying the number of days since a default epoch of 1970-01-01 UTC; for example, 1970-01-01, 06:00 is the floating point number 0.25. The formatters and locators require the use of [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") objects, so only dates between year 0001 and 9999 can be represented. Microsecond precision is achievable for (approximately) 70 years on either side of the epoch, and 20 microseconds for the rest of the allowable range of dates (year 0001 to 9999). The epoch can be changed at import time via [`dates.set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch") or `[rcParams["dates.epoch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=dates.epoch#matplotlibrc-sample)` to other dates if necessary; see [Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html) for a discussion.
Note
Before Matplotlib 3.3, the epoch was 0000-12-31 which lost modern microsecond precision and also made the default axis limit of 0 an invalid datetime. In 3.3 the epoch was changed as above. To convert old ordinal floats to the new epoch, users can do:
```
new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31'))
```
There are a number of helper functions to convert between [`datetime`](https://docs.python.org/3/library/datetime.html#module-datetime "(in Python v3.10)") objects and Matplotlib dates:
| | |
| --- | --- |
| [`datestr2num`](#matplotlib.dates.datestr2num "matplotlib.dates.datestr2num") | Convert a date string to a datenum using [`dateutil.parser.parse`](https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse "(in dateutil v2.8.2)"). |
| [`date2num`](#matplotlib.dates.date2num "matplotlib.dates.date2num") | Convert datetime objects to Matplotlib dates. |
| [`num2date`](#matplotlib.dates.num2date "matplotlib.dates.num2date") | Convert Matplotlib dates to [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") objects. |
| [`num2timedelta`](#matplotlib.dates.num2timedelta "matplotlib.dates.num2timedelta") | Convert number of days to a [`timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)") object. |
| [`drange`](#matplotlib.dates.drange "matplotlib.dates.drange") | Return a sequence of equally spaced Matplotlib dates. |
| [`set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch") | Set the epoch (origin for dates) for datetime calculations. |
| [`get_epoch`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch") | Get the epoch used by [`dates`](#module-matplotlib.dates "matplotlib.dates"). |
Note
Like Python's [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)"), Matplotlib uses the Gregorian calendar for all conversions between dates and floating point numbers. This practice is not universal, and calendar differences can cause confusing differences between what Python and Matplotlib give as the number of days since 0001-01-01 and what other software and databases yield. For example, the US Naval Observatory uses a calendar that switches from Julian to Gregorian in October, 1582. Hence, using their calculator, the number of days between 0001-01-01 and 2006-04-01 is 732403, whereas using the Gregorian calendar via the datetime module we find:
```
In [1]: date(2006, 4, 1).toordinal() - date(1, 1, 1).toordinal()
Out[1]: 732401
```
All the Matplotlib date converters, tickers and formatters are timezone aware. If no explicit timezone is provided, `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`) is assumed, provided as a string. If you want to use a different timezone, pass the *tz* keyword argument of [`num2date`](#matplotlib.dates.num2date "matplotlib.dates.num2date") to any date tickers or locators you create. This can be either a [`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)") instance or a string with the timezone name that can be parsed by [`gettz`](https://dateutil.readthedocs.io/en/stable/tz.html#dateutil.tz.gettz "(in dateutil v2.8.2)").
A wide range of specific and general purpose date tick locators and formatters are provided in this module. See [`matplotlib.ticker`](ticker_api#module-matplotlib.ticker "matplotlib.ticker") for general information on tick locators and formatters. These are described below.
The [dateutil](https://dateutil.readthedocs.io) module provides additional code to handle date ticking, making it easy to place ticks on any kinds of dates. See examples below.
Date tickers
------------
Most of the date tickers can locate single or multiple values. For example:
```
# import constants for the days of the week
from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
# tick on mondays every week
loc = WeekdayLocator(byweekday=MO, tz=tz)
# tick on mondays and saturdays
loc = WeekdayLocator(byweekday=(MO, SA))
```
In addition, most of the constructors take an interval argument:
```
# tick on mondays every second week
loc = WeekdayLocator(byweekday=MO, interval=2)
```
The rrule locator allows completely general date ticking:
```
# tick every 5th easter
rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
loc = RRuleLocator(rule)
```
The available date tickers are:
* [`MicrosecondLocator`](#matplotlib.dates.MicrosecondLocator "matplotlib.dates.MicrosecondLocator"): Locate microseconds.
* [`SecondLocator`](#matplotlib.dates.SecondLocator "matplotlib.dates.SecondLocator"): Locate seconds.
* [`MinuteLocator`](#matplotlib.dates.MinuteLocator "matplotlib.dates.MinuteLocator"): Locate minutes.
* [`HourLocator`](#matplotlib.dates.HourLocator "matplotlib.dates.HourLocator"): Locate hours.
* [`DayLocator`](#matplotlib.dates.DayLocator "matplotlib.dates.DayLocator"): Locate specified days of the month.
* [`WeekdayLocator`](#matplotlib.dates.WeekdayLocator "matplotlib.dates.WeekdayLocator"): Locate days of the week, e.g., MO, TU.
* [`MonthLocator`](#matplotlib.dates.MonthLocator "matplotlib.dates.MonthLocator"): Locate months, e.g., 7 for July.
* [`YearLocator`](#matplotlib.dates.YearLocator "matplotlib.dates.YearLocator"): Locate years that are multiples of base.
* [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator"): Locate using a [`rrulewrapper`](#matplotlib.dates.rrulewrapper "matplotlib.dates.rrulewrapper"). [`rrulewrapper`](#matplotlib.dates.rrulewrapper "matplotlib.dates.rrulewrapper") is a simple wrapper around [dateutil](https://dateutil.readthedocs.io)'s [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)") which allow almost arbitrary date tick specifications. See [rrule example](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html).
* [`AutoDateLocator`](#matplotlib.dates.AutoDateLocator "matplotlib.dates.AutoDateLocator"): On autoscale, this class picks the best [`DateLocator`](#matplotlib.dates.DateLocator "matplotlib.dates.DateLocator") (e.g., [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")) to set the view limits and the tick locations. If called with `interval_multiples=True` it will make ticks line up with sensible multiples of the tick intervals. E.g. if the interval is 4 hours, it will pick hours 0, 4, 8, etc as ticks. This behaviour is not guaranteed by default.
Date formatters
---------------
The available date formatters are:
* [`AutoDateFormatter`](#matplotlib.dates.AutoDateFormatter "matplotlib.dates.AutoDateFormatter"): attempts to figure out the best format to use. This is most useful when used with the [`AutoDateLocator`](#matplotlib.dates.AutoDateLocator "matplotlib.dates.AutoDateLocator").
* [`ConciseDateFormatter`](#matplotlib.dates.ConciseDateFormatter "matplotlib.dates.ConciseDateFormatter"): also attempts to figure out the best format to use, and to make the format as compact as possible while still having complete date information. This is most useful when used with the [`AutoDateLocator`](#matplotlib.dates.AutoDateLocator "matplotlib.dates.AutoDateLocator").
* [`DateFormatter`](#matplotlib.dates.DateFormatter "matplotlib.dates.DateFormatter"): use [`strftime`](https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime "(in Python v3.10)") format strings.
*class*matplotlib.dates.AutoDateFormatter(*locator*, *tz=None*, *defaultfmt='%Y-%m-%d'*, *\**, *usetex=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L858-L975)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
A [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") which attempts to figure out the best format to use. This is most useful when used with the [`AutoDateLocator`](#matplotlib.dates.AutoDateLocator "matplotlib.dates.AutoDateLocator").
[`AutoDateFormatter`](#matplotlib.dates.AutoDateFormatter "matplotlib.dates.AutoDateFormatter") has a `.scale` dictionary that maps tick scales (the interval in days between one major tick) to format strings; this dictionary defaults to
```
self.scaled = {
DAYS_PER_YEAR: rcParams['date.autoformatter.year'],
DAYS_PER_MONTH: rcParams['date.autoformatter.month'],
1: rcParams['date.autoformatter.day'],
1 / HOURS_PER_DAY: rcParams['date.autoformatter.hour'],
1 / MINUTES_PER_DAY: rcParams['date.autoformatter.minute'],
1 / SEC_PER_DAY: rcParams['date.autoformatter.second'],
1 / MUSECONDS_PER_DAY: rcParams['date.autoformatter.microsecond'],
}
```
The formatter uses the format string corresponding to the lowest key in the dictionary that is greater or equal to the current scale. Dictionary entries can be customized:
```
locator = AutoDateLocator()
formatter = AutoDateFormatter(locator)
formatter.scaled[1/(24*60)] = '%M:%S' # only show min and sec
```
Custom callables can also be used instead of format strings. The following example shows how to use a custom format function to strip trailing zeros from decimal seconds and adds the date to the first ticklabel:
```
def my_format_function(x, pos=None):
x = matplotlib.dates.num2date(x)
if pos == 0:
fmt = '%D %H:%M:%S.%f'
else:
fmt = '%H:%M:%S.%f'
label = x.strftime(fmt)
label = label.rstrip("0")
label = label.rstrip(".")
return label
formatter.scaled[1/(24*60)] = my_format_function
```
Autoformat the date labels.
Parameters:
**locator**[`ticker.Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Locator that this axis is using.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
**defaultfmt**str
The default format to use if none of the values in `self.scaled` are greater than the unit returned by `locator._get_unit()`.
**usetex**bool, default: `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`)
To enable/disable the use of TeX's math mode for rendering the results of the formatter. If any entries in `self.scaled` are set as functions, then it is up to the customized function to enable or disable TeX's math mode itself.
*class*matplotlib.dates.AutoDateLocator(*tz=None*, *minticks=5*, *maxticks=None*, *interval\_multiples=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1251-L1481)
Bases: [`DateLocator`](#matplotlib.dates.DateLocator "matplotlib.dates.DateLocator")
On autoscale, this class picks the best [`DateLocator`](#matplotlib.dates.DateLocator "matplotlib.dates.DateLocator") to set the view limits and the tick locations.
Attributes:
**intervald**dict
Mapping of tick frequencies to multiples allowed for that ticking. The default is
```
self.intervald = {
YEARLY : [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
1000, 2000, 4000, 5000, 10000],
MONTHLY : [1, 2, 3, 4, 6],
DAILY : [1, 2, 3, 7, 14, 21],
HOURLY : [1, 2, 3, 4, 6, 12],
MINUTELY: [1, 5, 10, 15, 30],
SECONDLY: [1, 5, 10, 15, 30],
MICROSECONDLY: [1, 2, 5, 10, 20, 50, 100, 200, 500,
1000, 2000, 5000, 10000, 20000, 50000,
100000, 200000, 500000, 1000000],
}
```
where the keys are defined in [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)").
The interval is used to specify multiples that are appropriate for the frequency of ticking. For instance, every 7 days is sensible for daily ticks, but for minutes/seconds, 15 or 30 make sense.
When customizing, you should only modify the values for the existing keys. You should not add or delete entries.
Example for forcing ticks every 3 hours:
```
locator = AutoDateLocator()
locator.intervald[HOURLY] = [3] # only show every 3 hours
```
Parameters:
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
**minticks**int
The minimum number of ticks desired; controls whether ticks occur yearly, monthly, etc.
**maxticks**int
The maximum number of ticks desired; controls the interval between ticks (ticking every other, every 3, etc.). For fine-grained control, this can be a dictionary mapping individual rrule frequency constants (YEARLY, MONTHLY, etc.) to their own maximum number of ticks. This can be used to keep the number of ticks appropriate to the format chosen in [`AutoDateFormatter`](#matplotlib.dates.AutoDateFormatter "matplotlib.dates.AutoDateFormatter"). Any frequency not specified in this dictionary is given a default value.
**interval\_multiples**bool, default: True
Whether ticks should be chosen to be multiple of the interval, locking them to 'nicer' locations. For example, this will force the ticks to be at hours 0, 6, 12, 18 when hourly ticking is done at 6 hour intervals.
get\_locator(*dmin*, *dmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1383-L1481)
Pick the best locator based on a distance.
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1363-L1375)
Given the proposed upper and lower extent, adjust the range if it is too close to being singular (i.e. a range of ~0).
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1360-L1361)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.dates.ConciseDateConverter(*formats=None*, *zero\_formats=None*, *offset\_formats=None*, *show\_offset=True*, *\**, *interval\_multiples=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1921-L1945)
Bases: [`DateConverter`](#matplotlib.dates.DateConverter "matplotlib.dates.DateConverter")
axisinfo(*unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1933-L1945)
Return the [`AxisInfo`](units_api#matplotlib.units.AxisInfo "matplotlib.units.AxisInfo") for *unit*.
*unit* is a tzinfo instance or None. The *axis* argument is required but not used.
*class*matplotlib.dates.ConciseDateFormatter(*locator*, *tz=None*, *formats=None*, *offset\_formats=None*, *zero\_formats=None*, *show\_offset=True*, *\**, *usetex=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L637-L855)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
A [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") which attempts to figure out the best format to use for the date, and to make it as compact as possible, but still be complete. This is most useful when used with the [`AutoDateLocator`](#matplotlib.dates.AutoDateLocator "matplotlib.dates.AutoDateLocator"):
```
>>> locator = AutoDateLocator()
>>> formatter = ConciseDateFormatter(locator)
```
Parameters:
**locator**[`ticker.Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Locator that this axis is using.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone, passed to [`dates.num2date`](#matplotlib.dates.num2date "matplotlib.dates.num2date").
**formats**list of 6 strings, optional
Format strings for 6 levels of tick labelling: mostly years, months, days, hours, minutes, and seconds. Strings use the same format codes as [`strftime`](https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime "(in Python v3.10)"). Default is `['%Y', '%b', '%d', '%H:%M', '%H:%M', '%S.%f']`
**zero\_formats**list of 6 strings, optional
Format strings for tick labels that are "zeros" for a given tick level. For instance, if most ticks are months, ticks around 1 Jan 2005 will be labeled "Dec", "2005", "Feb". The default is `['', '%Y', '%b', '%b-%d', '%H:%M', '%H:%M']`
**offset\_formats**list of 6 strings, optional
Format strings for the 6 levels that is applied to the "offset" string found on the right side of an x-axis, or top of a y-axis. Combined with the tick labels this should completely specify the date. The default is:
```
['', '%Y', '%Y-%b', '%Y-%b-%d', '%Y-%b-%d', '%Y-%b-%d %H:%M']
```
**show\_offset**bool, default: True
Whether to show the offset or not.
**usetex**bool, default: `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`)
To enable/disable the use of TeX's math mode for rendering the results of the formatter.
#### Examples
See [Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html)
([Source code](dates_api-1.py), [png](dates_api-1.png))
Autoformat the date labels. The default format is used to form an initial string, and then redundant elements are removed.
format\_data\_short(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L854-L855)
Return a short string version of the tick value.
Defaults to the position-independent long value.
format\_ticks(*values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L772-L849)
Return the tick labels for all the ticks at once.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L851-L852)
*class*matplotlib.dates.DateConverter(*\**, *interval\_multiples=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1861-L1918)
Bases: [`ConversionInterface`](units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface")
Converter for [`datetime.date`](https://docs.python.org/3/library/datetime.html#datetime.date "(in Python v3.10)") and [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") data, or for date/time data represented as it would be converted by [`date2num`](#matplotlib.dates.date2num "matplotlib.dates.date2num").
The 'unit' tag for such data is None or a tzinfo instance.
axisinfo(*unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1873-L1889)
Return the [`AxisInfo`](units_api#matplotlib.units.AxisInfo "matplotlib.units.AxisInfo") for *unit*.
*unit* is a tzinfo instance or None. The *axis* argument is required but not used.
*static*convert(*value*, *unit*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1891-L1899)
If *value* is not already a number or sequence of numbers, convert it with [`date2num`](#matplotlib.dates.date2num "matplotlib.dates.date2num").
The *unit* and *axis* arguments are not used.
*static*default\_units(*x*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1901-L1918)
Return the tzinfo instance of *x* or of its first element, or None
*class*matplotlib.dates.DateFormatter(*fmt*, *tz=None*, *\**, *usetex=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L606-L634)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Format a tick (in days since the epoch) with a [`strftime`](https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime "(in Python v3.10)") format string.
Parameters:
**fmt**str
[`strftime`](https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime "(in Python v3.10)") format string
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
**usetex**bool, default: `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`)
To enable/disable the use of TeX's math mode for rendering the results of the formatter.
set\_tzinfo(*tz*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L633-L634)
*class*matplotlib.dates.DateLocator(*tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1099-L1172)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Determines the tick locations when plotting dates.
This class is subclassed by other Locators and is not meant to be used on its own.
Parameters:
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
datalim\_to\_dt()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1128-L1134)
Convert axis data interval to datetime objects.
hms0d*={'byhour': 0, 'byminute': 0, 'bysecond': 0}*
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1156-L1172)
Given the proposed upper and lower extent, adjust the range if it is too close to being singular (i.e. a range of ~0).
set\_tzinfo(*tz*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1117-L1126)
Set timezone info.
Parameters:
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
viewlim\_to\_dt()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1136-L1141)
Convert the view interval to datetime objects.
*class*matplotlib.dates.DayLocator(*bymonthday=None*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1588-L1613)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each day of the month. For example, 1, 15, 30.
Parameters:
**bymonthday**int or list of int, default: all days
Ticks will be placed on every day in *bymonthday*. Default is `bymonthday=range(1, 32)`, i.e., every day of the month.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.HourLocator(*byhour=None*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1616-L1638)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each hour.
Parameters:
**byhour**int or list of int, default: all hours
Ticks will be placed on every hour in *byhour*. Default is `byhour=range(24)`, i.e., every hour.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.MicrosecondLocator(*interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1690-L1768)
Bases: [`DateLocator`](#matplotlib.dates.DateLocator "matplotlib.dates.DateLocator")
Make ticks on regular intervals of one or more microsecond(s).
Note
By default, Matplotlib uses a floating point representation of time in days since the epoch, so plotting data with microsecond time resolution does not work well for dates that are far (about 70 years) from the epoch (check with [`get_epoch`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch")).
If you want sub-microsecond resolution time plots, it is strongly recommended to use floating point seconds, not datetime-like time representation.
If you really must use datetime.datetime() or similar and still need microsecond precision, change the time origin via [`dates.set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch") to something closer to the dates being plotted. See [Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html).
Parameters:
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1726-L1728)
set\_data\_interval(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1735-L1738)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`Axis.set_data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") instead.
set\_view\_interval(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1730-L1733)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`Axis.set_view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") instead.
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1749-L1760)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.dates.MinuteLocator(*byminute=None*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1641-L1663)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each minute.
Parameters:
**byminute**int or list of int, default: all minutes
Ticks will be placed on every minutes in *byminutes*. Default is `byminute=range(60)`, i.e., every minute.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.MonthLocator(*bymonth=None*, *bymonthday=1*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1534-L1558)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each month, e.g., 1, 3, 12.
Parameters:
**bymonth**int or list of int, default: all months
Ticks will be placed on every month in *bymonth*. Default is `range(1, 13)`, i.e. every month.
**bymonthday**int, default: 1
The day on which to place the ticks.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.RRuleLocator(*o*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1175-L1248)
Bases: [`DateLocator`](#matplotlib.dates.DateLocator "matplotlib.dates.DateLocator")
Parameters:
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*static*get\_unit\_generic(*freq*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1227-L1245)
tick\_values(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1191-L1196)
Return the values of the located ticks given **vmin** and **vmax**.
Note
To get tick locations with the vmin and vmax values defined automatically for the associated `axis` simply call the Locator instance:
```
>>> print(type(loc))
<type 'Locator'>
>>> print(loc())
[1, 2, 3, 4]
```
*class*matplotlib.dates.SecondLocator(*bysecond=None*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1666-L1687)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each second.
Parameters:
**bysecond**int or list of int, default: all seconds
Ticks will be placed on every second in *bysecond*. Default is `bysecond = range(60)`, i.e., every second.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.WeekdayLocator(*byweekday=1*, *interval=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1561-L1585)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on occurrences of each weekday.
Parameters:
**byweekday**int or list of int, default: all days
Ticks will be placed on every weekday in *byweekday*. Default is every day.
Elements of *byweekday* must be one of MO, TU, WE, TH, FR, SA, SU, the constants from [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)"), which have been imported into the [`matplotlib.dates`](#module-matplotlib.dates "matplotlib.dates") namespace.
**interval**int, default: 1
The interval between each iteration. For example, if `interval=2`, mark every second occurrence.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
*class*matplotlib.dates.YearLocator(*base=1*, *month=1*, *day=1*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1484-L1531)
Bases: [`RRuleLocator`](#matplotlib.dates.RRuleLocator "matplotlib.dates.RRuleLocator")
Make ticks on a given day of each year that is a multiple of base.
Examples:
```
# Tick every year on Jan 1st
locator = YearLocator()
# Tick every 5 years on July 4th
locator = YearLocator(5, month=7, day=4)
```
Parameters:
**base**int, default: 1
Mark ticks every *base* years.
**month**int, default: 1
The month on which to place the ticks, starting from 1. Default is January.
**day**int, default: 1
The day on which to place the ticks.
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Ticks timezone. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
matplotlib.dates.date2num(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L412-L457)
Convert datetime objects to Matplotlib dates.
Parameters:
**d**[`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") or [`numpy.datetime64`](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.datetime64 "(in NumPy v1.23)") or sequences of these
Returns:
float or sequence of floats
Number of days since the epoch. See [`get_epoch`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch") for the epoch, which can be changed by `[rcParams["date.epoch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=date.epoch#matplotlibrc-sample)` (default: `'1970-01-01T00:00:00'`) or [`set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch"). If the epoch is "1970-01-01T00:00:00" (default) then noon Jan 1 1970 ("1970-01-01T12:00:00") returns 0.5.
#### Notes
The Gregorian calendar is assumed; this is not universal practice. For details see the module docstring.
matplotlib.dates.datestr2num(*d*, *default=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L386-L409)
Convert a date string to a datenum using [`dateutil.parser.parse`](https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse "(in dateutil v2.8.2)").
Parameters:
**d**str or sequence of str
The dates to convert.
**default**datetime.datetime, optional
The default date to use when fields are missing in *d*.
matplotlib.dates.drange(*dstart*, *dend*, *delta*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L558-L596)
Return a sequence of equally spaced Matplotlib dates.
The dates start at *dstart* and reach up to, but not including *dend*. They are spaced by *delta*.
Parameters:
**dstart, dend**[`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)")
The date limits.
**delta**[`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)")
Spacing of the dates.
Returns:
[`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array "(in NumPy v1.23)")
A list floats representing Matplotlib dates.
matplotlib.dates.epoch2num(*e*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1771-L1793)
[*Deprecated*] Convert UNIX time to days since Matplotlib epoch.
Parameters:
**e**list of floats
Time in seconds since 1970-01-01.
Returns:
[`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array "(in NumPy v1.23)")
Time in days since Matplotlib epoch (see [`get_epoch()`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch")).
#### Notes
Deprecated since version 3.5: Use `[date2num(datetime.utcfromtimestamp(t)) for t in e]` or numpy.datetime64 types instead.
matplotlib.dates.get\_epoch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L299-L312)
Get the epoch used by [`dates`](#module-matplotlib.dates "matplotlib.dates").
Returns:
**epoch**str
String for the epoch (parsable by [`numpy.datetime64`](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.datetime64 "(in NumPy v1.23)")).
matplotlib.dates.num2date(*x*, *tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L505-L532)
Convert Matplotlib dates to [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") objects.
Parameters:
**x**float or sequence of floats
Number of days (fraction part represents hours, minutes, seconds) since the epoch. See [`get_epoch`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch") for the epoch, which can be changed by `[rcParams["date.epoch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=date.epoch#matplotlibrc-sample)` (default: `'1970-01-01T00:00:00'`) or [`set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch").
**tz**str or [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
Timezone of *x*. If a string, *tz* is passed to [`dateutil.tz`](https://dateutil.readthedocs.io/en/stable/tz.html#module-dateutil.tz "(in dateutil v2.8.2)").
Returns:
[`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") or sequence of [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)")
Dates are returned in timezone *tz*.
If *x* is a sequence, a sequence of [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") objects will be returned.
#### Notes
The Gregorian calendar is assumed; this is not universal practice. For details, see the module docstring.
matplotlib.dates.num2epoch(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1796-L1814)
[*Deprecated*] Convert days since Matplotlib epoch to UNIX time.
Parameters:
**d**list of floats
Time in days since Matplotlib epoch (see [`get_epoch()`](#matplotlib.dates.get_epoch "matplotlib.dates.get_epoch")).
Returns:
[`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array "(in NumPy v1.23)")
Time in seconds since 1970-01-01.
#### Notes
Deprecated since version 3.5: Use [`num2date(e).timestamp()`](#matplotlib.dates.num2date "matplotlib.dates.num2date") instead.
matplotlib.dates.num2timedelta(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L539-L555)
Convert number of days to a [`timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)") object.
If *x* is a sequence, a sequence of [`timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)") objects will be returned.
Parameters:
**x**float, sequence of floats
Number of days. The fraction part represents hours, minutes, seconds.
Returns:
[`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)") or list[[`datetime.timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta "(in Python v3.10)")]
*class*matplotlib.dates.relativedelta(*dt1=None*, *dt2=None*, *years=0*, *months=0*, *days=0*, *leapdays=0*, *weeks=0*, *hours=0*, *minutes=0*, *seconds=0*, *microseconds=0*, *year=None*, *month=None*, *day=None*, *weekday=None*, *yearday=None*, *nlyearday=None*, *hour=None*, *minute=None*, *second=None*, *microsecond=None*)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The relativedelta type is designed to be applied to an existing datetime and can replace specific components of that datetime, or represents an interval of time.
It is based on the specification of the excellent work done by M.-A. Lemburg in his [mx.DateTime](https://www.egenix.com/products/python/mxBase/mxDateTime/) extension. However, notice that this type does *NOT* implement the same algorithm as his work. Do *NOT* expect it to behave like mx.DateTime's counterpart.
There are two different ways to build a relativedelta instance. The first one is passing it two date/datetime classes:
```
relativedelta(datetime1, datetime2)
```
The second one is passing it any number of the following keyword arguments:
```
relativedelta(arg1=x,arg2=y,arg3=z...)
year, month, day, hour, minute, second, microsecond:
Absolute information (argument is singular); adding or subtracting a
relativedelta with absolute information does not perform an arithmetic
operation, but rather REPLACES the corresponding value in the
original datetime with the value(s) in relativedelta.
years, months, weeks, days, hours, minutes, seconds, microseconds:
Relative information, may be negative (argument is plural); adding
or subtracting a relativedelta with relative information performs
the corresponding arithmetic operation on the original datetime value
with the information in the relativedelta.
weekday:
One of the weekday instances (MO, TU, etc) available in the
relativedelta module. These instances may receive a parameter N,
specifying the Nth weekday, which could be positive or negative
(like MO(+1) or MO(-2)). Not specifying it is the same as specifying
+1. You can also use an integer, where 0=MO. This argument is always
relative e.g. if the calculated date is already Monday, using MO(1)
or MO(-1) won't change the day. To effectively make it absolute, use
it in combination with the day argument (e.g. day=1, MO(1) for first
Monday of the month).
leapdays:
Will add given days to the date found, if year is a leap
year, and the date found is post 28 of february.
yearday, nlyearday:
Set the yearday or the non-leap year day (jump leap days).
These are converted to day/month/leapdays information.
```
There are relative and absolute forms of the keyword arguments. The plural is relative, and the singular is absolute. For each argument in the order below, the absolute form is applied first (by setting each attribute to that value) and then the relative form (by adding the value to the attribute).
The order of attributes considered when this relativedelta is added to a datetime is:
1. Year
2. Month
3. Day
4. Hours
5. Minutes
6. Seconds
7. Microseconds
Finally, weekday is applied, using the rule described above.
For example
```
>>> from datetime import datetime
>>> from dateutil.relativedelta import relativedelta, MO
>>> dt = datetime(2018, 4, 9, 13, 37, 0)
>>> delta = relativedelta(hours=25, day=1, weekday=MO(1))
>>> dt + delta
datetime.datetime(2018, 4, 2, 14, 37)
```
First, the day is set to 1 (the first of the month), then 25 hours are added, to get to the 2nd day and 14th hour, finally the weekday is applied, but since the 2nd is already a Monday there is no effect.
normalized()
Return a version of this object represented entirely using integer values for the relative attributes.
```
>>> relativedelta(days=1.5, hours=2).normalized()
relativedelta(days=+1, hours=+14)
```
Returns:
Returns a [`dateutil.relativedelta.relativedelta`](#matplotlib.dates.relativedelta "dateutil.relativedelta.relativedelta") object.
*property*weeks
*class*matplotlib.dates.rrulewrapper(*freq*, *tzinfo=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L978-L1096)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A simple wrapper around a [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)") allowing flexible date tick specifications.
Parameters:
**freq**{YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY}
Tick frequency. These constants are defined in [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)"), but they are accessible from [`matplotlib.dates`](#module-matplotlib.dates "matplotlib.dates") as well.
**tzinfo**[`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), optional
Time zone information. The default is None.
**\*\*kwargs**
Additional keyword arguments are passed to the [`dateutil.rrule`](https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule "(in dateutil v2.8.2)").
set(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L1000-L1004)
Set parameters for an existing wrapper.
matplotlib.dates.set\_epoch(*epoch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dates.py#L270-L296)
Set the epoch (origin for dates) for datetime calculations.
The default epoch is `[rcParams["dates.epoch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=dates.epoch#matplotlibrc-sample)` (by default 1970-01-01T00:00).
If microsecond accuracy is desired, the date being plotted needs to be within approximately 70 years of the epoch. Matplotlib internally represents dates as days since the epoch, so floating point dynamic range needs to be within a factor of 2^52.
[`set_epoch`](#matplotlib.dates.set_epoch "matplotlib.dates.set_epoch") must be called before any dates are converted (i.e. near the import section) or a RuntimeError will be raised.
See also [Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html).
Parameters:
**epoch**str
valid UTC date parsable by [`numpy.datetime64`](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.datetime64 "(in NumPy v1.23)") (do not include timezone).
| programming_docs |
matplotlib matplotlib.textpath matplotlib.textpath
===================
*class*matplotlib.textpath.TextPath(*xy*, *s*, *size=None*, *prop=None*, *\_interpolation\_steps=1*, *usetex=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L304-L408)
Bases: [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
Create a path from the text.
Create a path from the text. Note that it simply is a path, not an artist. You need to use the [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch") (or other artists) to draw this path onto the canvas.
Parameters:
**xy**tuple or array of two float values
Position of the text. For no offset, use `xy=(0, 0)`.
**s**str
The text to convert to a path.
**size**float, optional
Font size in points. Defaults to the size specified via the font properties *prop*.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
Font property. If not provided, will use a default `FontProperties` with parameters from the [rcParams](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-dynamic-rc-settings).
**\_interpolation\_steps**int, optional
(Currently ignored)
**usetex**bool, default: False
Whether to use tex rendering.
#### Examples
The following creates a path from the string "ABC" with Helvetica font face; and another path from the latex fraction 1/2:
```
from matplotlib.textpath import TextPath
from matplotlib.font_manager import FontProperties
fp = FontProperties(family="Helvetica", style="italic")
path1 = TextPath((12, 12), "ABC", size=12, prop=fp)
path2 = TextPath((0, 0), r"$\frac{1}{2}$", size=12, usetex=True)
```
Also see [Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html).
*property*codes
Return the codes
get\_size()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L376-L378)
Get the text size.
set\_size(*size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L371-L374)
Set the text size.
*property*vertices
Return the cached path after updating it if necessary.
*class*matplotlib.textpath.TextToPath[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L20-L298)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A class that converts strings to paths.
DPI*=72*
FONT\_SCALE*=100.0*
get\_glyphs\_mathtext(*prop*, *s*, *glyph\_map=None*, *return\_new\_glyphs\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L167-L216)
Parse mathtext string *s* and convert it to a (vertices, codes) pair.
get\_glyphs\_tex(*prop*, *s*, *glyph\_map=None*, *return\_new\_glyphs\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L225-L281)
Convert the string *s* to vertices and codes using usetex mode.
get\_glyphs\_with\_font(*font*, *s*, *glyph\_map=None*, *return\_new\_glyphs\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L136-L165)
Convert string *s* to vertices and codes using the provided ttf font.
get\_texmanager()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L218-L223)
[*Deprecated*] Return the cached [`TexManager`](texmanager_api#matplotlib.texmanager.TexManager "matplotlib.texmanager.TexManager") instance.
#### Notes
Deprecated since version 3.6: Use TexManager() instead.
get\_text\_path(*prop*, *s*, *ismath=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L72-L134)
Convert text *s* to path (a tuple of vertices and codes for matplotlib.path.Path).
Parameters:
**prop**[`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties for the text.
**s**str
The text to be converted.
**ismath**{False, True, "TeX"}
If True, use mathtext parser. If "TeX", use tex for rendering.
Returns:
**verts**list
A list of numpy arrays containing the x and y coordinates of the vertices.
**codes**list
A list of path codes.
#### Examples
Create a list of vertices and codes from a text, and create a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") from those:
```
from matplotlib.path import Path
from matplotlib.textpath import TextToPath
from matplotlib.font_manager import FontProperties
fp = FontProperties(family="Humor Sans", style="italic")
verts, codes = TextToPath().get_text_path(fp, "ABC")
path = Path(verts, codes, closed=False)
```
Also see [`TextPath`](#matplotlib.textpath.TextPath "matplotlib.textpath.TextPath") for a more direct way to create a path from a text.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/textpath.py#L48-L70)
matplotlib matplotlib.tight_bbox matplotlib.tight\_bbox
======================
Attention
This module is considered internal.
Its use is deprecated and it will be removed in a future version.
Helper module for the *bbox\_inches* parameter in [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
matplotlib.\_tight\_bbox.adjust\_bbox(*fig*, *bbox\_inches*, *fixed\_dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_tight_bbox.py#L8-L70)
Temporarily adjust the figure so that only the specified area (bbox\_inches) is saved.
It modifies fig.bbox, fig.bbox\_inches, fig.transFigure.\_boxout, and fig.patch. While the figure size changes, the scale of the original figure is conserved. A function which restores the original values are returned.
matplotlib.\_tight\_bbox.process\_figure\_for\_rasterizing(*fig*, *bbox\_inches\_restore*, *fixed\_dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_tight_bbox.py#L73-L84)
A function that needs to be called when figure dpi changes during the drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with the new dpi.
matplotlib backend_nbagg backend\_nbagg
==============
Interactive figures in the IPython notebook.
*class*matplotlib.backends.backend\_nbagg.CommSocket(*manager*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L163-L237)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Manages the Comm connection between IPython and the browser (client).
Comms are 2 way, with the CommSocket being able to publish a message via the send\_json method, and handle a message with on\_message. On the JS side figure.send\_message and figure.ws.onmessage do the sending and receiving respectively.
is\_open()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L198-L199)
on\_close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L201-L209)
on\_message(*message*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L224-L237)
send\_binary(*blob*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L214-L222)
send\_json(*content*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L211-L212)
matplotlib.backends.backend\_nbagg.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L159-L160)
alias of [`FigureCanvasNbAgg`](#matplotlib.backends.backend_nbagg.FigureCanvasNbAgg "matplotlib.backends.backend_nbagg.FigureCanvasNbAgg")
*class*matplotlib.backends.backend\_nbagg.FigureCanvasNbAgg(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L159-L160)
Bases: `FigureCanvasWebAggCore`
manager\_class[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L64-L156)
alias of [`FigureManagerNbAgg`](#matplotlib.backends.backend_nbagg.FigureManagerNbAgg "matplotlib.backends.backend_nbagg.FigureManagerNbAgg")
matplotlib.backends.backend\_nbagg.FigureManager[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L64-L156)
alias of [`FigureManagerNbAgg`](#matplotlib.backends.backend_nbagg.FigureManagerNbAgg "matplotlib.backends.backend_nbagg.FigureManagerNbAgg")
*class*matplotlib.backends.backend\_nbagg.FigureManagerNbAgg(*canvas*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L64-L156)
Bases: `FigureManagerWebAgg`
ToolbarCls[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L53-L61)
alias of [`NavigationIPy`](#matplotlib.backends.backend_nbagg.NavigationIPy "matplotlib.backends.backend_nbagg.NavigationIPy")
clearup\_closed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L146-L152)
Clear up any closed Comms.
*property*connected
*classmethod*create\_with\_canvas(*canvas\_class*, *figure*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L71-L84)
Create a manager for a given *figure* using a specific *canvas\_class*.
Backends should override this method if they have specific needs for setting up the canvas or the manager.
destroy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L139-L144)
display\_js()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L86-L90)
*classmethod*get\_javascript(*stream=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L121-L132)
remove\_comm(*comm\_id*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L154-L156)
reshow()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L109-L115)
A special method to re-show the figure in the notebook.
show()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L92-L107)
For GUI backends, show the figure window and redraw. For non-GUI backends, raise an exception, unless running headless (i.e. on Linux with an unset DISPLAY); this exception is converted to a warning in [`Figure.show`](figure_api#matplotlib.figure.Figure.show "matplotlib.figure.Figure.show").
*class*matplotlib.backends.backend\_nbagg.NavigationIPy(*canvas*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L53-L61)
Bases: `NavigationToolbar2WebAgg`
toolitems*=[('Home', 'Reset original view', 'fa fa-home', 'home'), ('Back', 'Back to previous view', 'fa fa-arrow-left', 'back'), ('Forward', 'Forward to next view', 'fa fa-arrow-right', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'fa fa-arrows', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'fa fa-square-o', 'zoom'), (None, None, None, None), ('Download', 'Download plot', 'fa fa-floppy-o', 'download')]*
matplotlib.backends.backend\_nbagg.connection\_info()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_nbagg.py#L24-L39)
Return a string showing the figure and connection status for the backend.
This is intended as a diagnostic tool, and not for general use.
matplotlib matplotlib.tri matplotlib.tri
==============
Unstructured triangular grid functions.
*class*matplotlib.tri.Triangulation(*x*, *y*, *triangles=None*, *mask=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L6-L240)
An unstructured triangular grid consisting of npoints points and ntri triangles. The triangles can either be specified by the user or automatically generated using a Delaunay triangulation.
Parameters:
**x, y**(npoints,) array-like
Coordinates of grid points.
**triangles**(ntri, 3) array-like of int, optional
For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated.
**mask**(ntri,) array-like of bool, optional
Which triangles are masked out.
#### Notes
For a Triangulation to be valid it must not have duplicate points, triangles formed from colinear points, or overlapping triangles.
Attributes:
**triangles**(ntri, 3) array of int
For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If you want to take the *mask* into account, use [`get_masked_triangles`](#matplotlib.tri.Triangulation.get_masked_triangles "matplotlib.tri.Triangulation.get_masked_triangles") instead.
**mask**(ntri, 3) array of bool
Masked out triangles.
**is\_delaunay**bool
Whether the Triangulation is a calculated Delaunay triangulation (where *triangles* was not specified) or not.
calculate\_plane\_coefficients(*z*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L91-L99)
Calculate plane equation coefficients for all unmasked triangles from the point (x, y) coordinates and specified z-array of shape (npoints). The returned array has shape (npoints, 3) and allows z-value at (x, y) position in triangle tri to be calculated using `z = array[tri, 0] * x + array[tri, 1] * y + array[tri, 2]`.
*property*edges
Return integer array of shape (nedges, 2) containing all edges of non-masked triangles.
Each row defines an edge by its start point index and end point index. Each edge appears only once, i.e. for an edge between points *i* and *j*, there will only be either *(i, j)* or *(j, i)*.
get\_cpp\_triangulation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L115-L125)
Return the underlying C++ Triangulation object, creating it if necessary.
*static*get\_from\_args\_and\_kwargs(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L136-L162)
Return a Triangulation object from the args and kwargs, and the remaining args and kwargs with the consumed values removed.
There are two alternatives: either the first argument is a Triangulation object, in which case it is returned, or the args and kwargs are sufficient to create a new Triangulation to return. In the latter case, see Triangulation.\_\_init\_\_ for the possible args and kwargs.
get\_masked\_triangles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L127-L134)
Return an array of triangles taking the mask into account.
get\_trifinder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L187-L197)
Return the default [`matplotlib.tri.TriFinder`](#matplotlib.tri.TriFinder "matplotlib.tri.TriFinder") of this triangulation, creating it if necessary. This allows the same TriFinder object to be easily shared.
*property*neighbors
Return integer array of shape (ntri, 3) containing neighbor triangles.
For each triangle, the indices of the three triangles that share the same edges, or -1 if there is no such neighboring triangle. `neighbors[i, j]` is the triangle that is the neighbor to the edge from point index `triangles[i, j]` to point index `triangles[i, (j+1)%3]`.
set\_mask(*mask*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triangulation.py#L214-L240)
Set or clear the mask array.
Parameters:
**mask**None or bool array of length ntri
*class*matplotlib.tri.TriContourSet(*ax*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tricontour.py#L8-L78)
Bases: [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet")
Create and store a set of contour lines or filled regions for a triangular grid.
This class is typically not instantiated directly by the user but by [`tricontour`](_as_gen/matplotlib.axes.axes.tricontour#matplotlib.axes.Axes.tricontour "matplotlib.axes.Axes.tricontour") and [`tricontourf`](_as_gen/matplotlib.axes.axes.tricontourf#matplotlib.axes.Axes.tricontourf "matplotlib.axes.Axes.tricontourf").
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes object in which the contours are drawn.
**collections**[`silent_list`](cbook_api#matplotlib.cbook.silent_list "matplotlib.cbook.silent_list") of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s
The [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s representing the contour. This is a list of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s for both line and filled contours.
**levels**array
The values of the contour levels.
**layers**array
Same as levels for line contours; half-way between levels for filled contours. See `ContourSet._process_colors`.
Draw triangular grid contour lines or filled regions, depending on whether keyword arg *filled* is False (default) or True.
The first argument of the initializer must be an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object. The remaining arguments and keyword arguments are described in the docstring of [`tricontour`](_as_gen/matplotlib.axes.axes.tricontour#matplotlib.axes.Axes.tricontour "matplotlib.axes.Axes.tricontour").
*class*matplotlib.tri.TriFinder(*triangulation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trifinder.py#L7-L21)
Abstract base class for classes used to find the triangles of a Triangulation in which (x, y) points lie.
Rather than instantiate an object of a class derived from TriFinder, it is usually better to use the function [`Triangulation.get_trifinder`](#matplotlib.tri.Triangulation.get_trifinder "matplotlib.tri.Triangulation.get_trifinder").
Derived classes implement \_\_call\_\_(x, y) where x and y are array-like point coordinates of the same shape.
*class*matplotlib.tri.TrapezoidMapTriFinder(*triangulation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trifinder.py#L24-L93)
Bases: [`TriFinder`](#matplotlib.tri.TriFinder "matplotlib.tri.trifinder.TriFinder")
[`TriFinder`](#matplotlib.tri.TriFinder "matplotlib.tri.TriFinder") class implemented using the trapezoid map algorithm from the book "Computational Geometry, Algorithms and Applications", second edition, by M. de Berg, M. van Kreveld, M. Overmars and O. Schwarzkopf.
The triangulation must be valid, i.e. it must not have duplicate points, triangles formed from colinear points, or overlapping triangles. The algorithm has some tolerance to triangles formed from colinear points, but this should not be relied upon.
*class*matplotlib.tri.TriInterpolator(*triangulation*, *z*, *trifinder=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triinterpolate.py#L15-L229)
Abstract base class for classes used to interpolate on a triangular grid.
Derived classes implement the following methods:
* `__call__(x, y)`, where x, y are array-like point coordinates of the same shape, and that returns a masked array of the same shape containing the interpolated z-values.
* `gradient(x, y)`, where x, y are array-like point coordinates of the same shape, and that returns a list of 2 masked arrays of the same shape containing the 2 derivatives of the interpolator (derivatives of interpolated z values with respect to x and y).
*class*matplotlib.tri.LinearTriInterpolator(*triangulation*, *z*, *trifinder=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triinterpolate.py#L232-L283)
Bases: [`TriInterpolator`](#matplotlib.tri.TriInterpolator "matplotlib.tri.triinterpolate.TriInterpolator")
Linear interpolator on a triangular grid.
Each triangle is represented by a plane so that an interpolated value at point (x, y) lies on the plane of the triangle containing (x, y). Interpolated values are therefore continuous across the triangulation, but their first derivatives are discontinuous at edges between triangles.
Parameters:
**triangulation**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The triangulation to interpolate over.
**z**(npoints,) array-like
Array of values, defined at grid points, to interpolate between.
**trifinder**[`TriFinder`](#matplotlib.tri.TriFinder "matplotlib.tri.TriFinder"), optional
If this is not specified, the Triangulation's default TriFinder will be used by calling [`Triangulation.get_trifinder`](#matplotlib.tri.Triangulation.get_trifinder "matplotlib.tri.Triangulation.get_trifinder").
#### Methods
| | |
| --- | --- |
| **`\_\_call\_\_` (x, y)** | (Returns interpolated values at (x, y) points.) |
| **`gradient` (x, y)** | (Returns interpolated derivatives at (x, y) points.) |
gradient(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triinterpolate.py#L269-L271)
Returns a list of 2 masked arrays containing interpolated derivatives at the specified (x, y) points.
Parameters:
**x, y**array-like
x and y coordinates of the same shape and any number of dimensions.
Returns:
**dzdx, dzdy**np.ma.array
2 masked arrays of the same shape as *x* and *y*; values corresponding to (x, y) points outside of the triangulation are masked out. The first returned array contains the values of \(\frac{\partial z}{\partial x}\) and the second those of \(\frac{\partial z}{\partial y}\).
*class*matplotlib.tri.CubicTriInterpolator(*triangulation*, *z*, *kind='min\_E'*, *trifinder=None*, *dz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triinterpolate.py#L286-L573)
Bases: [`TriInterpolator`](#matplotlib.tri.TriInterpolator "matplotlib.tri.triinterpolate.TriInterpolator")
Cubic interpolator on a triangular grid.
In one-dimension - on a segment - a cubic interpolating function is defined by the values of the function and its derivative at both ends. This is almost the same in 2D inside a triangle, except that the values of the function and its 2 derivatives have to be defined at each triangle node.
The CubicTriInterpolator takes the value of the function at each node - provided by the user - and internally computes the value of the derivatives, resulting in a smooth interpolation. (As a special feature, the user can also impose the value of the derivatives at each node, but this is not supposed to be the common usage.)
Parameters:
**triangulation**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The triangulation to interpolate over.
**z**(npoints,) array-like
Array of values, defined at grid points, to interpolate between.
**kind**{'min\_E', 'geom', 'user'}, optional
Choice of the smoothing algorithm, in order to compute the interpolant derivatives (defaults to 'min\_E'):
* if 'min\_E': (default) The derivatives at each node is computed to minimize a bending energy.
* if 'geom': The derivatives at each node is computed as a weighted average of relevant triangle normals. To be used for speed optimization (large grids).
* if 'user': The user provides the argument *dz*, no computation is hence needed.
**trifinder**[`TriFinder`](#matplotlib.tri.TriFinder "matplotlib.tri.TriFinder"), optional
If not specified, the Triangulation's default TriFinder will be used by calling [`Triangulation.get_trifinder`](#matplotlib.tri.Triangulation.get_trifinder "matplotlib.tri.Triangulation.get_trifinder").
**dz**tuple of array-likes (dzdx, dzdy), optional
Used only if *kind* ='user'. In this case *dz* must be provided as (dzdx, dzdy) where dzdx, dzdy are arrays of the same shape as *z* and are the interpolant first derivatives at the *triangulation* points.
#### Notes
This note is a bit technical and details how the cubic interpolation is computed.
The interpolation is based on a Clough-Tocher subdivision scheme of the *triangulation* mesh (to make it clearer, each triangle of the grid will be divided in 3 child-triangles, and on each child triangle the interpolated function is a cubic polynomial of the 2 coordinates). This technique originates from FEM (Finite Element Method) analysis; the element used is a reduced Hsieh-Clough-Tocher (HCT) element. Its shape functions are described in [[1]](#r0be0c58fd53f-1). The assembled function is guaranteed to be C1-smooth, i.e. it is continuous and its first derivatives are also continuous (this is easy to show inside the triangles but is also true when crossing the edges).
In the default case (*kind* ='min\_E'), the interpolant minimizes a curvature energy on the functional space generated by the HCT element shape functions - with imposed values but arbitrary derivatives at each node. The minimized functional is the integral of the so-called total curvature (implementation based on an algorithm from [[2]](#r0be0c58fd53f-2) - PCG sparse solver):
\[E(z) = \frac{1}{2} \int\_{\Omega} \left( \left( \frac{\partial^2{z}}{\partial{x}^2} \right)^2 + \left( \frac{\partial^2{z}}{\partial{y}^2} \right)^2 + 2\left( \frac{\partial^2{z}}{\partial{y}\partial{x}} \right)^2 \right) dx\,dy\] If the case *kind* ='geom' is chosen by the user, a simple geometric approximation is used (weighted average of the triangle normal vectors), which could improve speed on very large grids.
#### References
[[1](#id1)] Michel Bernadou, Kamal Hassan, "Basis functions for general Hsieh-Clough-Tocher triangles, complete or reduced.", International Journal for Numerical Methods in Engineering, 17(5):784 - 789. 2.01.
[[2](#id2)] C.T. Kelley, "Iterative Methods for Optimization".
#### Methods
| | |
| --- | --- |
| **`\_\_call\_\_` (x, y)** | (Returns interpolated values at (x, y) points.) |
| **`gradient` (x, y)** | (Returns interpolated derivatives at (x, y) points.) |
gradient(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/triinterpolate.py#L425-L427)
Returns a list of 2 masked arrays containing interpolated derivatives at the specified (x, y) points.
Parameters:
**x, y**array-like
x and y coordinates of the same shape and any number of dimensions.
Returns:
**dzdx, dzdy**np.ma.array
2 masked arrays of the same shape as *x* and *y*; values corresponding to (x, y) points outside of the triangulation are masked out. The first returned array contains the values of \(\frac{\partial z}{\partial x}\) and the second those of \(\frac{\partial z}{\partial y}\).
*class*matplotlib.tri.TriRefiner(*triangulation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trirefine.py#L12-L44)
Abstract base class for classes implementing mesh refinement.
A TriRefiner encapsulates a Triangulation object and provides tools for mesh refinement and interpolation.
Derived classes must implement:
* `refine_triangulation(return_tri_index=False, **kwargs)` , where the optional keyword arguments *kwargs* are defined in each TriRefiner concrete implementation, and which returns:
+ a refined triangulation,
+ optionally (depending on *return\_tri\_index*), for each point of the refined triangulation: the index of the initial triangulation triangle to which it belongs.
* `refine_field(z, triinterpolator=None, **kwargs)`, where:
+ *z* array of field values (to refine) defined at the base triangulation nodes,
+ *triinterpolator* is an optional [`TriInterpolator`](#matplotlib.tri.TriInterpolator "matplotlib.tri.TriInterpolator"),
+ the other optional keyword arguments *kwargs* are defined in each TriRefiner concrete implementation;and which returns (as a tuple) a refined triangular mesh and the interpolated values of the field at the refined triangulation nodes.
*class*matplotlib.tri.UniformTriRefiner(*triangulation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trirefine.py#L47-L307)
Bases: [`TriRefiner`](#matplotlib.tri.TriRefiner "matplotlib.tri.trirefine.TriRefiner")
Uniform mesh refinement by recursive subdivisions.
Parameters:
**triangulation**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The encapsulated triangulation (to be refined)
refine\_field(*z*, *triinterpolator=None*, *subdiv=3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trirefine.py#L133-L169)
Refine a field defined on the encapsulated triangulation.
Parameters:
**z**(npoints,) array-like
Values of the field to refine, defined at the nodes of the encapsulated triangulation. (`n_points` is the number of points in the initial triangulation)
**triinterpolator**[`TriInterpolator`](#matplotlib.tri.TriInterpolator "matplotlib.tri.TriInterpolator"), optional
Interpolator used for field interpolation. If not specified, a [`CubicTriInterpolator`](#matplotlib.tri.CubicTriInterpolator "matplotlib.tri.CubicTriInterpolator") will be used.
**subdiv**int, default: 3
Recursion level for the subdivision. Each triangle is divided into `4**subdiv` child triangles.
Returns:
**refi\_tri**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The returned refined triangulation.
**refi\_z**1D array of length: *refi\_tri* node count.
The returned interpolated field (at *refi\_tri* nodes).
refine\_triangulation(*return\_tri\_index=False*, *subdiv=3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/trirefine.py#L64-L131)
Compute an uniformly refined triangulation *refi\_triangulation* of the encapsulated `triangulation`.
This function refines the encapsulated triangulation by splitting each father triangle into 4 child sub-triangles built on the edges midside nodes, recursing *subdiv* times. In the end, each triangle is hence divided into `4**subdiv` child triangles.
Parameters:
**return\_tri\_index**bool, default: False
Whether an index table indicating the father triangle index of each point is returned.
**subdiv**int, default: 3
Recursion level for the subdivision. Each triangle is divided into `4**subdiv` child triangles; hence, the default results in 64 refined subtriangles for each triangle of the initial triangulation.
Returns:
**refi\_triangulation**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The refined triangulation.
**found\_index**int array
Index of the initial triangulation containing triangle, for each point of *refi\_triangulation*. Returned only if *return\_tri\_index* is set to True.
*class*matplotlib.tri.TriAnalyzer(*triangulation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tritools.py#L11-L263)
Define basic tools for triangular mesh analysis and improvement.
A TriAnalyzer encapsulates a [`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object and provides basic tools for mesh analysis and mesh improvement.
Parameters:
**triangulation**[`Triangulation`](#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
The encapsulated triangulation to analyze.
Attributes:
[`scale_factors`](#matplotlib.tri.TriAnalyzer.scale_factors "matplotlib.tri.TriAnalyzer.scale_factors")
Factors to rescale the triangulation into a unit square.
circle\_ratios(*rescale=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tritools.py#L50-L115)
Return a measure of the triangulation triangles flatness.
The ratio of the incircle radius over the circumcircle radius is a widely used indicator of a triangle flatness. It is always `<= 0.5` and `== 0.5` only for equilateral triangles. Circle ratios below 0.01 denote very flat triangles.
To avoid unduly low values due to a difference of scale between the 2 axis, the triangular mesh can first be rescaled to fit inside a unit square with [`scale_factors`](#matplotlib.tri.TriAnalyzer.scale_factors "matplotlib.tri.TriAnalyzer.scale_factors") (Only if *rescale* is True, which is its default value).
Parameters:
**rescale**bool, default: True
If True, internally rescale (based on [`scale_factors`](#matplotlib.tri.TriAnalyzer.scale_factors "matplotlib.tri.TriAnalyzer.scale_factors")), so that the (unmasked) triangles fit exactly inside a unit square mesh.
Returns:
masked array
Ratio of the incircle radius over the circumcircle radius, for each 'rescaled' triangle of the encapsulated triangulation. Values corresponding to masked triangles are masked out.
get\_flat\_tri\_mask(*min\_circle\_ratio=0.01*, *rescale=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tritools.py#L117-L190)
Eliminate excessively flat border triangles from the triangulation.
Returns a mask *new\_mask* which allows to clean the encapsulated triangulation from its border-located flat triangles (according to their [`circle_ratios()`](#matplotlib.tri.TriAnalyzer.circle_ratios "matplotlib.tri.TriAnalyzer.circle_ratios")). This mask is meant to be subsequently applied to the triangulation using [`Triangulation.set_mask`](#matplotlib.tri.Triangulation.set_mask "matplotlib.tri.Triangulation.set_mask"). *new\_mask* is an extension of the initial triangulation mask in the sense that an initially masked triangle will remain masked.
The *new\_mask* array is computed recursively; at each step flat triangles are removed only if they share a side with the current mesh border. Thus no new holes in the triangulated domain will be created.
Parameters:
**min\_circle\_ratio**float, default: 0.01
Border triangles with incircle/circumcircle radii ratio r/R will be removed if r/R < *min\_circle\_ratio*.
**rescale**bool, default: True
If True, first, internally rescale (based on [`scale_factors`](#matplotlib.tri.TriAnalyzer.scale_factors "matplotlib.tri.TriAnalyzer.scale_factors")) so that the (unmasked) triangles fit exactly inside a unit square mesh. This rescaling accounts for the difference of scale which might exist between the 2 axis.
Returns:
array of bool
Mask to apply to encapsulated triangulation. All the initially masked triangles remain masked in the *new\_mask*.
#### Notes
The rationale behind this function is that a Delaunay triangulation - of an unstructured set of points - sometimes contains almost flat triangles at its border, leading to artifacts in plots (especially for high-resolution contouring). Masked with computed *new\_mask*, the encapsulated triangulation would contain no more unmasked border triangles with a circle ratio below *min\_circle\_ratio*, thus improving the mesh quality for subsequent plots or interpolation.
*property*scale\_factors
Factors to rescale the triangulation into a unit square.
Returns:
(float, float)
Scaling factors (kx, ky) so that the triangulation `[triangulation.x * kx, triangulation.y * ky]` fits exactly inside a unit square.
| programming_docs |
matplotlib matplotlib._enums matplotlib.\_enums
==================
Enums representing sets of strings that Matplotlib uses as input parameters.
Matplotlib often uses simple data types like strings or tuples to define a concept; e.g. the line capstyle can be specified as one of 'butt', 'round', or 'projecting'. The classes in this module are used internally and serve to document these concepts formally.
As an end-user you will not use these classes directly, but only the values they define.
*class*matplotlib.\_enums.JoinStyle(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_enums.py#L27-L111)
Define how the connection between two line segments is drawn.
For a visual impression of each *JoinStyle*, [`view these docs online`](#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle"), or run [`JoinStyle.demo`](#matplotlib._enums.JoinStyle.demo "matplotlib._enums.JoinStyle.demo").
Lines in Matplotlib are typically defined by a 1D [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") and a finite `linewidth`, where the underlying 1D [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") represents the center of the stroked line.
By default, [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase") defines the boundaries of a stroked line to simply be every point within some radius, `linewidth/2`, away from any point of the center line. However, this results in corners appearing "rounded", which may not be the desired behavior if you are drawing, for example, a polygon or pointed star.
**Supported values:**
'miter'
the "arrow-tip" style. Each boundary of the filled-in area will extend in a straight line parallel to the tangent vector of the centerline at the point it meets the corner, until they meet in a sharp point.
'round'
stokes every point within a radius of `linewidth/2` of the center lines.
'bevel'
the "squared-off" style. It can be thought of as a rounded corner where the "circular" part of the corner has been cut off.
Note
Very long miter tips are cut off (to form a *bevel*) after a backend-dependent limit called the "miter limit", which specifies the maximum allowed ratio of miter length to line width. For example, the PDF backend uses the default value of 10 specified by the PDF standard, while the SVG backend does not even specify the miter limit, resulting in a default value of 4 per the SVG specification. Matplotlib does not currently allow the user to adjust this parameter.
A more detailed description of the effect of a miter limit can be found in the [Mozilla Developer Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit)
([Source code](_enums_api-1.py), [png](_enums_api-1.png))
*static*demo()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_enums.py#L86-L111)
Demonstrate how each JoinStyle looks for various join angles.
*class*matplotlib.\_enums.CapStyle(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_enums.py#L119-L177)
Define how the two endpoints (caps) of an unclosed line are drawn.
How to draw the start and end points of lines that represent a closed curve (i.e. that end in a [`CLOSEPOLY`](path_api#matplotlib.path.Path.CLOSEPOLY "matplotlib.path.Path.CLOSEPOLY")) is controlled by the line's [`JoinStyle`](#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle"). For all other lines, how the start and end points are drawn is controlled by the *CapStyle*.
For a visual impression of each *CapStyle*, [`view these docs online`](#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or run [`CapStyle.demo`](#matplotlib._enums.CapStyle.demo "matplotlib._enums.CapStyle.demo").
By default, [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase") draws a stroked line as squared off at its endpoints.
**Supported values:**
'butt'
the line is squared off at its endpoint.
'projecting'
the line is squared off as in *butt*, but the filled in area extends beyond the endpoint a distance of `linewidth/2`.
'round'
like *butt*, but a semicircular cap is added to the end of the line, of radius `linewidth/2`.
([Source code](_enums_api-2.py), [png](_enums_api-2.png))
*static*demo()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_enums.py#L158-L177)
Demonstrate how each CapStyle looks for a thick line segment.
matplotlib matplotlib.fontconfig_pattern matplotlib.fontconfig\_pattern
==============================
matplotlib.fontconfig\_pattern.family\_escape(*/*, *repl*, *string*, *count=0*)
Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
matplotlib.fontconfig\_pattern.family\_unescape(*/*, *repl*, *string*, *count=0*)
Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
matplotlib.fontconfig\_pattern.value\_escape(*/*, *repl*, *string*, *count=0*)
Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
matplotlib.fontconfig\_pattern.value\_unescape(*/*, *repl*, *string*, *count=0*)
Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
matplotlib matplotlib.spines matplotlib.spines
=================
*class*matplotlib.spines.Spine(*axes*, *spine\_type*, *path*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L14-L472)
Bases: [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
An axis spine -- the line noting the data area boundaries.
Spines are the lines connecting the axis tick marks and noting the boundaries of the data area. They can be placed at arbitrary positions. See [`set_position`](#matplotlib.spines.Spine.set_position "matplotlib.spines.Spine.set_position") for more information.
The default position is `('outward', 0)`.
Spines are subclasses of [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch"), and inherit much of their behavior.
Spines draw a line, a circle, or an arc depending if [`set_patch_line`](#matplotlib.spines.Spine.set_patch_line "matplotlib.spines.Spine.set_patch_line"), [`set_patch_circle`](#matplotlib.spines.Spine.set_patch_circle "matplotlib.spines.Spine.set_patch_circle"), or [`set_patch_arc`](#matplotlib.spines.Spine.set_patch_arc "matplotlib.spines.Spine.set_patch_arc") has been called. Line-like is the default.
For examples see [Spines](https://matplotlib.org/stable/gallery/spines/index.html#spines-examples).
Parameters:
**axes**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance containing the spine.
**spine\_type**str
The spine type.
**path**[`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
The [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance used to draw the spine.
Other Parameters:
**\*\*kwargs**
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*classmethod*arc\_spine(*axes*, *spine\_type*, *center*, *radius*, *theta1*, *theta2*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L439-L446)
Create and return an arc [`Spine`](#matplotlib.spines.Spine "matplotlib.spines.Spine").
*classmethod*circular\_spine(*axes*, *center*, *radius*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L448-L455)
Create and return a circular [`Spine`](#matplotlib.spines.Spine "matplotlib.spines.Spine").
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L220-L224)
Clear the current spine.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L284-L289)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_bounds()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L416-L418)
Get the bounds of the spine.
get\_patch\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L135-L140)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L198-L199)
Return the path of this patch.
get\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L322-L325)
Return the spine position.
get\_spine\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L327-L384)
Return the spine transform.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L142-L196)
Return the window extent of the spines in display space, including padding for ticks (but not their labels)
See also
[`matplotlib.axes.Axes.get_tightbbox`](_as_gen/matplotlib.axes.axes.get_tightbbox#matplotlib.axes.Axes.get_tightbbox "matplotlib.axes.Axes.get_tightbbox")
[`matplotlib.axes.Axes.get_window_extent`](_as_gen/matplotlib.axes.axes.get_window_extent#matplotlib.axes.Axes.get_window_extent "matplotlib.axes.Axes.get_window_extent")
*classmethod*linear\_spine(*axes*, *spine\_type*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L420-L437)
Create and return a linear [`Spine`](#matplotlib.spines.Spine "matplotlib.spines.Spine").
register\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L207-L218)
Register an axis.
An axis should be registered with its corresponding spine from the Axes instance. This allows the spine to clear any axis properties when needed.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *bounds=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *patch\_arc=<UNSET>*, *patch\_circle=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](#matplotlib.spines.Spine.set_bounds "matplotlib.spines.Spine.set_bounds") | (low: float, high: float) |
| [`capstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.spines.Spine.set_color "matplotlib.spines.Spine.set_color") | color |
| [`edgecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`patch_arc`](#matplotlib.spines.Spine.set_patch_arc "matplotlib.spines.Spine.set_patch_arc") | unknown |
| [`patch_circle`](#matplotlib.spines.Spine.set_patch_circle "matplotlib.spines.Spine.set_patch_circle") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](#matplotlib.spines.Spine.set_position "matplotlib.spines.Spine.set_position") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_bounds(*low=None*, *high=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L386-L414)
Set the spine bounds.
Parameters:
**low**float or None, optional
The lower spine bound. Passing *None* leaves the limit unchanged.
The bounds may also be passed as the tuple (*low*, *high*) as the first positional argument.
**high**float or None, optional
The higher spine bound. Passing *None* leaves the limit unchanged.
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L457-L472)
Set the edgecolor.
Parameters:
**c**color
#### Notes
This method does not modify the facecolor (which defaults to "none"), unlike the [`Patch.set_color`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") method defined in the parent class. Use [`Patch.set_facecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") to set the facecolor.
set\_patch\_arc(*center*, *radius*, *theta1*, *theta2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L88-L99)
Set the spine to be arc-like.
set\_patch\_circle(*center*, *radius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L101-L109)
Set the spine to be circular.
set\_patch\_line()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L111-L114)
Set the spine to be linear.
set\_position(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L291-L320)
Set the position of the spine.
Spine position is specified by a 2 tuple of (position type, amount). The position types are:
* 'outward': place the spine out from the data area by the specified number of points. (Negative values place the spine inwards.)
* 'axes': place the spine at the specified Axes coordinate (0 to 1).
* 'data': place the spine at the specified data coordinate.
Additionally, shorthand notations define a special positions:
* 'center' -> ('axes', 0.5)
* 'zero' -> ('data', 0.0)
*class*matplotlib.spines.Spines(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L510-L583)
Bases: [`MutableMapping`](https://docs.python.org/3/library/collections.abc.html#collections.abc.MutableMapping "(in Python v3.10)")
The container of all [`Spine`](#matplotlib.spines.Spine "matplotlib.spines.Spine")s in an Axes.
The interface is dict-like mapping names (e.g. 'left') to [`Spine`](#matplotlib.spines.Spine "matplotlib.spines.Spine") objects. Additionally it implements some pandas.Series-like features like accessing elements by attribute:
```
spines['top'].set_visible(False)
spines.top.set_visible(False)
```
Multiple spines can be addressed simultaneously by passing a list:
```
spines[['top', 'right']].set_visible(False)
```
Use an open slice to address all spines:
```
spines[:].set_visible(False)
```
The latter two indexing methods will return a [`SpinesProxy`](#matplotlib.spines.SpinesProxy "matplotlib.spines.SpinesProxy") that broadcasts all `set_*` calls to its members, but cannot be used for any other operation.
*classmethod*from\_dict(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L536-L538)
*class*matplotlib.spines.SpinesProxy(*spine\_dict*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/spines.py#L475-L507)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A proxy to broadcast `set_*` method calls to all contained [`Spines`](#matplotlib.spines.Spines "matplotlib.spines.Spines").
The proxy cannot be used for any other operations on its members.
The supported methods are determined dynamically based on the contained spines. If not all spines support a given method, it's executed only on the subset of spines that support it.
| programming_docs |
matplotlib matplotlib.backend_bases matplotlib.backend\_bases
=========================
Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a Matplotlib backend.
[`RendererBase`](#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
An abstract base class to handle drawing/rendering operations.
[`FigureCanvasBase`](#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
The abstraction layer that separates the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") from the backend specific details like a user interface drawing area.
[`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
An abstract base class that provides color, line styles, etc.
[`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
The base class for all of the Matplotlib event handling. Derived classes such as [`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent") and [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") store the meta data like keys and buttons pressed, x and y locations in pixel and [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") coordinates.
[`ShowBase`](#matplotlib.backend_bases.ShowBase "matplotlib.backend_bases.ShowBase")
The base class for the `Show` class of each interactive backend; the 'show' callable is then set to `Show.__call__`.
[`ToolContainerBase`](#matplotlib.backend_bases.ToolContainerBase "matplotlib.backend_bases.ToolContainerBase")
The base class for the Toolbar class of each interactive backend.
*class*matplotlib.backend\_bases.CloseEvent(*name*, *canvas*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1280-L1281)
Bases: [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
An event triggered by a figure being closed.
*class*matplotlib.backend\_bases.DrawEvent(*name*, *canvas*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1233-L1257)
Bases: [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
An event triggered by a draw operation on the canvas.
In most backends, callbacks subscribed to this event will be fired after the rendering is complete but before the screen is updated. Any extra artists drawn to the canvas's renderer will be reflected without an explicit call to `blit`.
Warning
Calling `canvas.draw` and `canvas.blit` in these callbacks may not be safe with all backends and may cause infinite recursion.
A DrawEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") class.
Attributes:
**renderer**[`RendererBase`](#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
The renderer for the draw event.
*class*matplotlib.backend\_bases.Event(*name*, *canvas*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1206-L1230)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A Matplotlib event.
The following attributes are defined and shown with their default values. Subclasses may define additional attributes.
Attributes:
**name**str
The event name.
**canvas**[`FigureCanvasBase`](#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
The backend-specific canvas instance generating the event.
**guiEvent**
The GUI event that triggered the Matplotlib event.
*class*matplotlib.backend\_bases.FigureCanvasBase(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1588-L2527)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The canvas the figure renders into.
Attributes:
**figure**[`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
A high-level figure instance.
blit(*bbox=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1725-L1726)
Blit the canvas in bbox (default entire canvas).
*property*button\_pick\_id
button\_press\_event(*x*, *y*, *button*, *dblclick=False*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1844-L1861)
[*Deprecated*] Callback processing for mouse button press events.
Backend derived classes should call this function on any mouse button press. (*x*, *y*) are the canvas coords ((0, 0) is lower left). button and key are as defined in [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent").
This method will call all functions connected to the 'button\_press\_event' with a [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") instance.
#### Notes
Deprecated since version 3.6: Use callbacks.process('button\_press\_event', MouseEvent(...)) instead.
button\_release\_event(*x*, *y*, *button*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1863-L1887)
[*Deprecated*] Callback processing for mouse button release events.
Backend derived classes should call this function on any mouse button release.
This method will call all functions connected to the 'button\_release\_event' with a [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") instance.
Parameters:
**x**float
The canvas coordinates where 0=left.
**y**float
The canvas coordinates where 0=bottom.
**guiEvent**
The native UI event that generated the Matplotlib event.
#### Notes
Deprecated since version 3.6: Use callbacks.process('button\_release\_event', MouseEvent(...)) instead.
*property*callbacks
close\_event(*guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1762-L1778)
[*Deprecated*] Pass a [`CloseEvent`](#matplotlib.backend_bases.CloseEvent "matplotlib.backend_bases.CloseEvent") to all functions connected to `close_event`.
#### Notes
Deprecated since version 3.6: Use callbacks.process('close\_event', CloseEvent(...)) instead.
*property*device\_pixel\_ratio
The ratio of physical to logical pixels used for the canvas on screen.
By default, this is 1, meaning physical and logical pixels are the same size. Subclasses that support High DPI screens may set this property to indicate that said ratio is different. All Matplotlib interaction, unless working directly with the canvas, remains in logical pixels.
draw(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2029-L2037)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
draw\_event(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1743-L1749)
[*Deprecated*] Pass a [`DrawEvent`](#matplotlib.backend_bases.DrawEvent "matplotlib.backend_bases.DrawEvent") to all functions connected to `draw_event`.
#### Notes
Deprecated since version 3.6: Use callbacks.process('draw\_event', DrawEvent(...)) instead.
draw\_idle(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2039-L2054)
Request a widget redraw once control returns to the GUI event loop.
Even if multiple calls to [`draw_idle`](#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle") occur before control returns to the GUI event loop, the figure will only be rendered once.
#### Notes
Backends may choose to override the method and implement their own strategy to prevent multiple renderings.
enter\_notify\_event(*guiEvent=None*, *xy=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1935-L1964)
[*Deprecated*] Callback processing for the mouse cursor entering the canvas.
Backend derived classes should call this function when entering canvas.
Parameters:
**guiEvent**
The native UI event that generated the Matplotlib event.
**xy**(float, float)
The coordinate location of the pointer when the canvas is entered.
#### Notes
Deprecated since version 3.6: Use callbacks.process('enter\_notify\_event', LocationEvent(...)) instead.
events*=['resize\_event', 'draw\_event', 'key\_press\_event', 'key\_release\_event', 'button\_press\_event', 'button\_release\_event', 'scroll\_event', 'motion\_notify\_event', 'pick\_event', 'figure\_enter\_event', 'figure\_leave\_event', 'axes\_enter\_event', 'axes\_leave\_event', 'close\_event']*
filetypes*={'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format', 'webp': 'WebP Image Format'}*
fixed\_dpi*=None*
flush\_events()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2485-L2490)
Flush the GUI events for the figure.
Interactive backends need to reimplement this method.
get\_default\_filename()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2362-L2372)
Return a string, which includes extension, suitable for use as a default filename.
*classmethod*get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2351-L2360)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
*classmethod*get\_supported\_filetypes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2131-L2134)
Return dict of savefig file formats supported by this backend.
*classmethod*get\_supported\_filetypes\_grouped()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2136-L2148)
Return a dict of savefig file formats supported by this backend, where the keys are a file type name, such as 'Joint Photographic Experts Group', and the values are a list of filename extensions used for that filetype, such as ['jpg', 'jpeg'].
get\_width\_height(*\**, *physical=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2107-L2129)
Return the figure width and height in integral points or pixels.
When the figure is used on High DPI screens (and the backend supports it), the truncation to integers occurs after scaling by the device pixel ratio.
Parameters:
**physical**bool, default: False
Whether to return true physical pixels or logical pixels. Physical pixels may be used by backends that support HiDPI, but still configure the canvas using its actual size.
Returns:
**width, height**int
The size of the figure, in points or pixels, depending on the backend.
grab\_mouse(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1990-L1999)
Set the child [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") which is grabbing the mouse events.
Usually called by the widgets themselves. It is an error to call this if the mouse is already grabbed by another Axes.
inaxes(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1966-L1988)
Return the topmost visible [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") containing the point *xy*.
Parameters:
**xy**(float, float)
(x, y) pixel positions from left/bottom of the canvas.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or None
The topmost visible Axes containing the point, or None if there is no Axes at the point.
is\_saving()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1713-L1718)
Return whether the renderer is in the process of saving to a file, rather than rendering for an on-screen buffer.
key\_press\_event(*key*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1780-L1790)
[*Deprecated*] Pass a [`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent") to all functions connected to `key_press_event`.
#### Notes
Deprecated since version 3.6: Use callbacks.process('key\_press\_event', KeyEvent(...)) instead.
key\_release\_event(*key*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1792-L1802)
[*Deprecated*] Pass a [`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent") to all functions connected to `key_release_event`.
#### Notes
Deprecated since version 3.6: Use callbacks.process('key\_release\_event', KeyEvent(...)) instead.
leave\_notify\_event(*guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1917-L1933)
[*Deprecated*] Callback processing for the mouse cursor leaving the canvas.
Backend derived classes should call this function when leaving canvas.
Parameters:
**guiEvent**
The native UI event that generated the Matplotlib event.
#### Notes
Deprecated since version 3.6: Use callbacks.process('leave\_notify\_event', LocationEvent(...)) instead.
manager\_class[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2715-L2863)
alias of [`FigureManagerBase`](#matplotlib.backend_bases.FigureManagerBase "matplotlib.backend_bases.FigureManagerBase")
motion\_notify\_event(*x*, *y*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1890-L1915)
[*Deprecated*] Callback processing for mouse movement events.
Backend derived classes should call this function on any motion-notify-event.
This method will call all functions connected to the 'motion\_notify\_event' with a [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") instance.
Parameters:
**x**float
The canvas coordinates where 0=left.
**y**float
The canvas coordinates where 0=bottom.
**guiEvent**
The native UI event that generated the Matplotlib event.
#### Notes
Deprecated since version 3.6: Use callbacks.process('motion\_notify\_event', MouseEvent(...)) instead.
mpl\_connect(*s*, *func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2387-L2440)
Bind function *func* to event *s*.
Parameters:
**s**str
One of the following events ids:
* 'button\_press\_event'
* 'button\_release\_event'
* 'draw\_event'
* 'key\_press\_event'
* 'key\_release\_event'
* 'motion\_notify\_event'
* 'pick\_event'
* 'resize\_event'
* 'scroll\_event'
* 'figure\_enter\_event',
* 'figure\_leave\_event',
* 'axes\_enter\_event',
* 'axes\_leave\_event'
* 'close\_event'.
**func**callable
The callback function to be executed, which must have the signature:
```
def func(event: Event) -> Any
```
For the location events (button and key press/release), if the mouse is over the Axes, the `inaxes` attribute of the event will be set to the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") the event occurs is over, and additionally, the variables `xdata` and `ydata` attributes will be set to the mouse location in data coordinates. See [`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent") and [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") for more info.
Returns:
cid
A connection id that can be used with [`FigureCanvasBase.mpl_disconnect`](#matplotlib.backend_bases.FigureCanvasBase.mpl_disconnect "matplotlib.backend_bases.FigureCanvasBase.mpl_disconnect").
#### Examples
```
def on_press(event):
print('you pressed', event.button, event.xdata, event.ydata)
cid = canvas.mpl_connect('button_press_event', on_press)
```
mpl\_disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2442-L2454)
Disconnect the callback with id *cid*.
#### Examples
```
cid = canvas.mpl_connect('button_press_event', on_press)
# ... later
canvas.mpl_disconnect(cid)
```
*classmethod*new\_manager(*figure*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1692-L1703)
Create a new figure manager for *figure*, using this canvas class.
#### Notes
This method should not be reimplemented in subclasses. If custom manager creation logic is needed, please reimplement `FigureManager.create_with_canvas`.
new\_timer(*interval=None*, *callbacks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2460-L2483)
Create a new backend-specific subclass of `Timer`.
This is useful for getting periodic events through the backend's native event loop. Implemented only for backends with GUIs.
Parameters:
**interval**int
Timer interval in milliseconds.
**callbacks**list[tuple[callable, tuple, dict]]
Sequence of (func, args, kwargs) where `func(*args, **kwargs)` will be executed by the timer every *interval*.
Callbacks which return `False` or `0` will be removed from the timer.
#### Examples
```
>>> timer = fig.canvas.new_timer(callbacks=[(f1, (1,), {'a': 3})])
```
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1720-L1723)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use canvas.figure.pick instead.
pick\_event(*mouseevent*, *artist*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1804-L1820)
[*Deprecated*] Callback processing for pick events.
This method will be called by artists who are picked and will fire off [`PickEvent`](#matplotlib.backend_bases.PickEvent "matplotlib.backend_bases.PickEvent") callbacks registered listeners.
Note that artists are not pickable by default (see [`Artist.set_picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker")).
#### Notes
Deprecated since version 3.6: Use callbacks.process('pick\_event', PickEvent(...)) instead.
print\_figure(*filename*, *dpi=None*, *facecolor=None*, *edgecolor=None*, *orientation='portrait'*, *format=None*, *\**, *bbox\_inches=None*, *pad\_inches=None*, *bbox\_extra\_artists=None*, *backend=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2213-L2349)
Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you'll probably want to override this on hardcopy.
Parameters:
**filename**str or path-like or file-like
The file where the figure is saved.
**dpi**float, default: `[rcParams["savefig.dpi"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.dpi#matplotlibrc-sample)` (default: `'figure'`)
The dots per inch to save the figure in.
**facecolor**color or 'auto', default: `[rcParams["savefig.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.facecolor#matplotlibrc-sample)` (default: `'auto'`)
The facecolor of the figure. If 'auto', use the current figure facecolor.
**edgecolor**color or 'auto', default: `[rcParams["savefig.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.edgecolor#matplotlibrc-sample)` (default: `'auto'`)
The edgecolor of the figure. If 'auto', use the current figure edgecolor.
**orientation**{'landscape', 'portrait'}, default: 'portrait'
Only currently applies to PostScript printing.
**format**str, optional
Force a specific file format. If not given, the format is inferred from the *filename* extension, and if that fails from `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
**bbox\_inches**'tight' or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), default: `[rcParams["savefig.bbox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.bbox#matplotlibrc-sample)` (default: `None`)
Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure.
**pad\_inches**float, default: `[rcParams["savefig.pad\_inches"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.pad_inches#matplotlibrc-sample)` (default: `0.1`)
Amount of padding around the figure when *bbox\_inches* is 'tight'.
**bbox\_extra\_artists**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of extra artists that will be considered when the tight bbox is calculated.
**backend**str, optional
Use a non-default backend to render the file, e.g. to render a png file with the "cairo" backend rather than the default "agg", or a pdf file with the "pgf" backend rather than the default "pdf". Note that the default backend is normally sufficient. See [The builtin backends](https://matplotlib.org/stable/users/explain/backends.html#the-builtin-backends) for a list of valid backends for each file format. Custom backends can be referenced as "module://...".
release\_mouse(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2001-L2009)
Release the mouse grab held by the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") *ax*.
Usually called by the widgets. It is ok to call this even if *ax* doesn't have the mouse grab currently.
required\_interactive\_framework*=None*
resize(*w*, *h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1728-L1741)
UNUSED: Set the canvas size in pixels.
Certain backends may implement a similar method internally, but this is not a requirement of, nor is it used by, Matplotlib itself.
resize\_event()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1751-L1760)
[*Deprecated*] Pass a [`ResizeEvent`](#matplotlib.backend_bases.ResizeEvent "matplotlib.backend_bases.ResizeEvent") to all functions connected to `resize_event`.
#### Notes
Deprecated since version 3.6: Use callbacks.process('resize\_event', ResizeEvent(...)) instead.
scroll\_event(*x*, *y*, *step*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1822-L1842)
[*Deprecated*] Callback processing for scroll events.
Backend derived classes should call this function on any scroll wheel event. (*x*, *y*) are the canvas coords ((0, 0) is lower left). button and key are as defined in [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent").
This method will call all functions connected to the 'scroll\_event' with a [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent") instance.
#### Notes
Deprecated since version 3.6: Use callbacks.process('scroll\_event', MouseEvent(...)) instead.
*property*scroll\_pick\_id
set\_cursor(*cursor*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2011-L2027)
Set the current cursor.
This may have no effect if the backend does not display anything.
If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated.
Parameters:
**cursor**[`Cursors`](backend_tools_api#matplotlib.backend_tools.Cursors "matplotlib.backend_tools.Cursors")
The cursor to display over the canvas. Note: some backends may change the cursor for the entire window.
start\_event\_loop(*timeout=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2492-L2518)
Start a blocking event loop.
Such an event loop is used by interactive functions, such as [`ginput`](figure_api#matplotlib.figure.Figure.ginput "matplotlib.figure.Figure.ginput") and [`waitforbuttonpress`](figure_api#matplotlib.figure.Figure.waitforbuttonpress "matplotlib.figure.Figure.waitforbuttonpress"), to wait for events.
The event loop blocks until a callback function triggers [`stop_event_loop`](#matplotlib.backend_bases.FigureCanvasBase.stop_event_loop "matplotlib.backend_bases.FigureCanvasBase.stop_event_loop"), or *timeout* is reached.
If *timeout* is 0 or negative, never timeout.
Only interactive backends need to reimplement this method and it relies on [`flush_events`](#matplotlib.backend_bases.FigureCanvasBase.flush_events "matplotlib.backend_bases.FigureCanvasBase.flush_events") being properly implemented.
Interactive backends should implement this in a more native way.
stop\_event\_loop()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2520-L2527)
Stop the current blocking event loop.
Interactive backends need to reimplement this to match [`start_event_loop`](#matplotlib.backend_bases.FigureCanvasBase.start_event_loop "matplotlib.backend_bases.FigureCanvasBase.start_event_loop")
supports\_blit*=False*
switch\_backends(*FigureCanvasClass*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2374-L2385)
Instantiate an instance of FigureCanvasClass
This is used for backend switching, e.g., to instantiate a FigureCanvasPS from a FigureCanvasGTK. Note, deep copying is not done, so any changes to one of the instances (e.g., setting figure size or line props), will be reflected in the other
*class*matplotlib.backend\_bases.FigureManagerBase(*canvas*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2715-L2863)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A backend-independent abstraction of a figure container and controller.
The figure manager is used by pyplot to interact with the window in a backend-independent way. It's an adapter for the real (GUI) framework that represents the visual figure on screen.
GUI backends define from this class to translate common operations such as *show* or *resize* to the GUI-specific code. Non-GUI backends do not support these operations an can just use the base class.
This following basic operations are accessible:
**Window operations**
* [`show`](#matplotlib.backend_bases.FigureManagerBase.show "matplotlib.backend_bases.FigureManagerBase.show")
* [`destroy`](#matplotlib.backend_bases.FigureManagerBase.destroy "matplotlib.backend_bases.FigureManagerBase.destroy")
* [`full_screen_toggle`](#matplotlib.backend_bases.FigureManagerBase.full_screen_toggle "matplotlib.backend_bases.FigureManagerBase.full_screen_toggle")
* [`resize`](#matplotlib.backend_bases.FigureManagerBase.resize "matplotlib.backend_bases.FigureManagerBase.resize")
* [`get_window_title`](#matplotlib.backend_bases.FigureManagerBase.get_window_title "matplotlib.backend_bases.FigureManagerBase.get_window_title")
* [`set_window_title`](#matplotlib.backend_bases.FigureManagerBase.set_window_title "matplotlib.backend_bases.FigureManagerBase.set_window_title")
**Key and mouse button press handling**
The figure manager sets up default key and mouse button press handling by hooking up the [`key_press_handler`](#matplotlib.backend_bases.key_press_handler "matplotlib.backend_bases.key_press_handler") to the matplotlib event system. This ensures the same shortcuts and mouse actions across backends.
**Other operations**
Subclasses will have additional attributes and functions to access additional functionality. This is of course backend-specific. For example, most GUI backends have `window` and `toolbar` attributes that give access to the native GUI widgets of the respective framework.
Attributes:
**canvas**[`FigureCanvasBase`](#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
The backend-specific canvas instance.
**num**int or str
The figure number.
**key\_press\_handler\_id**int
The default key handler cid, when using the toolmanager. To disable the default key press handling use:
```
figure.canvas.mpl_disconnect(
figure.canvas.manager.key_press_handler_id)
```
**button\_press\_handler\_id**int
The default mouse button handler cid, when using the toolmanager. To disable the default button press handling use:
```
figure.canvas.mpl_disconnect(
figure.canvas.manager.button_press_handler_id)
```
*classmethod*create\_with\_canvas(*canvas\_class*, *figure*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2814-L2822)
Create a manager for a given *figure* using a specific *canvas\_class*.
Backends should override this method if they have specific needs for setting up the canvas or the manager.
destroy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2842-L2843)
full\_screen\_toggle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2845-L2846)
get\_window\_title()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2851-L2856)
Return the title text of the window containing the figure, or None if there is no window (e.g., a PS backend).
resize(*w*, *h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2848-L2849)
For GUI backends, resize the window (in physical pixels).
set\_window\_title(*title*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2858-L2863)
Set the title text of the window containing the figure.
This has no effect for non-GUI (e.g., PS) backends.
show()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2824-L2840)
For GUI backends, show the figure window and redraw. For non-GUI backends, raise an exception, unless running headless (i.e. on Linux with an unset DISPLAY); this exception is converted to a warning in [`Figure.show`](figure_api#matplotlib.figure.Figure.show "matplotlib.figure.Figure.show").
*class*matplotlib.backend\_bases.GraphicsContextBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L724-L1048)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
An abstract base class that provides color, line styles, etc.
copy\_properties(*gc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L747-L766)
Copy properties from *gc* to self.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L774-L779)
Return the alpha value used for blending - not supported on all backends.
get\_antialiased()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L781-L783)
Return whether the object should try to do antialiased rendering.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L785-L787)
Return the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle").
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L795-L808)
Return the clip path in the form (path, transform), where path is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance, and transform is an affine transform to apply to the path before clipping.
get\_clip\_rectangle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L789-L793)
Return the clip rectangle as a [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") instance.
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L810-L818)
Return the dash style as an (offset, dash-list) pair.
See [`set_dashes`](#matplotlib.backend_bases.GraphicsContextBase.set_dashes "matplotlib.backend_bases.GraphicsContextBase.set_dashes") for details.
Default value is (None, None).
get\_forced\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L820-L825)
Return whether the value given by get\_alpha() should be used to override any other alpha-channel values.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L843-L845)
Return the object identifier if one is set, None otherwise.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L988-L990)
Get the current hatch style.
get\_hatch\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L999-L1001)
Get the hatch color.
get\_hatch\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1007-L1009)
Get the hatch linewidth.
get\_hatch\_path(*density=6.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L992-L997)
Return a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") for the current hatch.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L827-L829)
Return the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L831-L833)
Return the line width in points.
get\_rgb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L835-L837)
Return a tuple of three or four floats from 0-1.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1011-L1029)
Return the sketch parameters for the artist.
Returns:
tuple or [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)")
A 3-tuple with the following elements:
* `scale`: The amplitude of the wiggle perpendicular to the source line.
* `length`: The length of the wiggle along the line.
* `randomness`: The scale factor by which the length is shrunken or expanded.
May return [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)") if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L847-L856)
Return the snap setting, which can be:
* True: snap vertices to the nearest pixel center
* False: leave vertices as-is
* None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L839-L841)
Return a url if one is set, None otherwise.
restore()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L768-L772)
Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack.
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L858-L873)
Set the alpha value used for blending - not supported on all backends.
If `alpha=None` (the default), the alpha components of the foreground and fill colors will be used to set their respective transparencies (where applicable); otherwise, `alpha` will override them.
set\_antialiased(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L875-L878)
Set whether object should be drawn with antialiased rendering.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L880-L889)
Set how to draw endpoints of lines.
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clip\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L895-L898)
Set the clip path to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None.
set\_clip\_rectangle(*rectangle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L891-L893)
Set the clip rectangle to a [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") or None.
set\_dashes(*dash\_offset*, *dash\_list*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L900-L928)
Set the dash style for the gc.
Parameters:
**dash\_offset**float
Distance, in points, into the dash pattern at which to start the pattern. It is usually set to 0.
**dash\_list**array-like or None
The on-off sequence as points. None specifies a solid line. All values must otherwise be non-negative (\(\ge 0\)).
#### Notes
See p. 666 of the PostScript [Language Reference](https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf) for more info.
set\_foreground(*fg*, *isRGBA=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L930-L948)
Set the foreground color.
Parameters:
**fg**color
**isRGBA**bool
If *fg* is known to be an `(r, g, b, a)` tuple, *isRGBA* can be set to True to improve performance.
set\_gid(*id*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L969-L971)
Set the id.
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L984-L986)
Set the hatch style (for fills).
set\_hatch\_color(*hatch\_color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1003-L1005)
Set the hatch color.
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L950-L959)
Set how to draw connections between line segments.
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_linewidth(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L961-L963)
Set the linewidth in points.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1031-L1048)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, default: 128
The length of the wiggle along the line, in pixels.
**randomness**float, default: 16
The scale factor by which the length is shrunken or expanded.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L973-L982)
Set the snap setting which may be:
* True: snap vertices to the nearest pixel center
* False: leave vertices as-is
* None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L965-L967)
Set the url for links in compatible backends.
*class*matplotlib.backend\_bases.KeyEvent(*name*, *canvas*, *key*, *x=0*, *y=0*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1463-L1497)
Bases: [`LocationEvent`](#matplotlib.backend_bases.LocationEvent "matplotlib.backend_bases.LocationEvent")
A key event (key press, key release).
A KeyEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") and [`LocationEvent`](#matplotlib.backend_bases.LocationEvent "matplotlib.backend_bases.LocationEvent") classes.
#### Notes
Modifier keys will be prefixed to the pressed key and will be in the order "ctrl", "alt", "super". The exception to this rule is when the pressed key is itself a modifier key, therefore "ctrl+alt" and "alt+control" can both be valid key values.
#### Examples
```
def on_key(event):
print('you pressed', event.key, event.xdata, event.ydata)
cid = fig.canvas.mpl_connect('key_press_event', on_key)
```
Attributes:
**key**None or str
The key(s) pressed. Could be *None*, a single case sensitive Unicode character ("g", "G", "#", etc.), a special key ("control", "shift", "f1", "up", etc.) or a combination of the above (e.g., "ctrl+alt+g", "ctrl+alt+G").
*class*matplotlib.backend\_bases.LocationEvent(*name*, *canvas*, *x*, *y*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1284-L1331)
Bases: [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
An event that has a screen location.
A LocationEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") class.
Attributes:
**x, y**int or None
Event location in pixels from bottom left of canvas.
**inaxes**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or None
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance over which the mouse is, if any.
**xdata, ydata**float or None
Data coordinates of the mouse within *inaxes*, or *None* if the mouse is not over an Axes.
lastevent*=None*
*class*matplotlib.backend\_bases.MouseButton(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1334-L1339)
Bases: [`IntEnum`](https://docs.python.org/3/library/enum.html#enum.IntEnum "(in Python v3.10)")
An enumeration.
BACK*=8*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
FORWARD*=9*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
LEFT*=1*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
MIDDLE*=2*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
RIGHT*=3*[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py)
*class*matplotlib.backend\_bases.MouseEvent(*name*, *canvas*, *x*, *y*, *button=None*, *key=None*, *step=0*, *dblclick=False*, *guiEvent=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1342-L1411)
Bases: [`LocationEvent`](#matplotlib.backend_bases.LocationEvent "matplotlib.backend_bases.LocationEvent")
A mouse event ('button\_press\_event', 'button\_release\_event', 'scroll\_event', 'motion\_notify\_event').
A MouseEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") and [`LocationEvent`](#matplotlib.backend_bases.LocationEvent "matplotlib.backend_bases.LocationEvent") classes.
#### Examples
```
def on_press(event):
print('you pressed', event.button, event.xdata, event.ydata)
cid = fig.canvas.mpl_connect('button_press_event', on_press)
```
Attributes:
**button**None or [`MouseButton`](#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or {'up', 'down'}
The button pressed. 'up' and 'down' are used for scroll events.
Note that LEFT and RIGHT actually refer to the "primary" and "secondary" buttons, i.e. if the user inverts their left and right buttons ("left-handed setting") then the LEFT button will be the one physically on the right.
If this is unset, *name* is "scroll\_event", and *step* is nonzero, then this will be set to "up" or "down" depending on the sign of *step*.
**key**None or str
The key pressed when the mouse event triggered, e.g. 'shift'. See [`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent").
Warning
This key is currently obtained from the last 'key\_press\_event' or 'key\_release\_event' that occurred within the canvas. Thus, if the last change of keyboard state occurred while the canvas did not have focus, this attribute will be wrong.
**step**float
The number of scroll steps (positive for 'up', negative for 'down'). This applies only to 'scroll\_event' and defaults to 0 otherwise.
**dblclick**bool
Whether the event is a double-click. This applies only to 'button\_press\_event' and is False otherwise. In particular, it's not used in 'button\_release\_event'.
*class*matplotlib.backend\_bases.NavigationToolbar2(*canvas*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2882-L3316)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Base class for the navigation cursor, version 2.
Backends must implement a canvas that handles connections for 'button\_press\_event' and 'button\_release\_event'. See [`FigureCanvasBase.mpl_connect()`](#matplotlib.backend_bases.FigureCanvasBase.mpl_connect "matplotlib.backend_bases.FigureCanvasBase.mpl_connect") for more information.
They must also define
[`save_figure()`](#matplotlib.backend_bases.NavigationToolbar2.save_figure "matplotlib.backend_bases.NavigationToolbar2.save_figure")
save the current figure
[`draw_rubberband()`](#matplotlib.backend_bases.NavigationToolbar2.draw_rubberband "matplotlib.backend_bases.NavigationToolbar2.draw_rubberband") (optional)
draw the zoom to rect "rubberband" rectangle
[`set_message()`](#matplotlib.backend_bases.NavigationToolbar2.set_message "matplotlib.backend_bases.NavigationToolbar2.set_message") (optional)
display message
[`set_history_buttons()`](#matplotlib.backend_bases.NavigationToolbar2.set_history_buttons "matplotlib.backend_bases.NavigationToolbar2.set_history_buttons") (optional)
you can change the history back / forward buttons to indicate disabled / enabled state.
and override `__init__` to set up the toolbar -- without forgetting to call the base-class init. Typically, `__init__` needs to set up toolbar buttons connected to the [`home`](#matplotlib.backend_bases.NavigationToolbar2.home "matplotlib.backend_bases.NavigationToolbar2.home"), [`back`](#matplotlib.backend_bases.NavigationToolbar2.back "matplotlib.backend_bases.NavigationToolbar2.back"), [`forward`](#matplotlib.backend_bases.NavigationToolbar2.forward "matplotlib.backend_bases.NavigationToolbar2.forward"), [`pan`](#matplotlib.backend_bases.NavigationToolbar2.pan "matplotlib.backend_bases.NavigationToolbar2.pan"), [`zoom`](#matplotlib.backend_bases.NavigationToolbar2.zoom "matplotlib.backend_bases.NavigationToolbar2.zoom"), and [`save_figure`](#matplotlib.backend_bases.NavigationToolbar2.save_figure "matplotlib.backend_bases.NavigationToolbar2.save_figure") methods and using standard icons in the "images" subdirectory of the data path.
That's it, we'll do the rest!
back(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2980-L2990)
Move back up the view lim stack.
For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.
configure\_subplots(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3275-L3292)
drag\_pan(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3124-L3130)
Callback for dragging in pan/zoom mode.
drag\_zoom(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3186-L3203)
Callback for dragging in zoom mode.
draw\_rubberband(*event*, *x0*, *y0*, *x1*, *y1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2958-L2963)
Draw a rectangle rubberband to indicate zoom limits.
Note that it is not guaranteed that `x0 <= x1` and `y0 <= y1`.
forward(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2992-L3002)
Move forward in the view lim stack.
For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.
home(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2968-L2978)
Restore the original view.
For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them.
mouse\_move(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3064-L3071)
pan(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3085-L3102)
Toggle the pan/zoom tool.
Pan with left button, zoom with right.
press\_pan(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3106-L3122)
Callback for mouse button press in pan/zoom mode.
press\_zoom(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3162-L3184)
Callback for mouse button press in zoom to rect mode.
push\_current()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3246-L3255)
Push the current view limits and position onto the stack.
release\_pan(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3132-L3143)
Callback for mouse button release in pan/zoom mode.
release\_zoom(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3205-L3244)
Callback for mouse button release in zoom to rect mode.
remove\_rubberband()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2965-L2966)
Remove the rubberband.
save\_figure(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3294-L3296)
Save the current figure.
set\_cursor(*cursor*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3298-L3308)
[*Deprecated*] Set the current cursor to one of the `Cursors` enums values.
If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated.
#### Notes
Deprecated since version 3.5: Use [`FigureCanvasBase.set_cursor`](#matplotlib.backend_bases.FigureCanvasBase.set_cursor "matplotlib.backend_bases.FigureCanvasBase.set_cursor") instead.
set\_history\_buttons()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3315-L3316)
Enable or disable the back/forward button.
set\_message(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2955-L2956)
Display a message on toolbar or in status bar.
toolitems*=(('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom\_to\_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure\_subplots'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save\_figure'))*
update()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3310-L3313)
Reset the Axes stack.
zoom(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3145-L3158)
*exception*matplotlib.backend\_bases.NonGuiException[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2710-L2712)
Bases: [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.10)")
Raised when trying show a figure in a non-GUI backend.
*class*matplotlib.backend\_bases.PickEvent(*name*, *canvas*, *mouseevent*, *artist*, *guiEvent=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1414-L1460)
Bases: [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
A pick event.
This event is fired when the user picks a location on the canvas sufficiently close to an artist that has been made pickable with [`Artist.set_picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker").
A PickEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") class.
#### Examples
Bind a function `on_pick()` to pick events, that prints the coordinates of the picked data point:
```
ax.plot(np.rand(100), 'o', picker=5) # 5 points tolerance
def on_pick(event):
line = event.artist
xdata, ydata = line.get_data()
ind = event.ind
print('on pick line:', np.array([xdata[ind], ydata[ind]]).T)
cid = fig.canvas.mpl_connect('pick_event', on_pick)
```
Attributes:
**mouseevent**[`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
The mouse event that generated the pick.
**artist**[`matplotlib.artist.Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The picked artist. Note that artists are not pickable by default (see [`Artist.set_picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker")).
**other**
Additional attributes may be present depending on the type of the picked object; e.g., a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") pick may define different extra attributes than a [`PatchCollection`](collections_api#matplotlib.collections.PatchCollection "matplotlib.collections.PatchCollection") pick.
*class*matplotlib.backend\_bases.RendererBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L151-L721)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
An abstract base class to handle drawing/rendering operations.
The following methods must be implemented in the backend for full functionality (though just implementing [`draw_path`](#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path") alone would give a highly capable backend):
* [`draw_path`](#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path")
* [`draw_image`](#matplotlib.backend_bases.RendererBase.draw_image "matplotlib.backend_bases.RendererBase.draw_image")
* [`draw_gouraud_triangle`](#matplotlib.backend_bases.RendererBase.draw_gouraud_triangle "matplotlib.backend_bases.RendererBase.draw_gouraud_triangle")
The following methods *should* be implemented in the backend for optimization reasons:
* [`draw_text`](#matplotlib.backend_bases.RendererBase.draw_text "matplotlib.backend_bases.RendererBase.draw_text")
* [`draw_markers`](#matplotlib.backend_bases.RendererBase.draw_markers "matplotlib.backend_bases.RendererBase.draw_markers")
* [`draw_path_collection`](#matplotlib.backend_bases.RendererBase.draw_path_collection "matplotlib.backend_bases.RendererBase.draw_path_collection")
* [`draw_quad_mesh`](#matplotlib.backend_bases.RendererBase.draw_quad_mesh "matplotlib.backend_bases.RendererBase.draw_quad_mesh")
close\_group(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L186-L191)
Close a grouping element with label *s*.
Only used by the SVG renderer.
draw\_gouraud\_triangle(*gc*, *points*, *colors*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L289-L304)
Draw a Gouraud-shaded triangle.
Parameters:
**gc**[`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**points**(3, 2) array-like
Array of (x, y) points for the triangle.
**colors**(3, 4) array-like
RGBA colors for each point of the triangle.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_gouraud\_triangles(*gc*, *triangles\_array*, *colors\_array*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L306-L322)
Draw a series of Gouraud triangles.
Parameters:
**points**(N, 3, 2) array-like
Array of *N* (x, y) points for the triangles.
**colors**(N, 3, 4) array-like
Array of *N* RGBA colors for each point of the triangles.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_image(*gc*, *x*, *y*, *im*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L456-L486)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that [`option_scale_image`](#matplotlib.backend_bases.RendererBase.option_scale_image "matplotlib.backend_bases.RendererBase.option_scale_image") returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backend_bases.RendererBase.draw_image "matplotlib.backend_bases.RendererBase.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *trans*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L197-L221)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L193-L195)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_path\_collection(*gc*, *master\_transform*, *paths*, *all\_transforms*, *offsets*, *offset\_trans*, *facecolors*, *edgecolors*, *linewidths*, *linestyles*, *antialiaseds*, *urls*, *offset\_position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L223-L266)
Draw a collection of *paths*.
Each path is first transformed by the corresponding entry in *all\_transforms* (a list of (3, 3) matrices) and then by *master\_transform*. They are then translated by the corresponding entry in *offsets*, which has been first transformed by *offset\_trans*.
*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and *antialiased* are lists that set the corresponding properties.
*offset\_position* is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backend_bases.RendererBase.draw_path "matplotlib.backend_bases.RendererBase.draw_path"). Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods `_iter_collection_raw_paths` and `_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of [`draw_path_collection`](#matplotlib.backend_bases.RendererBase.draw_path_collection "matplotlib.backend_bases.RendererBase.draw_path_collection") can be made globally.
draw\_quad\_mesh(*gc*, *master\_transform*, *meshWidth*, *meshHeight*, *coordinates*, *offsets*, *offsetTrans*, *facecolors*, *antialiased*, *edgecolors*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L268-L287)
Draw a quadmesh.
The base (fallback) implementation converts the quadmesh to paths and then calls [`draw_path_collection`](#matplotlib.backend_bases.RendererBase.draw_path_collection "matplotlib.backend_bases.RendererBase.draw_path_collection").
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *\**, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L505-L508)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L510-L545)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
flipy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L632-L638)
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L640-L642)
Return the canvas width and height in display coords.
get\_image\_magnification()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L448-L454)
Get the factor by which to magnify images passed to [`draw_image`](#matplotlib.backend_bases.RendererBase.draw_image "matplotlib.backend_bases.RendererBase.draw_image"). Allows a backend to have images at a different resolution to other artists.
get\_texmanager()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L644-L648)
Return the [`TexManager`](texmanager_api#matplotlib.texmanager.TexManager "matplotlib.texmanager.TexManager") instance.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L602-L630)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
new\_gc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L650-L652)
Return an instance of a [`GraphicsContextBase`](#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase").
open\_group(*s*, *gid=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L179-L184)
Open a grouping element with label *s* and *gid* (if set) as id.
Only used by the SVG renderer.
option\_image\_nocomposite()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L488-L496)
Return whether image composition by Matplotlib should be skipped.
Raster backends should usually return False (letting the C-level rasterizer take care of image composition); vector backends should usually return `not rcParams["image.composite_image"]`.
option\_scale\_image()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L498-L503)
Return whether arbitrary affine transformations in [`draw_image`](#matplotlib.backend_bases.RendererBase.draw_image "matplotlib.backend_bases.RendererBase.draw_image") are supported (True for most vector backends).
points\_to\_pixels(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L654-L673)
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
```
points to pixels = points * pixels_per_inch/72 * dpi/72
```
Parameters:
**points**float or array-like
a float or a numpy array of float
Returns:
Points converted to pixels
start\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L690-L695)
Switch to a temporary renderer for image filtering effects.
Currently only supported by the agg renderer.
start\_rasterizing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L675-L680)
Switch to the raster renderer.
Used by [`MixedModeRenderer`](backend_mixed_api#matplotlib.backends.backend_mixed.MixedModeRenderer "matplotlib.backends.backend_mixed.MixedModeRenderer").
stop\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L697-L704)
Switch back to the original renderer. The contents of the temporary renderer is processed with the *filter\_func* and is drawn on the original renderer as an image.
Currently only supported by the agg renderer.
stop\_rasterizing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L682-L688)
Switch back to the vector renderer and draw the contents of the raster renderer as an image on the vector renderer.
Used by [`MixedModeRenderer`](backend_mixed_api#matplotlib.backends.backend_mixed.MixedModeRenderer "matplotlib.backends.backend_mixed.MixedModeRenderer").
*class*matplotlib.backend\_bases.ResizeEvent(*name*, *canvas*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1260-L1277)
Bases: [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event")
An event triggered by a canvas resize.
A ResizeEvent has a number of special attributes in addition to those defined by the parent [`Event`](#matplotlib.backend_bases.Event "matplotlib.backend_bases.Event") class.
Attributes:
**width**int
Width of the canvas in pixels.
**height**int
Height of the canvas in pixels.
*class*matplotlib.backend\_bases.ShowBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3573-L3581)
Bases: `_Backend`
Simple base class to generate a `show()` function in backends.
Subclass must override `mainloop()` method.
*class*matplotlib.backend\_bases.TimerBase(*interval=None*, *callbacks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1051-L1203)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A base class for providing timer events, useful for things animations. Backends need to implement a few specific methods in order to use their own timing mechanisms so that the timer events are integrated into their event loops.
Subclasses must override the following methods:
* `_timer_start`: Backend-specific code for starting the timer.
* `_timer_stop`: Backend-specific code for stopping the timer.
Subclasses may additionally override the following methods:
* `_timer_set_single_shot`: Code for setting the timer to single shot operating mode, if supported by the timer object. If not, the `Timer` class itself will store the flag and the `_on_timer` method should be overridden to support such behavior.
* `_timer_set_interval`: Code for setting the interval on the timer, if there is a method for doing so on the timer object.
* `_on_timer`: The internal function that any timer object should call, which will handle the task of running all callbacks that have been set.
Parameters:
**interval**int, default: 1000ms
The time between timer events in milliseconds. Will be stored as `timer.interval`.
**callbacks**list[tuple[callable, tuple, dict]]
List of (func, args, kwargs) tuples that will be called upon timer events. This list is accessible as `timer.callbacks` and can be manipulated directly, or the functions [`add_callback`](#matplotlib.backend_bases.TimerBase.add_callback "matplotlib.backend_bases.TimerBase.add_callback") and [`remove_callback`](#matplotlib.backend_bases.TimerBase.remove_callback "matplotlib.backend_bases.TimerBase.remove_callback") can be used.
add\_callback(*func*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1146-L1155)
Register *func* to be called by timer when the event fires. Any additional arguments provided will be passed to *func*.
This function returns *func*, which makes it possible to use it as a decorator.
*property*interval
The time between timer events, in milliseconds.
remove\_callback(*func*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1157-L1178)
Remove *func* from list of callbacks.
*args* and *kwargs* are optional and used to distinguish between copies of the same function registered to be called with different arguments. This behavior is deprecated. In the future, `*args, **kwargs` won't be considered anymore; to keep a specific callback removable by itself, pass it to [`add_callback`](#matplotlib.backend_bases.TimerBase.add_callback "matplotlib.backend_bases.TimerBase.add_callback") as a [`functools.partial`](https://docs.python.org/3/library/functools.html#functools.partial "(in Python v3.10)") object.
*property*single\_shot
Whether this timer should stop after a single run.
start(*interval=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1099-L1111)
Start the timer object.
Parameters:
**interval**int, optional
Timer interval in milliseconds; overrides a previously set interval if provided.
stop()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L1113-L1115)
Stop the timer.
*class*matplotlib.backend\_bases.ToolContainerBase(*toolmanager*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3319-L3471)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Base class for all tool containers, e.g. toolbars.
Attributes:
**toolmanager**[`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager")
The tools with which this `ToolContainer` wants to communicate.
add\_tool(*tool*, *group*, *position=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3353-L3376)
Add a tool to this container.
Parameters:
**tool**tool\_like
The tool to add, see [`ToolManager.get_tool`](backend_managers_api#matplotlib.backend_managers.ToolManager.get_tool "matplotlib.backend_managers.ToolManager.get_tool").
**group**str
The name of the group to add this tool to.
**position**int, default: -1
The position within the group to place this tool.
add\_toolitem(*name*, *group*, *position*, *image*, *description*, *toggle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3404-L3432)
Add a toolitem to the container.
This method must be implemented per backend.
The callback associated with the button click event, must be *exactly* `self.trigger_tool(name)`.
Parameters:
**name**str
Name of the tool to add, this gets used as the tool's ID and as the default label of the buttons.
**group**str
Name of the group that this tool belongs to.
**position**int
Position of the tool within its group, if -1 it goes at the end.
**image**str
Filename of the image for the button or [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)").
**description**str
Description of the tool, used for the tooltips.
**toggle**bool
* [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") : The button is a toggle (change the pressed/unpressed state between consecutive clicks).
* [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)") : The button is a normal button (returns to unpressed state after release).
remove\_toolitem(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3447-L3460)
Remove a toolitem from the `ToolContainer`.
This method must get implemented per backend.
Called when [`ToolManager`](backend_managers_api#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager") emits a `tool_removed_event`.
Parameters:
**name**str
Name of the tool to remove.
set\_message(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3462-L3471)
Display a message on the toolbar.
Parameters:
**s**str
Message text.
toggle\_toolitem(*name*, *toggled*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3434-L3445)
Toggle the toolitem without firing event.
Parameters:
**name**str
Id of the tool to toggle.
**toggled**bool
Whether to set this tool as toggled or not.
trigger\_tool(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L3393-L3402)
Trigger the tool.
Parameters:
**name**str
Name (id) of the tool triggered from within the container.
matplotlib.backend\_bases.button\_press\_handler(*event*, *canvas=None*, *toolbar=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2691-L2707)
The default Matplotlib button actions for extra mouse buttons.
Parameters are as for [`key_press_handler`](#matplotlib.backend_bases.key_press_handler "matplotlib.backend_bases.key_press_handler"), except that *event* is a [`MouseEvent`](#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent").
matplotlib.backend\_bases.get\_registered\_canvas\_class(*format*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L137-L148)
Return the registered default canvas for given file format. Handles deferred import of required backend.
matplotlib.backend\_bases.key\_press\_handler(*event*, *canvas=None*, *toolbar=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L2530-L2688)
Implement the default Matplotlib key bindings for the canvas and toolbar described at [Navigation keyboard shortcuts](https://matplotlib.org/stable/users/explain/interactive.html#key-event-handling).
Parameters:
**event**[`KeyEvent`](#matplotlib.backend_bases.KeyEvent "matplotlib.backend_bases.KeyEvent")
A key press/release event.
**canvas**[`FigureCanvasBase`](#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase"), default: `event.canvas`
The backend-specific canvas instance. This parameter is kept for back-compatibility, but, if set, should always be equal to `event.canvas`.
**toolbar**[`NavigationToolbar2`](#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2"), default: `event.canvas.toolbar`
The navigation cursor toolbar. This parameter is kept for back-compatibility, but, if set, should always be equal to `event.canvas.toolbar`.
matplotlib.backend\_bases.register\_backend(*format*, *backend*, *description=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_bases.py#L118-L134)
Register a backend for saving to a given file format.
Parameters:
**format**str
File extension
**backend**module string or canvas class
Backend for handling file output
**description**str, default: ""
Description of the file type.
| programming_docs |
matplotlib backend_wxagg, backend_wxcairo backend\_wxagg, backend\_wxcairo
================================
**NOTE** These backends are not documented here, to avoid adding a dependency to building the docs.
matplotlib backend_webagg backend\_webagg
===============
Displays Agg images in the browser, with interactivity
matplotlib.backends.backend\_webagg.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L55-L56)
alias of [`FigureCanvasWebAgg`](#matplotlib.backends.backend_webagg.FigureCanvasWebAgg "matplotlib.backends.backend_webagg.FigureCanvasWebAgg")
*class*matplotlib.backends.backend\_webagg.FigureCanvasWebAgg(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L55-L56)
Bases: `FigureCanvasWebAggCore`
manager\_class[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L51-L52)
alias of [`FigureManagerWebAgg`](#matplotlib.backends.backend_webagg.FigureManagerWebAgg "matplotlib.backends.backend_webagg.FigureManagerWebAgg")
matplotlib.backends.backend\_webagg.FigureManager[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L51-L52)
alias of [`FigureManagerWebAgg`](#matplotlib.backends.backend_webagg.FigureManagerWebAgg "matplotlib.backends.backend_webagg.FigureManagerWebAgg")
*class*matplotlib.backends.backend\_webagg.FigureManagerWebAgg(*canvas*, *num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L51-L52)
Bases: `FigureManagerWebAgg`
*class*matplotlib.backends.backend\_webagg.ServerThread(*group=None*, *target=None*, *name=None*, *args=()*, *kwargs=None*, *\**, *daemon=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L43-L45)
Bases: [`Thread`](https://docs.python.org/3/library/threading.html#threading.Thread "(in Python v3.10)")
This constructor should always be called with keyword arguments. Arguments are:
*group* should be None; reserved for future extension when a ThreadGroup class is implemented.
*target* is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.
*name* is the thread name. By default, a unique name is constructed of the form "Thread-N" where N is a small decimal number.
*args* is the argument tuple for the target invocation. Defaults to ().
*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to {}.
If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.\_\_init\_\_()) before doing anything else to the thread.
run()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L44-L45)
Method representing the thread's activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
*class*matplotlib.backends.backend\_webagg.WebAggApplication(*url\_prefix=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L59-L282)
Bases: [`Application`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.Application "(in Tornado v6.2)")
*class*AllFiguresPage(*application*, *request*, *\**, *url\_prefix=''*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L88-L101)
Bases: [`RequestHandler`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler "(in Tornado v6.2)")
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L93-L101)
*class*Download(*application:[Application](https://www.tornadoweb.org/en/stable/web.html#tornado.web.Application "(in Tornado v6.2)")*, *request:[HTTPServerRequest](https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest "(in Tornado v6.2)")*, *\*\*kwargs:[Any](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.10)")*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L111-L119)
Bases: [`RequestHandler`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler "(in Tornado v6.2)")
get(*fignum*, *fmt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L112-L119)
*class*FavIcon(*application:[Application](https://www.tornadoweb.org/en/stable/web.html#tornado.web.Application "(in Tornado v6.2)")*, *request:[HTTPServerRequest](https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest "(in Tornado v6.2)")*, *\*\*kwargs:[Any](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.10)")*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L63-L67)
Bases: [`RequestHandler`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler "(in Tornado v6.2)")
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L64-L67)
*class*MplJs(*application:[Application](https://www.tornadoweb.org/en/stable/web.html#tornado.web.Application "(in Tornado v6.2)")*, *request:[HTTPServerRequest](https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest "(in Tornado v6.2)")*, *\*\*kwargs:[Any](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.10)")*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L103-L109)
Bases: [`RequestHandler`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler "(in Tornado v6.2)")
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L104-L109)
*class*SingleFigurePage(*application*, *request*, *\**, *url\_prefix=''*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L69-L86)
Bases: [`RequestHandler`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler "(in Tornado v6.2)")
get(*fignum*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L74-L86)
*class*WebSocket(*application:[Application](https://www.tornadoweb.org/en/stable/web.html#tornado.web.Application "(in Tornado v6.2)")*, *request:[HTTPServerRequest](https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest "(in Tornado v6.2)")*, *\*\*kwargs:[Any](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.10)")*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L121-L158)
Bases: [`WebSocketHandler`](https://www.tornadoweb.org/en/stable/websocket.html#tornado.websocket.WebSocketHandler "(in Tornado v6.2)")
on\_close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L131-L132)
Invoked when the WebSocket is closed.
If the connection was closed cleanly and a status code or reason phrase was supplied, these values will be available as the attributes `self.close_code` and `self.close_reason`.
Changed in version 4.0: Added `close_code` and `close_reason` attributes.
on\_message(*message*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L134-L147)
Handle incoming messages on the WebSocket
This method must be overridden.
Changed in version 4.5: `on_message` can be a coroutine.
open(*fignum*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L124-L129)
Invoked when a new WebSocket is opened.
The arguments to [`open`](#matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open "matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open") are extracted from the [`tornado.web.URLSpec`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.URLSpec "(in Tornado v6.2)") regular expression, just like the arguments to [`tornado.web.RequestHandler.get`](https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.get "(in Tornado v6.2)").
[`open`](#matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open "matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open") may be a coroutine. [`on_message`](#matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.on_message "matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.on_message") will not be called until [`open`](#matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open "matplotlib.backends.backend_webagg.WebAggApplication.WebSocket.open") has returned.
Changed in version 5.1: `open` may be a coroutine.
send\_binary(*blob*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L152-L158)
send\_json(*content*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L149-L150)
supports\_binary*=True*
*classmethod*initialize(*url\_prefix=''*, *port=None*, *address=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L200-L244)
initialized*=False*
*classmethod*start()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L246-L282)
started*=False*
matplotlib.backends.backend\_webagg.ipython\_inline\_display(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L285-L301)
matplotlib.backends.backend\_webagg.show(*\**, *block=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_webagg.py#L309-L325)
Show all figures.
[`show`](#matplotlib.backends.backend_webagg.show "matplotlib.backends.backend_webagg.show") blocks by calling `mainloop` if *block* is `True`, or if it is `None` and we are neither in IPython's `%pylab` mode, nor in `interactive` mode.
matplotlib matplotlib._api matplotlib.\_api
================
Helper functions for managing the Matplotlib API.
This documentation is only relevant for Matplotlib developers, not for users.
Warning
This module and its submodules are for internal use only. Do not use them in your own code. We may change the API at any time with no warning.
matplotlib.\_api.caching\_module\_getattr(*cls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L195-L227)
Helper decorator for implementing module-level `__getattr__` as a class.
This decorator must be used at the module toplevel as follows:
```
@caching_module_getattr
class __getattr__: # The class *must* be named ``__getattr__``.
@property # Only properties are taken into account.
def name(self): ...
```
The `__getattr__` class will be replaced by a `__getattr__` function such that trying to access `name` on the module will resolve the corresponding property (which may be decorated e.g. with `_api.deprecated` for deprecating module globals). The properties are all implicitly cached. Moreover, a suitable AttributeError is generated and raised if no property with the given name exists.
matplotlib.\_api.check\_getitem(*\_mapping*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L173-L192)
*kwargs* must consist of a single *key, value* pair. If *key* is in *\_mapping*, return `_mapping[value]`; else, raise an appropriate ValueError.
#### Examples
```
>>> _api.check_getitem({"foo": "bar"}, arg=arg)
```
matplotlib.\_api.check\_in\_list(*\_values*, *\**, *\_print\_supported\_values=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L101-L131)
For each *key, value* pair in *kwargs*, check that *value* is in *\_values*.
Parameters:
**\_values**iterable
Sequence of values to check on.
**\_print\_supported\_values**bool, default: True
Whether to print *\_values* when raising ValueError.
**\*\*kwargs**dict
*key, value* pairs as keyword arguments to find in *\_values*.
Raises:
ValueError
If any *value* in *kwargs* is not found in *\_values*.
#### Examples
```
>>> _api.check_in_list(["foo", "bar"], arg=arg, other_arg=other_arg)
```
matplotlib.\_api.check\_isinstance(*\_types*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L65-L98)
For each *key, value* pair in *kwargs*, check that *value* is an instance of one of *\_types*; if not, raise an appropriate TypeError.
As a special case, a `None` entry in *\_types* is treated as NoneType.
#### Examples
```
>>> _api.check_isinstance((SomeClass, None), arg=arg)
```
matplotlib.\_api.check\_shape(*\_shape*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L134-L170)
For each *key, value* pair in *kwargs*, check that *value* has the shape *\_shape*, if not, raise an appropriate ValueError.
*None* in the shape is treated as a "free" size that can have any length. e.g. (None, 2) -> (N, 2)
The values checked must be numpy arrays.
#### Examples
To check for (N, 2) shaped arrays
```
>>> _api.check_shape((None, 2), arg=arg, other_arg=other_arg)
```
*class*matplotlib.\_api.classproperty(*fget*, *fset=None*, *fdel=None*, *doc=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L27-L58)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Like [`property`](https://docs.python.org/3/library/functions.html#property "(in Python v3.10)"), but also triggers on access via the class, and it is the *class* that's passed as argument.
#### Examples
```
class C:
@classproperty
def foo(cls):
return cls.__name__
assert C.foo == "C"
```
*property*fget
matplotlib.\_api.define\_aliases(*alias\_d*, *cls=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L230-L282)
Class decorator for defining property aliases.
Use as
```
@_api.define_aliases({"property": ["alias", ...], ...})
class C: ...
```
For each property, if the corresponding `get_property` is defined in the class so far, an alias named `get_alias` will be defined; the same will be done for setters. If neither the getter nor the setter exists, an exception will be raised.
The alias map is stored as the `_alias_map` attribute on the class and can be used by [`normalize_kwargs`](cbook_api#matplotlib.cbook.normalize_kwargs "matplotlib.cbook.normalize_kwargs") (which assumes that higher priority aliases come last).
matplotlib.\_api.recursive\_subclasses(*cls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L337-L341)
Yield *cls* and direct and indirect subclasses of *cls*.
matplotlib.\_api.select\_matching\_signature(*funcs*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L285-L334)
Select and call the function that accepts `*args, **kwargs`.
*funcs* is a list of functions which should not raise any exception (other than [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") if the arguments passed do not match their signature).
[`select_matching_signature`](#matplotlib._api.select_matching_signature "matplotlib._api.select_matching_signature") tries to call each of the functions in *funcs* with `*args, **kwargs` (in the order in which they are given). Calls that fail with a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") are silently skipped. As soon as a call succeeds, [`select_matching_signature`](#matplotlib._api.select_matching_signature "matplotlib._api.select_matching_signature") returns its return value. If no function accepts `*args, **kwargs`, then the [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") raised by the last failing call is re-raised.
Callers should normally make sure that any `*args, **kwargs` can only bind a single *func* (to avoid any ambiguity), although this is not checked by [`select_matching_signature`](#matplotlib._api.select_matching_signature "matplotlib._api.select_matching_signature").
#### Notes
[`select_matching_signature`](#matplotlib._api.select_matching_signature "matplotlib._api.select_matching_signature") is intended to help implementing signature-overloaded functions. In general, such functions should be avoided, except for back-compatibility concerns. A typical use pattern is
```
def my_func(*args, **kwargs):
params = select_matching_signature(
[lambda old1, old2: locals(), lambda new: locals()],
*args, **kwargs)
if "old1" in params:
warn_deprecated(...)
old1, old2 = params.values() # note that locals() is ordered.
else:
new, = params.values()
# do things with params
```
which allows *my\_func* to be called either with two parameters (*old1* and *old2*) or a single one (*new*). Note that the new signature is given last, so that callers get a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") corresponding to the new signature if the arguments they passed in do not match any signature.
matplotlib.\_api.warn\_external(*message*, *category=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/__init__.py#L344-L363)
[`warnings.warn`](https://docs.python.org/3/library/warnings.html#warnings.warn "(in Python v3.10)") wrapper that sets *stacklevel* to "outside Matplotlib".
The original emitter of the warning can be obtained by patching this function back to [`warnings.warn`](https://docs.python.org/3/library/warnings.html#warnings.warn "(in Python v3.10)"), i.e. `_api.warn_external =
warnings.warn` (or `functools.partial(warnings.warn, stacklevel=2)`, etc.).
Helper functions for deprecating parts of the Matplotlib API.
This documentation is only relevant for Matplotlib developers, not for users.
Warning
This module is for internal use only. Do not use it in your own code. We may change the API at any time with no warning.
*exception*matplotlib.\_api.deprecation.MatplotlibDeprecationWarning[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L20-L21)
Bases: [`DeprecationWarning`](https://docs.python.org/3/library/exceptions.html#DeprecationWarning "(in Python v3.10)")
A class for issuing deprecation warnings for Matplotlib users.
matplotlib.\_api.deprecation.delete\_parameter(*since*, *name*, *func=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L316-L413)
Decorator indicating that parameter *name* of *func* is being deprecated.
The actual implementation of *func* should keep the *name* parameter in its signature, or accept a `**kwargs` argument (through which *name* would be passed).
Parameters that come after the deprecated parameter effectively become keyword-only (as they cannot be passed positionally without triggering the DeprecationWarning on the deprecated parameter), and should be marked as such after the deprecation period has passed and the deprecated parameter is removed.
Parameters other than *since*, *name*, and *func* are keyword-only and forwarded to [`warn_deprecated`](#matplotlib._api.deprecation.warn_deprecated "matplotlib._api.deprecation.warn_deprecated").
#### Examples
```
@_api.delete_parameter("3.1", "unused")
def func(used_arg, other_arg, unused, more_args): ...
```
matplotlib.\_api.deprecation.deprecate\_method\_override(*method*, *obj*, *\**, *allow\_empty=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L464-L503)
Return `obj.method` with a deprecation if it was overridden, else None.
Parameters:
**method**
An unbound method, i.e. an expression of the form `Class.method_name`. Remember that within the body of a method, one can always use `__class__` to refer to the class that is currently being defined.
**obj**
Either an object of the class where *method* is defined, or a subclass of that class.
**allow\_empty**bool, default: False
Whether to allow overrides by "empty" methods without emitting a warning.
**\*\*kwargs**
Additional parameters passed to [`warn_deprecated`](#matplotlib._api.deprecation.warn_deprecated "matplotlib._api.deprecation.warn_deprecated") to generate the deprecation warning; must at least include the "since" key.
*class*matplotlib.\_api.deprecation.deprecate\_privatize\_attribute(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L223-L246)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Helper to deprecate public access to an attribute (or method).
This helper should only be used at class scope, as follows:
```
class Foo:
attr = _deprecate_privatize_attribute(*args, **kwargs)
```
where *all* parameters are forwarded to [`deprecated`](#matplotlib._api.deprecation.deprecated "matplotlib._api.deprecation.deprecated"). This form makes `attr` a property which forwards read and write access to `self._attr` (same name but with a leading underscore), with a deprecation warning. Note that the attribute name is derived from *the name this helper is assigned to*. This helper also works for deprecating methods.
matplotlib.\_api.deprecation.deprecated(*since*, *\**, *message=''*, *name=''*, *alternative=''*, *pending=False*, *obj\_type=None*, *addendum=''*, *removal=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L99-L220)
Decorator to mark a function, a class, or a property as deprecated.
When deprecating a classmethod, a staticmethod, or a property, the `@deprecated` decorator should go *under* `@classmethod` and `@staticmethod` (i.e., [`deprecated`](#matplotlib._api.deprecation.deprecated "matplotlib._api.deprecation.deprecated") should directly decorate the underlying callable), but *over* `@property`.
When deprecating a class `C` intended to be used as a base class in a multiple inheritance hierarchy, `C` *must* define an `__init__` method (if `C` instead inherited its `__init__` from its own base class, then `@deprecated` would mess up `__init__` inheritance when installing its own (deprecation-emitting) `C.__init__`).
Parameters are the same as for [`warn_deprecated`](#matplotlib._api.deprecation.warn_deprecated "matplotlib._api.deprecation.warn_deprecated"), except that *obj\_type* defaults to 'class' if decorating a class, 'attribute' if decorating a property, and 'function' otherwise.
#### Examples
```
@deprecated('1.4.0')
def the_function_to_deprecate():
pass
```
matplotlib.\_api.deprecation.make\_keyword\_only(*since*, *name*, *func=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L416-L461)
Decorator indicating that passing parameter *name* (or any of the following ones) positionally to *func* is being deprecated.
When used on a method that has a pyplot wrapper, this should be the outermost decorator, so that `boilerplate.py` can access the original signature.
matplotlib.\_api.deprecation.rename\_parameter(*since*, *old*, *new*, *func=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L257-L305)
Decorator indicating that parameter *old* of *func* is renamed to *new*.
The actual implementation of *func* should use *new*, not *old*. If *old* is passed to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is also passed by keyword (this is to simplify pyplot wrapper functions, which always pass *new* explicitly to the Axes method). If *new* is also passed but positionally, a TypeError will be raised by the underlying function during argument binding.
#### Examples
```
@_api.rename_parameter("3.1", "bad_name", "good_name")
def func(good_name): ...
```
matplotlib.\_api.deprecation.suppress\_matplotlib\_deprecation\_warning()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L506-L510)
matplotlib.\_api.deprecation.warn\_deprecated(*since*, *\**, *message=''*, *name=''*, *alternative=''*, *pending=False*, *obj\_type=''*, *addendum=''*, *removal=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L50-L96)
Display a standardized deprecation.
Parameters:
**since**str
The release at which this API became deprecated.
**message**str, optional
Override the default deprecation message. The `%(since)s`, `%(name)s`, `%(alternative)s`, `%(obj_type)s`, `%(addendum)s`, and `%(removal)s` format specifiers will be replaced by the values of the respective arguments passed to this function.
**name**str, optional
The name of the deprecated object.
**alternative**str, optional
An alternative API that the user may use in place of the deprecated API. The deprecation warning will tell the user about this alternative if provided.
**pending**bool, optional
If True, uses a PendingDeprecationWarning instead of a DeprecationWarning. Cannot be used together with *removal*.
**obj\_type**str, optional
The object type being deprecated.
**addendum**str, optional
Additional text appended directly to the final message.
**removal**str, optional
The expected removal version. With the default (an empty string), a removal version is automatically computed from *since*. Set to other Falsy values to not schedule a removal date. Cannot be used together with *pending*.
#### Examples
```
# To warn of the deprecation of "matplotlib.name_of_module"
warn_deprecated('1.4.0', name='matplotlib.name_of_module',
obj_type='module')
```
| programming_docs |
matplotlib matplotlib matplotlib
==========
An object-oriented plotting library.
A procedural interface is provided by the companion pyplot module, which may be imported directly, e.g.:
```
import matplotlib.pyplot as plt
```
or using ipython:
```
ipython
```
at your terminal, followed by:
```
In [1]: %matplotlib
In [2]: import matplotlib.pyplot as plt
```
at the ipython shell prompt.
For the most part, direct use of the explicit object-oriented library is encouraged when programming; the implicit pyplot interface is primarily for working interactively. The exceptions to this suggestion are the pyplot functions [`pyplot.figure`](_as_gen/matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure"), [`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot"), [`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots"), and [`pyplot.savefig`](_as_gen/matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig"), which can greatly simplify scripting. See [Matplotlib Application Interfaces (APIs)](https://matplotlib.org/stable/users/explain/api_interfaces.html#api-interfaces) for an explanation of the tradeoffs between the implicit and explicit interfaces.
Modules include:
[`matplotlib.axes`](axes_api#module-matplotlib.axes "matplotlib.axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") class. Most pyplot functions are wrappers for [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") methods. The axes module is the highest level of OO access to the library.
[`matplotlib.figure`](figure_api#module-matplotlib.figure "matplotlib.figure")
The [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") class.
[`matplotlib.artist`](artist_api#module-matplotlib.artist "matplotlib.artist")
The [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") base class for all classes that draw things.
[`matplotlib.lines`](lines_api#module-matplotlib.lines "matplotlib.lines")
The [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") class for drawing lines and markers.
[`matplotlib.patches`](patches_api#module-matplotlib.patches "matplotlib.patches")
Classes for drawing polygons.
[`matplotlib.text`](text_api#module-matplotlib.text "matplotlib.text")
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") and [`Annotation`](text_api#matplotlib.text.Annotation "matplotlib.text.Annotation") classes.
[`matplotlib.image`](image_api#module-matplotlib.image "matplotlib.image")
The [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") and [`FigureImage`](image_api#matplotlib.image.FigureImage "matplotlib.image.FigureImage") classes.
[`matplotlib.collections`](collections_api#module-matplotlib.collections "matplotlib.collections")
Classes for efficient drawing of groups of lines or polygons.
[`matplotlib.colors`](colors_api#module-matplotlib.colors "matplotlib.colors")
Color specifications and making colormaps.
[`matplotlib.cm`](cm_api#module-matplotlib.cm "matplotlib.cm")
Colormaps, and the [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") mixin class for providing color mapping functionality to other classes.
[`matplotlib.ticker`](ticker_api#module-matplotlib.ticker "matplotlib.ticker")
Calculation of tick mark locations and formatting of tick labels.
[`matplotlib.backends`](index_backend_api#module-matplotlib.backends "matplotlib.backends")
A subpackage with modules for various GUI libraries and output formats.
The base matplotlib namespace includes:
[`rcParams`](#matplotlib.rcParams "matplotlib.rcParams")
Default configuration settings; their defaults may be overridden using a `matplotlibrc` file.
[`use`](#matplotlib.use "matplotlib.use")
Setting the Matplotlib backend. This should be called before any figure is created, because it is not possible to switch between different GUI backends after that.
Matplotlib was initially written by John D. Hunter (1968-2012) and is now developed and maintained by a host of others.
Occasionally the internal documentation (python docstrings) will refer to MATLAB®, a registered trademark of The MathWorks, Inc.
Backend management
------------------
matplotlib.use(*backend*, *\**, *force=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1105-L1167)
Select the backend used for rendering and GUI integration.
Parameters:
**backend**str
The backend to switch to. This can either be one of the standard backend names, which are case-insensitive:
* interactive backends: GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, QtAgg, QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo
* non-interactive backends: agg, cairo, pdf, pgf, ps, svg, template
or a string of the form: `module://my.module.name`.
Switching to an interactive backend is not possible if an unrelated event loop has already been started (e.g., switching to GTK3Agg if a TkAgg window has already been opened). Switching to a non-interactive backend is always possible.
**force**bool, default: True
If True (the default), raise an [`ImportError`](https://docs.python.org/3/library/exceptions.html#ImportError "(in Python v3.10)") if the backend cannot be set up (either because it fails to import, or because an incompatible GUI interactive framework is already running); if False, silently ignore the failure.
See also
[Backends](https://matplotlib.org/stable/users/explain/backends.html#backends)
[`matplotlib.get_backend`](#matplotlib.get_backend "matplotlib.get_backend")
matplotlib.get\_backend()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1174-L1182)
Return the name of the current backend.
See also
[`matplotlib.use`](#matplotlib.use "matplotlib.use")
matplotlib.interactive(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1185-L1189)
Set whether to redraw after every plotting command (e.g. [`pyplot.xlabel`](_as_gen/matplotlib.pyplot.xlabel#matplotlib.pyplot.xlabel "matplotlib.pyplot.xlabel")).
matplotlib.is\_interactive()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1192-L1201)
Return whether to redraw after every plotting command.
Note
This function is only intended for use in backends. End users should use [`pyplot.isinteractive`](_as_gen/matplotlib.pyplot.isinteractive#matplotlib.pyplot.isinteractive "matplotlib.pyplot.isinteractive") instead.
Default values and styling
--------------------------
matplotlib.rcParams[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py)
An instance of [`RcParams`](#matplotlib.RcParams "matplotlib.RcParams") for handling default Matplotlib values.
*class*matplotlib.RcParams(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L603-L727)
A dictionary object including validation.
Validating functions are defined and associated with rc parameters in [`matplotlib.rcsetup`](rcsetup_api#module-matplotlib.rcsetup "matplotlib.rcsetup").
The list of rcParams is:
* \_internal.classic\_mode
* agg.path.chunksize
* animation.bitrate
* animation.codec
* animation.convert\_args
* animation.convert\_path
* animation.embed\_limit
* animation.ffmpeg\_args
* animation.ffmpeg\_path
* animation.frame\_format
* animation.html
* animation.writer
* axes.autolimit\_mode
* axes.axisbelow
* axes.edgecolor
* axes.facecolor
* axes.formatter.limits
* axes.formatter.min\_exponent
* axes.formatter.offset\_threshold
* axes.formatter.use\_locale
* axes.formatter.use\_mathtext
* axes.formatter.useoffset
* axes.grid
* axes.grid.axis
* axes.grid.which
* axes.labelcolor
* axes.labelpad
* axes.labelsize
* axes.labelweight
* axes.linewidth
* axes.prop\_cycle
* axes.spines.bottom
* axes.spines.left
* axes.spines.right
* axes.spines.top
* axes.titlecolor
* axes.titlelocation
* axes.titlepad
* axes.titlesize
* axes.titleweight
* axes.titley
* axes.unicode\_minus
* axes.xmargin
* axes.ymargin
* axes.zmargin
* axes3d.grid
* backend
* backend\_fallback
* boxplot.bootstrap
* boxplot.boxprops.color
* boxplot.boxprops.linestyle
* boxplot.boxprops.linewidth
* boxplot.capprops.color
* boxplot.capprops.linestyle
* boxplot.capprops.linewidth
* boxplot.flierprops.color
* boxplot.flierprops.linestyle
* boxplot.flierprops.linewidth
* boxplot.flierprops.marker
* boxplot.flierprops.markeredgecolor
* boxplot.flierprops.markeredgewidth
* boxplot.flierprops.markerfacecolor
* boxplot.flierprops.markersize
* boxplot.meanline
* boxplot.meanprops.color
* boxplot.meanprops.linestyle
* boxplot.meanprops.linewidth
* boxplot.meanprops.marker
* boxplot.meanprops.markeredgecolor
* boxplot.meanprops.markerfacecolor
* boxplot.meanprops.markersize
* boxplot.medianprops.color
* boxplot.medianprops.linestyle
* boxplot.medianprops.linewidth
* boxplot.notch
* boxplot.patchartist
* boxplot.showbox
* boxplot.showcaps
* boxplot.showfliers
* boxplot.showmeans
* boxplot.vertical
* boxplot.whiskerprops.color
* boxplot.whiskerprops.linestyle
* boxplot.whiskerprops.linewidth
* boxplot.whiskers
* contour.algorithm
* contour.corner\_mask
* contour.linewidth
* contour.negative\_linestyle
* date.autoformatter.day
* date.autoformatter.hour
* date.autoformatter.microsecond
* date.autoformatter.minute
* date.autoformatter.month
* date.autoformatter.second
* date.autoformatter.year
* date.converter
* date.epoch
* date.interval\_multiples
* docstring.hardcopy
* errorbar.capsize
* figure.autolayout
* figure.constrained\_layout.h\_pad
* figure.constrained\_layout.hspace
* figure.constrained\_layout.use
* figure.constrained\_layout.w\_pad
* figure.constrained\_layout.wspace
* figure.dpi
* figure.edgecolor
* figure.facecolor
* figure.figsize
* figure.frameon
* figure.labelsize
* figure.labelweight
* figure.max\_open\_warning
* figure.raise\_window
* figure.subplot.bottom
* figure.subplot.hspace
* figure.subplot.left
* figure.subplot.right
* figure.subplot.top
* figure.subplot.wspace
* figure.titlesize
* figure.titleweight
* font.cursive
* font.family
* font.fantasy
* font.monospace
* font.sans-serif
* font.serif
* font.size
* font.stretch
* font.style
* font.variant
* font.weight
* grid.alpha
* grid.color
* grid.linestyle
* grid.linewidth
* hatch.color
* hatch.linewidth
* hist.bins
* image.aspect
* image.cmap
* image.composite\_image
* image.interpolation
* image.lut
* image.origin
* image.resample
* interactive
* keymap.back
* keymap.copy
* keymap.forward
* keymap.fullscreen
* keymap.grid
* keymap.grid\_minor
* keymap.help
* keymap.home
* keymap.pan
* keymap.quit
* keymap.quit\_all
* keymap.save
* keymap.xscale
* keymap.yscale
* keymap.zoom
* legend.borderaxespad
* legend.borderpad
* legend.columnspacing
* legend.edgecolor
* legend.facecolor
* legend.fancybox
* legend.fontsize
* legend.framealpha
* legend.frameon
* legend.handleheight
* legend.handlelength
* legend.handletextpad
* legend.labelcolor
* legend.labelspacing
* legend.loc
* legend.markerscale
* legend.numpoints
* legend.scatterpoints
* legend.shadow
* legend.title\_fontsize
* lines.antialiased
* lines.color
* lines.dash\_capstyle
* lines.dash\_joinstyle
* lines.dashdot\_pattern
* lines.dashed\_pattern
* lines.dotted\_pattern
* lines.linestyle
* lines.linewidth
* lines.marker
* lines.markeredgecolor
* lines.markeredgewidth
* lines.markerfacecolor
* lines.markersize
* lines.scale\_dashes
* lines.solid\_capstyle
* lines.solid\_joinstyle
* markers.fillstyle
* mathtext.bf
* mathtext.cal
* mathtext.default
* mathtext.fallback
* mathtext.fontset
* mathtext.it
* mathtext.rm
* mathtext.sf
* mathtext.tt
* patch.antialiased
* patch.edgecolor
* patch.facecolor
* patch.force\_edgecolor
* patch.linewidth
* path.effects
* path.simplify
* path.simplify\_threshold
* path.sketch
* path.snap
* pcolor.shading
* pcolormesh.snap
* pdf.compression
* pdf.fonttype
* pdf.inheritcolor
* pdf.use14corefonts
* pgf.preamble
* pgf.rcfonts
* pgf.texsystem
* polaraxes.grid
* ps.distiller.res
* ps.fonttype
* ps.papersize
* ps.useafm
* ps.usedistiller
* savefig.bbox
* savefig.directory
* savefig.dpi
* savefig.edgecolor
* savefig.facecolor
* savefig.format
* savefig.orientation
* savefig.pad\_inches
* savefig.transparent
* scatter.edgecolors
* scatter.marker
* svg.fonttype
* svg.hashsalt
* svg.image\_inline
* text.antialiased
* text.color
* text.hinting
* text.hinting\_factor
* text.kerning\_factor
* text.latex.preamble
* text.parse\_math
* text.usetex
* timezone
* tk.window\_focus
* toolbar
* webagg.address
* webagg.open\_in\_browser
* webagg.port
* webagg.port\_retries
* xaxis.labellocation
* xtick.alignment
* xtick.bottom
* xtick.color
* xtick.direction
* xtick.labelbottom
* xtick.labelcolor
* xtick.labelsize
* xtick.labeltop
* xtick.major.bottom
* xtick.major.pad
* xtick.major.size
* xtick.major.top
* xtick.major.width
* xtick.minor.bottom
* xtick.minor.pad
* xtick.minor.size
* xtick.minor.top
* xtick.minor.visible
* xtick.minor.width
* xtick.top
* yaxis.labellocation
* ytick.alignment
* ytick.color
* ytick.direction
* ytick.labelcolor
* ytick.labelleft
* ytick.labelright
* ytick.labelsize
* ytick.left
* ytick.major.left
* ytick.major.pad
* ytick.major.right
* ytick.major.size
* ytick.major.width
* ytick.minor.left
* ytick.minor.pad
* ytick.minor.right
* ytick.minor.size
* ytick.minor.visible
* ytick.minor.width
* ytick.right
See also
[The matplotlibrc file](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files)
find\_all(*pattern*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L706-L720)
Return the subset of this RcParams dictionary whose keys match, using [`re.search()`](https://docs.python.org/3/library/re.html#re.search "(in Python v3.10)"), the given `pattern`.
Note
Changes to the returned dictionary are *not* propagated to the parent RcParams dictionary.
copy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L722-L727)
Copy this RcParams instance.
matplotlib.rc\_context(*rc=None*, *fname=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1058-L1102)
Return a context manager for temporarily changing rcParams.
The `[rcParams["backend"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=backend#matplotlibrc-sample)` will not be reset by the context manager.
Parameters:
**rc**dict
The rcParams to temporarily set.
**fname**str or path-like
A file with Matplotlib rc settings. If both *fname* and *rc* are given, settings from *rc* take precedence.
See also
[The matplotlibrc file](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files)
#### Examples
Passing explicit values via a dict:
```
with mpl.rc_context({'interactive': False}):
fig, ax = plt.subplots()
ax.plot(range(3), range(3))
fig.savefig('example.png')
plt.close(fig)
```
Loading settings from a file:
```
with mpl.rc_context(fname='print.rc'):
plt.plot(x, y) # uses 'print.rc'
```
matplotlib.rc(*group*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L915-L988)
Set the current [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams"). *group* is the grouping for the rc, e.g., for `lines.linewidth` the group is `lines`, for `axes.facecolor`, the group is `axes`, and so on. Group may also be a list or tuple of group names, e.g., (*xtick*, *ytick*). *kwargs* is a dictionary attribute name/value pairs, e.g.,:
```
rc('lines', linewidth=2, color='r')
```
sets the current [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") and is equivalent to:
```
rcParams['lines.linewidth'] = 2
rcParams['lines.color'] = 'r'
```
The following aliases are available to save typing for interactive users:
| Alias | Property |
| --- | --- |
| 'lw' | 'linewidth' |
| 'ls' | 'linestyle' |
| 'c' | 'color' |
| 'fc' | 'facecolor' |
| 'ec' | 'edgecolor' |
| 'mew' | 'markeredgewidth' |
| 'aa' | 'antialiased' |
Thus you could abbreviate the above call as:
```
rc('lines', lw=2, c='r')
```
Note you can use python's kwargs dictionary facility to store dictionaries of default parameters. e.g., you can customize the font rc as follows:
```
font = {'family' : 'monospace',
'weight' : 'bold',
'size' : 'larger'}
rc('font', **font) # pass in the font dict as kwargs
```
This enables you to easily switch between several configurations. Use `matplotlib.style.use('default')` or [`rcdefaults()`](#matplotlib.rcdefaults "matplotlib.rcdefaults") to restore the default [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") after changes.
#### Notes
Similar functionality is available by using the normal dict interface, i.e. `rcParams.update({"lines.linewidth": 2, ...})` (but `rcParams.update` does not support abbreviations or grouping).
matplotlib.rcdefaults()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L991-L1013)
Restore the [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") from Matplotlib's internal default style.
Style-blacklisted [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") (defined in `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
See also
[`matplotlib.rc_file_defaults`](#matplotlib.rc_file_defaults "matplotlib.rc_file_defaults")
Restore the [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") from the rc file originally loaded by Matplotlib.
[`matplotlib.style.use`](style_api#matplotlib.style.use "matplotlib.style.use")
Use a specific style file. Call `style.use('default')` to restore the default style.
matplotlib.rc\_file\_defaults()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1016-L1028)
Restore the [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") from the original rc file loaded by Matplotlib.
Style-blacklisted [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") (defined in `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
matplotlib.rc\_file(*fname*, *\**, *use\_default\_template=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1031-L1055)
Update [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") from file.
Style-blacklisted [`rcParams`](#matplotlib.rcParams "matplotlib.rcParams") (defined in `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
Parameters:
**fname**str or path-like
A file with Matplotlib rc settings.
**use\_default\_template**bool
If True, initialize with default parameters before updating with those in the given file. If False, the current configuration persists and only the parameters specified in the file are updated.
matplotlib.rc\_params(*fail\_on\_error=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L730-L732)
Construct a [`RcParams`](#matplotlib.RcParams "matplotlib.RcParams") instance from the default Matplotlib rc file.
matplotlib.rc\_params\_from\_file(*fname*, *fail\_on\_error=False*, *use\_default\_template=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L847-L880)
Construct a [`RcParams`](#matplotlib.RcParams "matplotlib.RcParams") from file *fname*.
Parameters:
**fname**str or path-like
A file with Matplotlib rc settings.
**fail\_on\_error**bool
If True, raise an error when the parser fails to convert a parameter.
**use\_default\_template**bool
If True, initialize with default parameters before updating with those in the given file. If False, the configuration class only contains the parameters specified in the file. (Useful for updating dicts.)
matplotlib.get\_configdir()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L510-L526)
Return the string path of the configuration directory.
The directory is chosen as follows:
1. If the MPLCONFIGDIR environment variable is supplied, choose that.
2. On Linux, follow the XDG specification and look first in `$XDG_CONFIG_HOME`, if defined, or `$HOME/.config`. On other platforms, choose `$HOME/.matplotlib`.
3. If the chosen directory exists and is writable, use that as the configuration directory.
4. Else, create a temporary directory, and use it as the configuration directory.
matplotlib.matplotlib\_fname()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L546-L588)
Get the location of the config file.
The file location is determined in the following order
* `$PWD/matplotlibrc`
* `$MATPLOTLIBRC` if it is not a directory
* `$MATPLOTLIBRC/matplotlibrc`
* `$MPLCONFIGDIR/matplotlibrc`
* On Linux,
+ `$XDG_CONFIG_HOME/matplotlib/matplotlibrc` (if `$XDG_CONFIG_HOME` is defined)
+ or `$HOME/.config/matplotlib/matplotlibrc` (if `$XDG_CONFIG_HOME` is not defined)
* On other platforms, - `$HOME/.matplotlib/matplotlibrc` if `$HOME` is defined
* Lastly, it looks in `$MATPLOTLIBDATA/matplotlibrc`, which should always exist.
matplotlib.get\_data\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L540-L543)
Return the path to Matplotlib data.
Logging
-------
matplotlib.set\_loglevel(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L233-L253)
Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet.
Typically, one should call `set_loglevel("info")` or `set_loglevel("debug")` to get additional debugging information.
Parameters:
**level**{"notset", "debug", "info", "warning", "error", "critical"}
The log level of the handler.
#### Notes
The first time this function is called, an additional handler is attached to Matplotlib's root handler; this handler is reused every time and this function simply manipulates the logger and handler's level.
Colormaps and color sequences
-----------------------------
matplotlib.colormaps[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py)
Container for colormaps that are known to Matplotlib by name.
Experimental
While we expect the API to be final, we formally mark it as experimental for 3.5 because we want to keep the option to still adapt the API for 3.6 should the need arise.
The universal registry instance is [`matplotlib.colormaps`](#matplotlib.colormaps "matplotlib.colormaps"). There should be no need for users to instantiate [`ColormapRegistry`](cm_api#matplotlib.cm.ColormapRegistry "matplotlib.cm.ColormapRegistry") themselves.
Read access uses a dict-like interface mapping names to [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s:
```
import matplotlib as mpl
cmap = mpl.colormaps['viridis']
```
Returned [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s are copies, so that their modification does not change the global definition of the colormap.
Additional colormaps can be added via [`ColormapRegistry.register`](cm_api#matplotlib.cm.ColormapRegistry.register "matplotlib.cm.ColormapRegistry.register"):
```
mpl.colormaps.register(my_colormap)
```
matplotlib.color\_sequences[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py)
Container for sequences of colors that are known to Matplotlib by name.
The universal registry instance is [`matplotlib.color_sequences`](#matplotlib.color_sequences "matplotlib.color_sequences"). There should be no need for users to instantiate [`ColorSequenceRegistry`](_as_gen/matplotlib.colors.colorsequenceregistry#matplotlib.colors.ColorSequenceRegistry "matplotlib.colors.ColorSequenceRegistry") themselves.
Read access uses a dict-like interface mapping names to lists of colors:
```
import matplotlib as mpl
cmap = mpl.color_sequences['tab10']
```
The returned lists are copies, so that their modification does not change the global definition of the color sequence.
Additional color sequences can be added via [`ColorSequenceRegistry.register`](_as_gen/matplotlib.colors.colorsequenceregistry#matplotlib.colors.ColorSequenceRegistry.register "matplotlib.colors.ColorSequenceRegistry.register"):
```
mpl.color_sequences.register('rgb', ['r', 'g', 'b'])
```
Miscellaneous
-------------
*class*matplotlib.MatplotlibDeprecationWarning[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py#L20-L21)
A class for issuing deprecation warnings for Matplotlib users.
matplotlib.get\_cachedir()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L529-L537)
Return the string path of the cache directory.
The procedure used to find the directory is the same as for \_get\_config\_dir, except using `$XDG_CACHE_HOME`/`$HOME/.cache` instead.
| programming_docs |
matplotlib matplotlib.pyplot.yticks matplotlib.pyplot.yticks
========================
matplotlib.pyplot.yticks(*ticks=None*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1817-L1877)
Get or set the current tick locations and labels of the y-axis.
Pass no arguments to return the current values without modifying them.
Parameters:
**ticks**array-like, optional
The list of ytick locations. Passing an empty list removes all yticks.
**labels**array-like, optional
The labels to place at the given *ticks* locations. This argument can only be passed if *ticks* is passed as well.
**minor**bool, default: False
If `False`, get/set the major ticks/labels; if `True`, the minor ticks/labels.
**\*\*kwargs**
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties can be used to control the appearance of the labels.
Returns:
locs
The list of ytick locations.
labels
The list of ylabel [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") objects.
#### Notes
Calling this function with no arguments (e.g. `yticks()`) is the pyplot equivalent of calling [`get_yticks`](matplotlib.axes.axes.get_yticks#matplotlib.axes.Axes.get_yticks "matplotlib.axes.Axes.get_yticks") and [`get_yticklabels`](matplotlib.axes.axes.get_yticklabels#matplotlib.axes.Axes.get_yticklabels "matplotlib.axes.Axes.get_yticklabels") on the current axes. Calling this function with arguments is the pyplot equivalent of calling [`set_yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") and [`set_yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") on the current axes.
#### Examples
```
>>> locs, labels = yticks() # Get the current locations and labels.
>>> yticks(np.arange(0, 1, step=0.2)) # Set label locations.
>>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
>>> yticks([0, 1, 2], ['January', 'February', 'March'],
... rotation=45) # Set text labels and properties.
>>> yticks([]) # Disable yticks.
```
Examples using `matplotlib.pyplot.yticks`
-----------------------------------------
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
matplotlib mpl_toolkits.axisartist.axes_grid.Grid mpl\_toolkits.axisartist.axes\_grid.Grid
========================================
*class*mpl\_toolkits.axisartist.axes\_grid.Grid(*fig*, *rect*, *nrows\_ncols*, *ngrids=None*, *direction='row'*, *axes\_pad=0.02*, *\**, *share\_all=False*, *share\_x=True*, *share\_y=True*, *label\_mode='L'*, *axes\_class=None*, *aspect=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axes_grid.py#L11-L12)
Bases: [`Grid`](mpl_toolkits.axes_grid1.axes_grid.grid#mpl_toolkits.axes_grid1.axes_grid.Grid "mpl_toolkits.axes_grid1.axes_grid.Grid")
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The parent figure.
**rect**(float, float, float, float) or int
The axes position, as a `(left, bottom, width, height)` tuple or as a three-digit subplot position code (e.g., "121").
**nrows\_ncols**(int, int)
Number of rows and columns in the grid.
**ngrids**int or None, default: None
If not None, only the first *ngrids* axes in the grid are created.
**direction**{"row", "column"}, default: "row"
Whether axes are created in row-major ("row by row") or column-major order ("column by column"). This also affects the order in which axes are accessed using indexing (`grid[index]`).
**axes\_pad**float or (float, float), default: 0.02
Padding or (horizontal padding, vertical padding) between axes, in inches.
**share\_all**bool, default: False
Whether all axes share their x- and y-axis. Overrides *share\_x* and *share\_y*.
**share\_x**bool, default: True
Whether all axes of a column share their x-axis.
**share\_y**bool, default: True
Whether all axes of a row share their y-axis.
**label\_mode**{"L", "1", "all"}, default: "L"
Determines which axes will get tick labels:
* "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels.
* "1": Only the bottom left axes is labelled.
* "all": all axes are labelled.
**axes\_class**subclass of [`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), default: None
**aspect**bool, default: False
Whether the axes aspect ratio follows the aspect ratio of the data limits.
matplotlib mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredSizeBar
===========================================================
*class*mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredSizeBar(*transform*, *size*, *label*, *loc*, *pad=0.1*, *borderpad=0.1*, *sep=2*, *frameon=True*, *size\_vertical=0*, *color='black'*, *label\_top=False*, *fontproperties=None*, *fill\_bar=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/anchored_artists.py#L174-L288)
Bases: [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox")
Draw a horizontal scale bar with a center-aligned label underneath.
Parameters:
**transform**[`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transformation object for the coordinate system in use, i.e., `matplotlib.axes.Axes.transData`.
**size**float
Horizontal length of the size bar, given in coordinates of *transform*.
**label**str
Label to display.
**loc**str
Location of the size bar. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.1
Padding around the label and size bar, in fraction of the font size.
**borderpad**float, default: 0.1
Border padding, in fraction of the font size.
**sep**float, default: 2
Separation between the label and the size bar, in points.
**frameon**bool, default: True
If True, draw a box around the horizontal bar and label.
**size\_vertical**float, default: 0
Vertical length of the size bar, given in coordinates of *transform*.
**color**str, default: 'black'
Color for the size bar and label.
**label\_top**bool, default: False
If True, the label will be over the size bar.
**fontproperties**[`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
Font properties for the label text.
**fill\_bar**bool, optional
If True and if *size\_vertical* is nonzero, the size bar will be filled in with the color specified by the size bar. Defaults to True if *size\_vertical* is greater than zero and False otherwise.
**\*\*kwargs**
Keyword arguments forwarded to [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
#### Notes
If *prop* is passed as a keyword argument, but *fontproperties* is not, then *prop* is be assumed to be the intended *fontproperties*. Using both *prop* and *fontproperties* is not supported.
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> from mpl_toolkits.axes_grid1.anchored_artists import (
... AnchoredSizeBar)
>>> fig, ax = plt.subplots()
>>> ax.imshow(np.random.random((10, 10)))
>>> bar = AnchoredSizeBar(ax.transData, 3, '3 data units', 4)
>>> ax.add_artist(bar)
>>> fig.show()
```
Using all the optional parameters
```
>>> import matplotlib.font_manager as fm
>>> fontprops = fm.FontProperties(size=14, family='monospace')
>>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5,
... sep=5, borderpad=0.5, frameon=False,
... size_vertical=0.5, color='white',
... fontproperties=fontprops)
```
Attributes:
**size\_bar**[`matplotlib.offsetbox.AuxTransformBox`](../offsetbox_api#matplotlib.offsetbox.AuxTransformBox "matplotlib.offsetbox.AuxTransformBox")
Container for the size bar.
**txt\_label**[`matplotlib.offsetbox.TextArea`](../offsetbox_api#matplotlib.offsetbox.TextArea "matplotlib.offsetbox.TextArea")
Container for the label of the size bar.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar`
-------------------------------------------------------------------------
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Simple Anchored Artists](https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-gallery-axes-grid1-simple-anchored-artists-py)
Simple Anchored Artists
matplotlib mpl_toolkits.mplot3d.art3d.Line3D mpl\_toolkits.mplot3d.art3d.Line3D
==================================
*class*mpl\_toolkits.mplot3d.art3d.Line3D(*xs*, *ys*, *zs*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L159-L219)
Bases: [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
3D line object.
Keyword arguments are passed onto [`Line2D()`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D").
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L213-L219)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_data\_3d()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L202-L211)
Get the current data
Returns:
**verts3d**length-3 tuple or array-like
The current data as a tuple or array-like.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *dash\_capstyle=<UNSET>*, *dash\_joinstyle=<UNSET>*, *dashes=<UNSET>*, *data=<UNSET>*, *data\_3d=<UNSET>*, *drawstyle=<UNSET>*, *fillstyle=<UNSET>*, *gapcolor=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *marker=<UNSET>*, *markeredgecolor=<UNSET>*, *markeredgewidth=<UNSET>*, *markerfacecolor=<UNSET>*, *markerfacecoloralt=<UNSET>*, *markersize=<UNSET>*, *markevery=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *solid\_capstyle=<UNSET>*, *solid\_joinstyle=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xdata=<UNSET>*, *ydata=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`3d_properties`](#mpl_toolkits.mplot3d.art3d.Line3D.set_3d_properties "mpl_toolkits.mplot3d.art3d.Line3D.set_3d_properties") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`data_3d`](#mpl_toolkits.mplot3d.art3d.Line3D.set_data_3d "mpl_toolkits.mplot3d.art3d.Line3D.set_data_3d") | unknown |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_3d\_properties(*zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L171-L177)
set\_data\_3d(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L179-L200)
Set the x, y and z data
Parameters:
**x**array-like
The x-data to be plotted.
**y**array-like
The y-data to be plotted.
**z**array-like
The z-data to be plotted.
#### Notes
Accepts x, y, z arguments or a single array-like (x, y, z)
Examples using `mpl_toolkits.mplot3d.art3d.Line3D`
--------------------------------------------------
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
| programming_docs |
matplotlib matplotlib.animation.TimedAnimation matplotlib.animation.TimedAnimation
===================================
*class*matplotlib.animation.TimedAnimation(*fig*, *interval=200*, *repeat\_delay=0*, *repeat=True*, *event\_source=None*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1357-L1424)
[`Animation`](matplotlib.animation.animation#matplotlib.animation.Animation "matplotlib.animation.Animation") subclass for time-based animation.
A new frame is drawn every *interval* milliseconds.
Note
You must store the created Animation in a variable that lives as long as the animation should run. Otherwise, the Animation object will be garbage-collected and the animation stops.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object used to get needed events, such as draw or resize.
**interval**int, default: 200
Delay between frames in milliseconds.
**repeat\_delay**int, default: 0
The delay in milliseconds between consecutive animation runs, if *repeat* is True.
**repeat**bool, default: True
Whether the animation repeats when the sequence of frames is completed.
**blit**bool, default: False
Whether blitting is used to optimize drawing.
\_\_init\_\_(*fig*, *interval=200*, *repeat\_delay=0*, *repeat=True*, *event\_source=None*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1384-L1394)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.TimedAnimation.__init__ "matplotlib.animation.TimedAnimation.__init__")(fig[, interval, repeat\_delay, ...]) | |
| `new_frame_seq`() | Return a new sequence of frame information. |
| `new_saved_frame_seq`() | Return a new sequence of saved/cached frame information. |
| `pause`() | Pause the animation. |
| `resume`() | Resume the animation. |
| `save`(filename[, writer, fps, dpi, codec, ...]) | Save the animation as a movie file by drawing every frame. |
| `to_html5_video`([embed\_limit]) | Convert the animation to an HTML5 `<video>` tag. |
| `to_jshtml`([fps, embed\_frames, default\_mode]) | Generate HTML representation of the animation. |
matplotlib mpl_toolkits.axes_grid1.axes_size.Padded mpl\_toolkits.axes\_grid1.axes\_size.Padded
===========================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.Padded(*size*, *pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L207-L222)
Bases: `_Base`
[*Deprecated*] Return a instance where the absolute part of *size* is increase by the amount of *pad*.
#### Notes
Deprecated since version 3.6: Use size + pad instead.
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L218-L222)
matplotlib matplotlib.pyplot.hist matplotlib.pyplot.hist
======================
matplotlib.pyplot.hist(*x*, *bins=None*, *range=None*, *density=False*, *weights=None*, *cumulative=False*, *bottom=None*, *histtype='bar'*, *align='mid'*, *orientation='vertical'*, *rwidth=None*, *log=False*, *color=None*, *label=None*, *stacked=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2555-L2566)
Compute and plot a histogram.
This method uses [`numpy.histogram`](https://numpy.org/doc/stable/reference/generated/numpy.histogram.html#numpy.histogram "(in NumPy v1.23)") to bin the data in *x* and count the number of values in each bin, then draws the distribution either as a [`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer") or [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon"). The *bins*, *range*, *density*, and *weights* parameters are forwarded to [`numpy.histogram`](https://numpy.org/doc/stable/reference/generated/numpy.histogram.html#numpy.histogram "(in NumPy v1.23)").
If the data has already been binned and counted, use [`bar`](matplotlib.pyplot.bar#matplotlib.pyplot.bar "matplotlib.pyplot.bar") or [`stairs`](matplotlib.pyplot.stairs#matplotlib.pyplot.stairs "matplotlib.pyplot.stairs") to plot the distribution:
```
counts, bins = np.histogram(x)
plt.stairs(bins, counts)
```
Alternatively, plot pre-computed bins and counts using `hist()` by treating each bin as a single point with a weight equal to its count:
```
plt.hist(bins[:-1], bins, weights=counts)
```
The data input *x* can be a singular array, a list of datasets of potentially different lengths ([*x0*, *x1*, ...]), or a 2D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form. If the input is an array, then the return value is a tuple (*n*, *bins*, *patches*); if the input is a sequence of arrays, then the return value is a tuple ([*n0*, *n1*, ...], *bins*, [*patches0*, *patches1*, ...]).
Masked arrays are not supported.
Parameters:
**x**(n,) array or sequence of (n,) arrays
Input values, this takes either a single array or a sequence of arrays which are not required to be of the same length.
**bins**int or sequence or str, default: `[rcParams["hist.bins"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=hist.bins#matplotlibrc-sample)` (default: `10`)
If *bins* is an integer, it defines the number of equal-width bins in the range.
If *bins* is a sequence, it defines the bin edges, including the left edge of the first bin and the right edge of the last bin; in this case, bins may be unequally spaced. All but the last (righthand-most) bin is half-open. In other words, if *bins* is:
```
[1, 2, 3, 4]
```
then the first bin is `[1, 2)` (including 1, but excluding 2) and the second `[2, 3)`. The last bin, however, is `[3, 4]`, which *includes* 4.
If *bins* is a string, it is one of the binning strategies supported by [`numpy.histogram_bin_edges`](https://numpy.org/doc/stable/reference/generated/numpy.histogram_bin_edges.html#numpy.histogram_bin_edges "(in NumPy v1.23)"): 'auto', 'fd', 'doane', 'scott', 'stone', 'rice', 'sturges', or 'sqrt'.
**range**tuple or None, default: None
The lower and upper range of the bins. Lower and upper outliers are ignored. If not provided, *range* is `(x.min(), x.max())`. Range has no effect if *bins* is a sequence.
If *bins* is a sequence or *range* is specified, autoscaling is based on the specified bin range instead of the range of x.
**density**bool, default: False
If `True`, draw and return a probability density: each bin will display the bin's raw count divided by the total number of counts *and the bin width* (`density = counts / (sum(counts) * np.diff(bins))`), so that the area under the histogram integrates to 1 (`np.sum(density * np.diff(bins)) == 1`).
If *stacked* is also `True`, the sum of the histograms is normalized to 1.
**weights**(n,) array-like or None, default: None
An array of weights, of the same shape as *x*. Each value in *x* only contributes its associated weight towards the bin count (instead of 1). If *density* is `True`, the weights are normalized, so that the integral of the density over the range remains 1.
**cumulative**bool or -1, default: False
If `True`, then a histogram is computed where each bin gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints.
If *density* is also `True` then the histogram is normalized such that the last bin equals 1.
If *cumulative* is a number less than 0 (e.g., -1), the direction of accumulation is reversed. In this case, if *density* is also `True`, then the histogram is normalized such that the first bin equals 1.
**bottom**array-like, scalar, or None, default: None
Location of the bottom of each bin, ie. bins are drawn from `bottom` to `bottom + hist(x, bins)` If a scalar, the bottom of each bin is shifted by the same amount. If an array, each bin is shifted independently and the length of bottom must match the number of bins. If None, defaults to 0.
**histtype**{'bar', 'barstacked', 'step', 'stepfilled'}, default: 'bar'
The type of histogram to draw.
* 'bar' is a traditional bar-type histogram. If multiple data are given the bars are arranged side by side.
* 'barstacked' is a bar-type histogram where multiple data are stacked on top of each other.
* 'step' generates a lineplot that is by default unfilled.
* 'stepfilled' generates a lineplot that is by default filled.
**align**{'left', 'mid', 'right'}, default: 'mid'
The horizontal alignment of the histogram bars.
* 'left': bars are centered on the left bin edges.
* 'mid': bars are centered between the bin edges.
* 'right': bars are centered on the right bin edges.
**orientation**{'vertical', 'horizontal'}, default: 'vertical'
If 'horizontal', [`barh`](matplotlib.axes.axes.barh#matplotlib.axes.Axes.barh "matplotlib.axes.Axes.barh") will be used for bar-type histograms and the *bottom* kwarg will be the left edges.
**rwidth**float or None, default: None
The relative width of the bars as a fraction of the bin width. If `None`, automatically compute the width.
Ignored if *histtype* is 'step' or 'stepfilled'.
**log**bool, default: False
If `True`, the histogram axis will be set to a log scale.
**color**color or array-like of colors or None, default: None
Color or sequence of colors, one per dataset. Default (`None`) uses the standard line color sequence.
**label**str or None, default: None
String, or sequence of strings to match multiple datasets. Bar charts yield multiple patches per dataset, but only the first gets the label, so that [`legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") will work as expected.
**stacked**bool, default: False
If `True`, multiple data are stacked on top of each other If `False` multiple data are arranged side by side if histtype is 'bar' or on top of each other if histtype is 'step'
Returns:
**n**array or list of arrays
The values of the histogram bins. See *density* and *weights* for a description of the possible semantics. If input *x* is an array, then this is an array of length *nbins*. If input is a sequence of arrays `[data1, data2, ...]`, then this is a list of arrays with the values of the histograms for each of the arrays in the same order. The dtype of the array *n* (or of its element arrays) will always be float even if no weighting or normalization is used.
**bins**array
The edges of the bins. Length nbins + 1 (nbins left edges and right edge of last bin). Always a single array even when multiple data sets are passed in.
**patches**[`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer") or list of a single [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") or list of such objects
Container of individual artists used to create the histogram or list of such containers if there are multiple input datasets.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *weights*
**\*\*kwargs**
[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties
See also
[`hist2d`](matplotlib.pyplot.hist2d#matplotlib.pyplot.hist2d "matplotlib.pyplot.hist2d")
2D histogram with rectangular bins
[`hexbin`](matplotlib.pyplot.hexbin#matplotlib.pyplot.hexbin "matplotlib.pyplot.hexbin")
2D histogram with hexagonal bins
#### Notes
For large numbers of bins (>1000), plotting can be significantly faster if *histtype* is set to 'step' or 'stepfilled' rather than 'bar' or 'barstacked'.
Examples using `matplotlib.pyplot.hist`
---------------------------------------
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Animated histogram](https://matplotlib.org/stable/gallery/animation/animated_histogram.html#sphx-glr-gallery-animation-animated-histogram-py)
Animated histogram
[SVG Histogram](https://matplotlib.org/stable/gallery/user_interfaces/svg_histogram_sgskip.html#sphx-glr-gallery-user-interfaces-svg-histogram-sgskip-py)
SVG Histogram
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Image tutorial](https://matplotlib.org/stable/tutorials/introductory/images.html#sphx-glr-tutorials-introductory-images-py)
Image tutorial
matplotlib matplotlib.pyplot.axvspan matplotlib.pyplot.axvspan
=========================
matplotlib.pyplot.axvspan(*xmin*, *xmax*, *ymin=0*, *ymax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2345-L2347)
Add a vertical span (rectangle) across the Axes.
The rectangle spans from *xmin* to *xmax* horizontally, and, by default, the whole y-axis vertically. The y-span can be set using *ymin* (default: 0) and *ymax* (default: 1) which are in axis units; e.g. `ymin = 0.5` always refers to the middle of the y-axis regardless of the limits set by [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim").
Parameters:
**xmin**float
Lower x-coordinate of the span, in data units.
**xmax**float
Upper x-coordinate of the span, in data units.
**ymin**float, default: 0
Lower y-coordinate of the span, in y-axis units (0-1).
**ymax**float, default: 1
Upper y-coordinate of the span, in y-axis units (0-1).
Returns:
[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`axhspan`](matplotlib.pyplot.axhspan#matplotlib.pyplot.axhspan "matplotlib.pyplot.axhspan")
Add a horizontal span across the Axes.
#### Examples
Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the Axes.
```
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
```
matplotlib mpl_toolkits.axisartist.clip_path.clip mpl\_toolkits.axisartist.clip\_path.clip
========================================
mpl\_toolkits.axisartist.clip\_path.clip(*xlines*, *ylines*, *x0*, *clip='right'*, *xdir=True*, *ydir=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/clip_path.py#L20-L80)
| programming_docs |
matplotlib matplotlib.axes.Axes.grid matplotlib.axes.Axes.grid
=========================
Axes.grid(*visible=None*, *which='major'*, *axis='both'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3197-L3239)
Configure the grid lines.
Parameters:
**visible**bool or None, optional
Whether to show the grid lines. If any *kwargs* are supplied, it is assumed you want the grid on and *visible* will be set to True.
If *visible* is *None* and there are no *kwargs*, this toggles the visibility of the lines.
**which**{'major', 'minor', 'both'}, optional
The grid lines to apply the changes on.
**axis**{'both', 'x', 'y'}, optional
The axis to apply the changes on.
**\*\*kwargs**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties
Define the line properties of the grid, e.g.:
```
grid(color='r', linestyle='-', linewidth=2)
```
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
#### Notes
The axis is drawn as a unit, so the effective zorder for drawing the grid is determined by the zorder of each axis, not by the zorder of the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") objects comprising the grid. Therefore, to set grid zorder, use [`set_axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") or, for more control, call the [`set_zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") method of each axis.
Examples using `matplotlib.axes.Axes.grid`
------------------------------------------
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[CSD Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/csd_demo.html#sphx-glr-gallery-lines-bars-and-markers-csd-demo-py)
CSD Demo
[Fill Between and Alpha](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_alpha.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-alpha-py)
Fill Between and Alpha
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Scatter Demo2](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_demo2.html#sphx-glr-gallery-lines-bars-and-markers-scatter-demo2-py)
Scatter Demo2
[Scatter plots with a legend](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#sphx-glr-gallery-lines-bars-and-markers-scatter-with-legend-py)
Scatter plots with a legend
[Simple Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py)
Simple Plot
[Cross- and Auto-Correlation Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/xcorr_acorr_demo.html#sphx-glr-gallery-lines-bars-and-markers-xcorr-acorr-demo-py)
Cross- and Auto-Correlation Demo
[Contour Corner Mask](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_corner_mask.html#sphx-glr-gallery-images-contours-and-fields-contour-corner-mask-py)
Contour Corner Mask
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Watermark image](https://matplotlib.org/stable/gallery/images_contours_and_fields/watermark_image.html#sphx-glr-gallery-images-contours-and-fields-watermark-image-py)
Watermark image
[Axes Props](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_props.html#sphx-glr-gallery-subplots-axes-and-figures-axes-props-py)
Axes Props
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Invert Axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/invert_axes.html#sphx-glr-gallery-subplots-axes-and-figures-invert-axes-py)
Invert Axes
[Using histograms to plot a cumulative distribution](https://matplotlib.org/stable/gallery/statistics/histogram_cumulative.html#sphx-glr-gallery-statistics-histogram-cumulative-py)
Using histograms to plot a cumulative distribution
[Polar plot](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_demo.html#sphx-glr-gallery-pie-and-polar-charts-polar-demo-py)
Polar plot
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Multiline](https://matplotlib.org/stable/gallery/text_labels_and_annotations/multiline.html#sphx-glr-gallery-text-labels-and-annotations-multiline-py)
Multiline
[Text watermark](https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html#sphx-glr-gallery-text-labels-and-annotations-watermark-text-py)
Text watermark
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
 [The double pendulum problem](https://matplotlib.org/stable/gallery/animation/double_pendulum.html#sphx-glr-gallery-animation-double-pendulum-py)
The double pendulum problem
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Pythonic Matplotlib](https://matplotlib.org/stable/gallery/misc/pythonic_matplotlib.html#sphx-glr-gallery-misc-pythonic-matplotlib-py)
Pythonic Matplotlib
[2D and 3D Axes in same Figure](https://matplotlib.org/stable/gallery/mplot3d/mixed_subplots.html#sphx-glr-gallery-mplot3d-mixed-subplots-py)
2D and 3D \*Axes\* in same \*Figure\*
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[Log Axis](https://matplotlib.org/stable/gallery/scales/semilogx_demo.html#sphx-glr-gallery-scales-semilogx-demo-py)
Log Axis
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib matplotlib.pyplot.twinx matplotlib.pyplot.twinx
=======================
matplotlib.pyplot.twinx(*ax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1605-L1618)
Make and return a second axes that shares the *x*-axis. The new axes will overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be on the right.
#### Examples
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html)
matplotlib matplotlib.artist.Artist.update matplotlib.artist.Artist.update
===============================
Artist.update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
matplotlib matplotlib.pyplot.specgram matplotlib.pyplot.specgram
==========================
matplotlib.pyplot.specgram(*x*, *NFFT=None*, *Fs=None*, *Fc=None*, *detrend=None*, *window=None*, *noverlap=None*, *cmap=None*, *xextent=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*, *mode=None*, *scale=None*, *vmin=None*, *vmax=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2800-L2813)
Plot a spectrogram.
Compute and plot a spectrogram of data in *x*. Data are split into *NFFT* length segments and the spectrum of each section is computed. The windowing function *window* is applied to each segment, and the amount of overlap of each segment is specified with *noverlap*. The spectrogram is plotted as a colormap (using imshow).
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](../mlab_api#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**mode**{'default', 'psd', 'magnitude', 'angle', 'phase'}
What sort of spectrum to use. Default is 'psd', which takes the power spectral density. 'magnitude' returns the magnitude spectrum. 'angle' returns the phase spectrum without unwrapping. 'phase' returns the phase spectrum with unwrapping.
**noverlap**int, default: 128
The number of points of overlap between blocks.
**scale**{'default', 'linear', 'dB'}
The scaling of the values in the *spec*. 'linear' is no scaling. 'dB' returns the values in dB scale. When *mode* is 'psd', this is dB power (10 \* log10). Otherwise this is dB amplitude (20 \* log10). 'default' is 'dB' if *mode* is 'psd' or 'magnitude' and 'linear' otherwise. This must be 'linear' if *mode* is 'angle' or 'phase'.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
**cmap**[`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
**xextent***None* or (xmin, xmax)
The image extent along the x-axis. The default sets *xmin* to the left border of the first bin (*spectrum* column) and *xmax* to the right border of the last bin. Note that for *noverlap>0* the width of the bins is smaller than those of the segments.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Additional keyword arguments are passed on to [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") which makes the specgram image. The origin keyword argument is not supported.
Returns:
**spectrum**2D array
Columns are the periodograms of successive segments.
**freqs**1-D array
The frequencies corresponding to the rows in *spectrum*.
**t**1-D array
The times corresponding to midpoints of segments (i.e., the columns in *spectrum*).
**im**[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
The image created by imshow containing the spectrogram.
See also
[`psd`](matplotlib.pyplot.psd#matplotlib.pyplot.psd "matplotlib.pyplot.psd")
Differs in the default overlap; in returning the mean of the segment periodograms; in not returning times; and in generating a line plot instead of colormap.
[`magnitude_spectrum`](matplotlib.pyplot.magnitude_spectrum#matplotlib.pyplot.magnitude_spectrum "matplotlib.pyplot.magnitude_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'magnitude'. Plots a line instead of a colormap.
[`angle_spectrum`](matplotlib.pyplot.angle_spectrum#matplotlib.pyplot.angle_spectrum "matplotlib.pyplot.angle_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'angle'. Plots a line instead of a colormap.
[`phase_spectrum`](matplotlib.pyplot.phase_spectrum#matplotlib.pyplot.phase_spectrum "matplotlib.pyplot.phase_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'phase'. Plots a line instead of a colormap.
#### Notes
The parameters *detrend* and *scale\_by\_freq* do only apply when *mode* is set to 'psd'.
| programming_docs |
matplotlib matplotlib.pyplot.contourf matplotlib.pyplot.contourf
==========================
matplotlib.pyplot.contourf(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2451-L2457)
Plot filled contours.
Call signature:
```
contourf([X, Y,] Z, [levels], **kwargs)
```
[`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour") and [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf") draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions.
Parameters:
**X, Y**array-like, optional
The coordinates of the values in *Z*.
*X* and *Y* must both be 2D with the same shape as *Z* (e.g. created via [`numpy.meshgrid`](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html#numpy.meshgrid "(in NumPy v1.23)")), or they must both be 1-D such that `len(X) == N` is the number of columns in *Z* and `len(Y) == M` is the number of rows in *Z*.
*X* and *Y* must both be ordered monotonically.
If not given, they are assumed to be integer indices, i.e. `X = range(N)`, `Y = range(M)`.
**Z**(M, N) array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet")
Other Parameters:
**corner\_mask**bool, default: `[rcParams["contour.corner\_mask"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.corner_mask#matplotlibrc-sample)` (default: `True`)
Enable/disable corner masking, which only has an effect if *Z* is a masked array. If `False`, any quad touching a masked point is masked out. If `True`, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual.
**colors**color string or sequence of colors, optional
The colors of the levels, i.e. the lines for [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour") and the areas for [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf").
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it's repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `contourf`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call `QuadContourSet.changed()` is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet") because it internally calls `QuadContourSet.changed()`.
Example:
```
x = np.arange(1, 10)
y = x.reshape(-1, 1)
h = x * y
cs = plt.contourf(h, levels=[10, 30, 50],
colors=['#808080', '#A0A0A0', '#C0C0C0'], extend='both')
cs.cmap.set_over('red')
cs.cmap.set_under('blue')
cs.changed()
```
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**nchunk**int >= 0, optional
If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of *nchunk* by *nchunk* quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the *antialiased* flag and value of *alpha*.
**linewidths**float or array-like, default: `[rcParams["contour.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.linewidth#matplotlibrc-sample)` (default: `None`)
*Only applies to* [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour").
The line width of the contour lines.
If a number, all levels will be plotted with this linewidth.
If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified.
If None, this falls back to `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`).
**linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
*Only applies to* [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour").
If *linestyles* is *None*, the default is 'solid' unless the lines are monochrome. In that case, negative contours will instead take their linestyle from the *negative\_linestyles* argument.
*linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
**negative\_linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
*Only applies to* [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour").
If *linestyles* is *None* and the lines are monochrome, this argument specifies the line style for negative contours.
If *negative\_linestyles* is *None*, the default is taken from `[rcParams["contour.negative\_linestyles"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.negative_linestyles#matplotlibrc-sample)`.
*negative\_linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
**hatches**list[str], optional
*Only applies to* [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf").
A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
**algorithm**{'mpl2005', 'mpl2014', 'serial', 'threaded'}, optional
Which contouring algorithm to use to calculate the contour lines and polygons. The algorithms are implemented in [ContourPy](https://github.com/contourpy/contourpy), consult the [ContourPy documentation](https://contourpy.readthedocs.io) for further information.
The default is taken from `[rcParams["contour.algorithm"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.algorithm#matplotlibrc-sample)` (default: `'mpl2014'`).
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
#### Notes
1. [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf") differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour").
2. [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf") fills intervals that are closed at the top; that is, for boundaries *z1* and *z2*, the filled region is:
```
z1 < Z <= z2
```
except for the lowest interval, which is closed on both sides (i.e. it includes the lowest value).
3. [`contour`](matplotlib.pyplot.contour#matplotlib.pyplot.contour "matplotlib.pyplot.contour") and [`contourf`](#matplotlib.pyplot.contourf "matplotlib.pyplot.contourf") use a [marching squares](https://en.wikipedia.org/wiki/Marching_squares) algorithm to compute contour locations. More information can be found in [ContourPy documentation](https://contourpy.readthedocs.io).
matplotlib matplotlib.animation.FFMpegFileWriter matplotlib.animation.FFMpegFileWriter
=====================================
*class*matplotlib.animation.FFMpegFileWriter(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L569-L598)
File-based ffmpeg writer.
Frames are written to temporary files on disk and then stitched together at the end.
\_\_init\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L385-L387)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.FFMpegFileWriter.__init__ "matplotlib.animation.FFMpegFileWriter.__init__")(\*args, \*\*kwargs) | |
| `bin_path`() | Return the binary path to the commandline tool used by a specific subclass. |
| `finish`() | Finish any processing for writing the movie. |
| `grab_frame`(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| `isAvailable`() | Return whether a MovieWriter subclass is actually available. |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| `setup`(fig, outfile[, dpi, frame\_prefix]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| `frame_format` | Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
| `output_args` | |
| [`supported_formats`](#matplotlib.animation.FFMpegFileWriter.supported_formats "matplotlib.animation.FFMpegFileWriter.supported_formats") | |
supported\_formats*=['png', 'jpeg', 'tiff', 'raw', 'rgba']*
matplotlib matplotlib.pyplot.tick_params matplotlib.pyplot.tick\_params
==============================
matplotlib.pyplot.tick\_params(*axis='both'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2905-L2907)
Change the appearance of ticks, tick labels, and gridlines.
Tick properties that are not explicitly set using the keyword arguments remain unchanged unless *reset* is True.
Parameters:
**axis**{'x', 'y', 'both'}, default: 'both'
The axis to which the parameters are applied.
**which**{'major', 'minor', 'both'}, default: 'major'
The group of ticks to which the parameters are applied.
**reset**bool, default: False
Whether to reset the ticks to defaults before updating them.
Other Parameters:
**direction**{'in', 'out', 'inout'}
Puts ticks inside the Axes, outside the Axes, or both.
**length**float
Tick length in points.
**width**float
Tick width in points.
**color**color
Tick color.
**pad**float
Distance in points between tick and label.
**labelsize**float or str
Tick label font size in points or as a string (e.g., 'large').
**labelcolor**color
Tick label color.
**colors**color
Tick color and label color.
**zorder**float
Tick and label zorder.
**bottom, top, left, right**bool
Whether to draw the respective ticks.
**labelbottom, labeltop, labelleft, labelright**bool
Whether to draw the respective tick labels.
**labelrotation**float
Tick label rotation
**grid\_color**color
Gridline color.
**grid\_alpha**float
Transparency of gridlines: 0 (transparent) to 1 (opaque).
**grid\_linewidth**float
Width of gridlines in points.
**grid\_linestyle**str
Any valid [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") line style spec.
#### Examples
```
ax.tick_params(direction='out', length=6, width=2, colors='r',
grid_color='r', grid_alpha=0.5)
```
This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent.
Examples using `matplotlib.pyplot.tick_params`
----------------------------------------------
[Shared Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/shared_axis_demo.html#sphx-glr-gallery-subplots-axes-and-figures-shared-axis-demo-py)
Shared Axis
matplotlib matplotlib.axes.Axes.xaxis_inverted matplotlib.axes.Axes.xaxis\_inverted
====================================
Axes.xaxis\_inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return whether the xaxis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.
matplotlib mpl_toolkits.axes_grid1.inset_locator mpl\_toolkits.axes\_grid1.inset\_locator
========================================
A collection of functions and objects for creating or placing inset axes.
Classes
-------
| | |
| --- | --- |
| [`AnchoredLocatorBase`](mpl_toolkits.axes_grid1.inset_locator.anchoredlocatorbase#mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase "mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase")(bbox\_to\_anchor, ...[, ...]) | Parameters:
|
| [`AnchoredSizeLocator`](mpl_toolkits.axes_grid1.inset_locator.anchoredsizelocator#mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator "mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator")(bbox\_to\_anchor, x\_size, ...) | Parameters:
|
| [`AnchoredZoomLocator`](mpl_toolkits.axes_grid1.inset_locator.anchoredzoomlocator#mpl_toolkits.axes_grid1.inset_locator.AnchoredZoomLocator "mpl_toolkits.axes_grid1.inset_locator.AnchoredZoomLocator")(parent\_axes, zoom, loc) | Parameters:
|
| [`BboxConnector`](mpl_toolkits.axes_grid1.inset_locator.bboxconnector#mpl_toolkits.axes_grid1.inset_locator.BboxConnector "mpl_toolkits.axes_grid1.inset_locator.BboxConnector")(bbox1, bbox2, loc1[, loc2]) | Connect two bboxes with a straight line. |
| [`BboxConnectorPatch`](mpl_toolkits.axes_grid1.inset_locator.bboxconnectorpatch#mpl_toolkits.axes_grid1.inset_locator.BboxConnectorPatch "mpl_toolkits.axes_grid1.inset_locator.BboxConnectorPatch")(bbox1, bbox2, loc1a, ...) | Connect two bboxes with a quadrilateral. |
| [`BboxPatch`](mpl_toolkits.axes_grid1.inset_locator.bboxpatch#mpl_toolkits.axes_grid1.inset_locator.BboxPatch "mpl_toolkits.axes_grid1.inset_locator.BboxPatch")(bbox, \*\*kwargs) | Patch showing the shape bounded by a Bbox. |
| [`InsetPosition`](mpl_toolkits.axes_grid1.inset_locator.insetposition#mpl_toolkits.axes_grid1.inset_locator.InsetPosition "mpl_toolkits.axes_grid1.inset_locator.InsetPosition")(parent, lbwh) | An object for positioning an inset axes. |
Functions
---------
| | |
| --- | --- |
| [`inset_axes`](mpl_toolkits.axes_grid1.inset_locator.inset_axes#mpl_toolkits.axes_grid1.inset_locator.inset_axes "mpl_toolkits.axes_grid1.inset_locator.inset_axes")(parent\_axes, width, height[, ...]) | Create an inset axes with a given width and height. |
| [`mark_inset`](mpl_toolkits.axes_grid1.inset_locator.mark_inset#mpl_toolkits.axes_grid1.inset_locator.mark_inset "mpl_toolkits.axes_grid1.inset_locator.mark_inset")(parent\_axes, inset\_axes, loc1, ...) | Draw a box to mark the location of an area represented by an inset axes. |
| [`zoomed_inset_axes`](mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes#mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes "mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes")(parent\_axes, zoom[, loc, ...]) | Create an anchored inset axes by scaling a parent axes. |
| programming_docs |
matplotlib matplotlib.axis.Axis.get_majorticklines matplotlib.axis.Axis.get\_majorticklines
========================================
Axis.get\_majorticklines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1390-L1397)
Return this Axis' major tick lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
matplotlib mpl_toolkits.axisartist.angle_helper.select_step24 mpl\_toolkits.axisartist.angle\_helper.select\_step24
=====================================================
mpl\_toolkits.axisartist.angle\_helper.select\_step24(*v1*, *v2*, *nv*, *include\_last=True*, *threshold\_factor=3600*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L128-L133)
matplotlib matplotlib.axes.Axes.set_ybound matplotlib.axes.Axes.set\_ybound
================================
Axes.set\_ybound(*lower=None*, *upper=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3793-L3823)
Set the lower and upper numerical bounds of the y-axis.
This method will honor axis inversion regardless of parameter order. It will not change the autoscaling setting ([`get_autoscaley_on()`](matplotlib.axes.axes.get_autoscaley_on#matplotlib.axes.Axes.get_autoscaley_on "matplotlib.axes.Axes.get_autoscaley_on")).
Parameters:
**lower, upper**float or None
The lower and upper bounds. If *None*, the respective axis bound is not modified.
See also
[`get_ybound`](matplotlib.axes.axes.get_ybound#matplotlib.axes.Axes.get_ybound "matplotlib.axes.Axes.get_ybound")
[`get_ylim`](matplotlib.axes.axes.get_ylim#matplotlib.axes.Axes.get_ylim "matplotlib.axes.Axes.get_ylim"), [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim")
[`invert_yaxis`](matplotlib.axes.axes.invert_yaxis#matplotlib.axes.Axes.invert_yaxis "matplotlib.axes.Axes.invert_yaxis"), [`yaxis_inverted`](matplotlib.axes.axes.yaxis_inverted#matplotlib.axes.Axes.yaxis_inverted "matplotlib.axes.Axes.yaxis_inverted")
matplotlib matplotlib.axes.Axes.start_pan matplotlib.axes.Axes.start\_pan
===============================
Axes.start\_pan(*x*, *y*, *button*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4196-L4217)
Called when a pan operation has started.
Parameters:
**x, y**float
The mouse coordinates in display coords.
**button**[`MouseButton`](../backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
#### Notes
This is intended to be overridden by new projection types.
matplotlib mpl_toolkits.axisartist.axis_artist.GridlinesCollection mpl\_toolkits.axisartist.axis\_artist.GridlinesCollection
=========================================================
*class*mpl\_toolkits.axisartist.axis\_artist.GridlinesCollection(*\*args*, *which='major'*, *axis='both'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L568-L595)
Bases: [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
Parameters:
**which**{"major", "minor"}
**axis**{"both", "x", "y"}
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L590-L595)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *axis=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *colors=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *grid\_helper=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *segments=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *visible=<UNSET>*, *which=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`axis`](#mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_axis "mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_axis") | unknown |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`colors`](../collections_api#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`grid_helper`](#mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_grid_helper "mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_grid_helper") | unknown |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`segments`](../collections_api#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`which`](#mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_which "mpl_toolkits.axisartist.axis_artist.GridlinesCollection.set_which") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L584-L585)
set\_grid\_helper(*grid\_helper*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L587-L588)
set\_which(*which*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L581-L582)
matplotlib matplotlib.axis.Axis.grid matplotlib.axis.Axis.grid
=========================
Axis.grid(*visible=None*, *which='major'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1553-L1594)
Configure the grid lines.
Parameters:
**visible**bool or None
Whether to show the grid lines. If any *kwargs* are supplied, it is assumed you want the grid on and *visible* will be set to True.
If *visible* is *None* and there are no *kwargs*, this toggles the visibility of the lines.
**which**{'major', 'minor', 'both'}
The grid lines to apply the changes on.
**\*\*kwargs**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties
Define the line properties of the grid, e.g.:
```
grid(color='r', linestyle='-', linewidth=2)
```
Examples using `matplotlib.axis.Axis.grid`
------------------------------------------
[Box plots with custom fill colors](https://matplotlib.org/stable/gallery/statistics/boxplot_color.html#sphx-glr-gallery-statistics-boxplot-color-py)
Box plots with custom fill colors
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Box plot vs. violin plot comparison](https://matplotlib.org/stable/gallery/statistics/boxplot_vs_violin.html#sphx-glr-gallery-statistics-boxplot-vs-violin-py)
Box plot vs. violin plot comparison
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
matplotlib mpl_toolkits.axes_grid1.axes_divider.VBoxDivider mpl\_toolkits.axes\_grid1.axes\_divider.VBoxDivider
===================================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.VBoxDivider(*fig*, *\*args*, *horizontal=None*, *vertical=None*, *aspect=None*, *anchor='C'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L655-L691)
Bases: [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider")
A [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider") for laying out axes vertically, while ensuring that they have equal widths.
Parameters:
**fig**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**\*args**tuple (*nrows*, *ncols*, *index*) or int
The array of subplots in the figure has dimensions `(nrows,
ncols)`, and *index* is the index of the subplot being created. *index* starts at 1 in the upper left corner and increases to the right.
If *nrows*, *ncols*, and *index* are all single digit numbers, then *args* can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
locate(*nx*, *ny*, *nx1=None*, *ny1=None*, *axes=None*, *renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L675-L691)
Parameters:
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
**ny, ny1**int
Same as *nx* and *nx1*, but for row positions.
**axes**
**renderer**
new\_locator(*ny*, *ny1=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L661-L673)
Create a new [`AxesLocator`](mpl_toolkits.axes_grid1.axes_divider.axeslocator#mpl_toolkits.axes_grid1.axes_divider.AxesLocator "mpl_toolkits.axes_grid1.axes_divider.AxesLocator") for the specified cell.
Parameters:
**ny, ny1**int
Integers specifying the row-position of the cell. When *ny1* is None, a single *ny*-th row is specified. Otherwise location of rows spanning between *ny* to *ny1* (but excluding *ny1*-th row) is specified.
matplotlib matplotlib.pyplot.table matplotlib.pyplot.table
=======================
matplotlib.pyplot.table(*cellText=None*, *cellColours=None*, *cellLoc='right'*, *colWidths=None*, *rowLabels=None*, *rowColours=None*, *rowLoc='left'*, *colLabels=None*, *colColours=None*, *colLoc='center'*, *loc='bottom'*, *bbox=None*, *edges='closed'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2883-L2895)
Add a table to an [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
At least one of *cellText* or *cellColours* must be specified. These parameters must be 2D lists, in which the outer lists define the rows and the inner list define the column values per row. Each row must have the same number of elements.
The table can optionally have row and column headers, which are configured using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*, *colLoc* respectively.
For finer grained control over tables, use the [`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table") class and add it to the axes with [`Axes.add_table`](matplotlib.axes.axes.add_table#matplotlib.axes.Axes.add_table "matplotlib.axes.Axes.add_table").
Parameters:
**cellText**2D list of str, optional
The texts to place into the table cells.
*Note*: Line breaks in the strings are currently not accounted for and will result in the text exceeding the cell boundaries.
**cellColours**2D list of colors, optional
The background colors of the cells.
**cellLoc**{'left', 'center', 'right'}, default: 'right'
The alignment of the text within the cells.
**colWidths**list of float, optional
The column widths in units of the axes. If not given, all columns will have a width of *1 / ncols*.
**rowLabels**list of str, optional
The text of the row header cells.
**rowColours**list of colors, optional
The colors of the row header cells.
**rowLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the row header cells.
**colLabels**list of str, optional
The text of the column header cells.
**colColours**list of colors, optional
The colors of the column header cells.
**colLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the column header cells.
**loc**str, optional
The position of the cell with respect to *ax*. This must be one of the [`codes`](../table_api#matplotlib.table.Table.codes "matplotlib.table.Table.codes").
**bbox**[`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), optional
A bounding box to draw the table into. If this is not *None*, this overrides *loc*.
**edges**substring of 'BRTL' or {'open', 'closed', 'horizontal', 'vertical'}
The cell edges to be drawn with a line. See also [`visible_edges`](../table_api#matplotlib.table.Cell.visible_edges "matplotlib.table.Cell.visible_edges").
Returns:
[`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table")
The created table.
Other Parameters:
**\*\*kwargs**
[`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table") properties.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontsize`](../table_api#matplotlib.table.Table.set_fontsize "matplotlib.table.Table.set_fontsize") | float |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.pyplot.table`
----------------------------------------
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.axes_grid.AxesGrid mpl\_toolkits.axes\_grid1.axes\_grid.AxesGrid
=============================================
mpl\_toolkits.axes\_grid1.axes\_grid.AxesGrid[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L314-L573)
alias of [`ImageGrid`](mpl_toolkits.axes_grid1.axes_grid.imagegrid#mpl_toolkits.axes_grid1.axes_grid.ImageGrid "mpl_toolkits.axes_grid1.axes_grid.ImageGrid")
matplotlib mpl_toolkits.axes_grid1.axes_size mpl\_toolkits.axes\_grid1.axes\_size
====================================
Provides classes of simple units that will be used with AxesDivider class (or others) to determine the size of each axes. The unit classes define `get_size` method that returns a tuple of two floats, meaning relative and absolute sizes, respectively.
Note that this class is nothing more than a simple tuple of two floats. Take a look at the Divider class to see how these two values are used.
Classes
-------
| | |
| --- | --- |
| [`Add`](mpl_toolkits.axes_grid1.axes_size.add#mpl_toolkits.axes_grid1.axes_size.Add "mpl_toolkits.axes_grid1.axes_size.Add")(a, b) | |
| [`AddList`](mpl_toolkits.axes_grid1.axes_size.addlist#mpl_toolkits.axes_grid1.axes_size.AddList "mpl_toolkits.axes_grid1.axes_size.AddList")(add\_list) | [*Deprecated*] |
| [`AxesX`](mpl_toolkits.axes_grid1.axes_size.axesx#mpl_toolkits.axes_grid1.axes_size.AxesX "mpl_toolkits.axes_grid1.axes_size.AxesX")(axes[, aspect, ref\_ax]) | Scaled size whose relative part corresponds to the data width of the *axes* multiplied by the *aspect*. |
| [`AxesY`](mpl_toolkits.axes_grid1.axes_size.axesy#mpl_toolkits.axes_grid1.axes_size.AxesY "mpl_toolkits.axes_grid1.axes_size.AxesY")(axes[, aspect, ref\_ax]) | Scaled size whose relative part corresponds to the data height of the *axes* multiplied by the *aspect*. |
| [`Fixed`](mpl_toolkits.axes_grid1.axes_size.fixed#mpl_toolkits.axes_grid1.axes_size.Fixed "mpl_toolkits.axes_grid1.axes_size.Fixed")(fixed\_size) | Simple fixed size with absolute part = *fixed\_size* and relative part = 0. |
| [`Fraction`](mpl_toolkits.axes_grid1.axes_size.fraction#mpl_toolkits.axes_grid1.axes_size.Fraction "mpl_toolkits.axes_grid1.axes_size.Fraction")(fraction, ref\_size) | An instance whose size is a *fraction* of the *ref\_size*. |
| [`GetExtentHelper`](mpl_toolkits.axes_grid1.axes_size.getextenthelper#mpl_toolkits.axes_grid1.axes_size.GetExtentHelper "mpl_toolkits.axes_grid1.axes_size.GetExtentHelper")(ax, direction) | [*Deprecated*] |
| [`MaxExtent`](mpl_toolkits.axes_grid1.axes_size.maxextent#mpl_toolkits.axes_grid1.axes_size.MaxExtent "mpl_toolkits.axes_grid1.axes_size.MaxExtent")(artist\_list, w\_or\_h) | Size whose absolute part is either the largest width or the largest height of the given *artist\_list*. |
| [`MaxHeight`](mpl_toolkits.axes_grid1.axes_size.maxheight#mpl_toolkits.axes_grid1.axes_size.MaxHeight "mpl_toolkits.axes_grid1.axes_size.MaxHeight")(artist\_list) | Size whose absolute part is the largest height of the given *artist\_list*. |
| [`MaxWidth`](mpl_toolkits.axes_grid1.axes_size.maxwidth#mpl_toolkits.axes_grid1.axes_size.MaxWidth "mpl_toolkits.axes_grid1.axes_size.MaxWidth")(artist\_list) | Size whose absolute part is the largest width of the given *artist\_list*. |
| [`Padded`](mpl_toolkits.axes_grid1.axes_size.padded#mpl_toolkits.axes_grid1.axes_size.Padded "mpl_toolkits.axes_grid1.axes_size.Padded")(size, pad) | [*Deprecated*] Return a instance where the absolute part of *size* is increase by the amount of *pad*. |
| [`Scalable`](mpl_toolkits.axes_grid1.axes_size.scalable#mpl_toolkits.axes_grid1.axes_size.Scalable "mpl_toolkits.axes_grid1.axes_size.Scalable") | alias of [`Scaled`](mpl_toolkits.axes_grid1.axes_size.scaled#mpl_toolkits.axes_grid1.axes_size.Scaled "mpl_toolkits.axes_grid1.axes_size.Scaled") |
| [`Scaled`](mpl_toolkits.axes_grid1.axes_size.scaled#mpl_toolkits.axes_grid1.axes_size.Scaled "mpl_toolkits.axes_grid1.axes_size.Scaled")(scalable\_size) | Simple scaled(?) size with absolute part = 0 and relative part = *scalable\_size*. |
| [`SizeFromFunc`](mpl_toolkits.axes_grid1.axes_size.sizefromfunc#mpl_toolkits.axes_grid1.axes_size.SizeFromFunc "mpl_toolkits.axes_grid1.axes_size.SizeFromFunc")(func) | [*Deprecated*] |
Functions
---------
| | |
| --- | --- |
| [`from_any`](mpl_toolkits.axes_grid1.axes_size.from_any#mpl_toolkits.axes_grid1.axes_size.from_any "mpl_toolkits.axes_grid1.axes_size.from_any")(size[, fraction\_ref]) | Create a Fixed unit when the first argument is a float, or a Fraction unit if that is a string that ends with %. |
matplotlib matplotlib.pyplot.subplots matplotlib.pyplot.subplots
==========================
matplotlib.pyplot.subplots(*nrows=1*, *ncols=1*, *\**, *sharex=False*, *sharey=False*, *squeeze=True*, *width\_ratios=None*, *height\_ratios=None*, *subplot\_kw=None*, *gridspec\_kw=None*, *\*\*fig\_kw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1284-L1435)
Create a figure and a set of subplots.
This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call.
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subplot grid.
**sharex, sharey**bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of properties among x (*sharex*) or y (*sharey*) axes:
* True or 'all': x- or y-axis will be shared among all subplots.
* False or 'none': each subplot x- or y-axis will be independent.
* 'row': each subplot row will share an x- or y-axis.
* 'col': each subplot column will share an x- or y-axis.
When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use [`tick_params`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
When subplots have a shared axis that has units, calling [`set_units`](matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") will update each axis with the new units.
**squeeze**bool, default: True
* If True, extra dimensions are squeezed out from the returned array of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"):
+ if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar.
+ for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects.
+ for NxM, subplots with N>1 and M>1 are returned as a 2D array.
* If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Convenience for `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dict with keywords passed to the [`add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dict with keywords passed to the [`GridSpec`](matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
**\*\*fig\_kw**
All additional keyword arguments are passed to the [`pyplot.figure`](matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure") call.
Returns:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**ax**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or array of Axes
*ax* can be either a single [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object, or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the squeeze keyword, see above.
Typical idioms for handling the return value are:
```
# using the variable ax for single a Axes
fig, ax = plt.subplots()
# using the variable axs for multiple Axes
fig, axs = plt.subplots(2, 2)
# using tuple unpacking for multiple Axes
fig, (ax1, ax2) = plt.subplots(1, 2)
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
```
The names `ax` and pluralized `axs` are preferred over `axes` because for the latter it's not clear if it refers to a single [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance or a collection of these.
See also
[`pyplot.figure`](matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure")
[`pyplot.subplot`](matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](../figure_api#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`Figure.add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
#### Examples
```
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create just a figure and only one subplot
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
# Create two subplots and unpack the output array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Create four polar axes and access them through the returned array
fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection="polar"))
axs[0, 0].plot(x, y)
axs[1, 1].scatter(x, y)
# Share a X axis with each column of subplots
plt.subplots(2, 2, sharex='col')
# Share a Y axis with each row of subplots
plt.subplots(2, 2, sharey='row')
# Share both X and Y axes with all subplots
plt.subplots(2, 2, sharex='all', sharey='all')
# Note that this is the same as
plt.subplots(2, 2, sharex=True, sharey=True)
# Create figure number 10 with a single subplot
# and clears it if it already exists.
fig, ax = plt.subplots(num=10, clear=True)
```
Examples using `matplotlib.pyplot.subplots`
-------------------------------------------
[Bar color demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_colors.html#sphx-glr-gallery-lines-bars-and-markers-bar-colors-py)
Bar color demo
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Stacked bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html#sphx-glr-gallery-lines-bars-and-markers-bar-stacked-py)
Stacked bar chart
[Grouped bar chart with labels](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html#sphx-glr-gallery-lines-bars-and-markers-barchart-py)
Grouped bar chart with labels
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[Plotting categorical variables](https://matplotlib.org/stable/gallery/lines_bars_and_markers/categorical_variables.html#sphx-glr-gallery-lines-bars-and-markers-categorical-variables-py)
Plotting categorical variables
[Plotting the coherence of two signals](https://matplotlib.org/stable/gallery/lines_bars_and_markers/cohere.html#sphx-glr-gallery-lines-bars-and-markers-cohere-py)
Plotting the coherence of two signals
[CSD Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/csd_demo.html#sphx-glr-gallery-lines-bars-and-markers-csd-demo-py)
CSD Demo
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Errorbar subsampling](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_subsample.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-subsample-py)
Errorbar subsampling
[Eventplot Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventplot-demo-py)
Eventplot Demo
[Filled polygon](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py)
Filled polygon
[Fill Between and Alpha](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_alpha.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-alpha-py)
Fill Between and Alpha
[Filling the area between lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-demo-py)
Filling the area between lines
[Fill Betweenx Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_betweenx_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-betweenx-demo-py)
Fill Betweenx Demo
[Hatch-filled histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/filled_step.html#sphx-glr-gallery-lines-bars-and-markers-filled-step-py)
Hatch-filled histograms
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Hat graph](https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py)
Hat graph
[Discrete distribution as horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/horizontal_barchart_distribution.html#sphx-glr-gallery-lines-bars-and-markers-horizontal-barchart-distribution-py)
Discrete distribution as horizontal bar chart
[Customizing dashed line styles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/line_demo_dash_control.html#sphx-glr-gallery-lines-bars-and-markers-line-demo-dash-control-py)
Customizing dashed line styles
[Lines with a ticked patheffect](https://matplotlib.org/stable/gallery/lines_bars_and_markers/lines_with_ticks_demo.html#sphx-glr-gallery-lines-bars-and-markers-lines-with-ticks-demo-py)
Lines with a ticked patheffect
[Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html#sphx-glr-gallery-lines-bars-and-markers-linestyles-py)
Linestyles
[Marker reference](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html#sphx-glr-gallery-lines-bars-and-markers-marker-reference-py)
Marker reference
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Multicolored lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multicolored_line.html#sphx-glr-gallery-lines-bars-and-markers-multicolored-line-py)
Multicolored lines
[Mapping marker properties to multivariate data](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html#sphx-glr-gallery-lines-bars-and-markers-multivariate-marker-plot-py)
Mapping marker properties to multivariate data
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Scatter plots with custom symbols](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_custom_symbol.html#sphx-glr-gallery-lines-bars-and-markers-scatter-custom-symbol-py)
Scatter plots with custom symbols
[Scatter Demo2](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_demo2.html#sphx-glr-gallery-lines-bars-and-markers-scatter-demo2-py)
Scatter Demo2
[Marker examples](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_star_poly.html#sphx-glr-gallery-lines-bars-and-markers-scatter-star-poly-py)
Marker examples
[Scatter plots with a legend](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#sphx-glr-gallery-lines-bars-and-markers-scatter-with-legend-py)
Scatter plots with a legend
[Simple Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py)
Simple Plot
[Using span\_where](https://matplotlib.org/stable/gallery/lines_bars_and_markers/span_regions.html#sphx-glr-gallery-lines-bars-and-markers-span-regions-py)
Using span\_where
[Spectrum Representations](https://matplotlib.org/stable/gallery/lines_bars_and_markers/spectrum_demo.html#sphx-glr-gallery-lines-bars-and-markers-spectrum-demo-py)
Spectrum Representations
[Stackplots and streamgraphs](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-stackplot-demo-py)
Stackplots and streamgraphs
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[hlines and vlines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/vline_hline_demo.html#sphx-glr-gallery-lines-bars-and-markers-vline-hline-demo-py)
hlines and vlines
[Cross- and Auto-Correlation Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/xcorr_acorr_demo.html#sphx-glr-gallery-lines-bars-and-markers-xcorr-acorr-demo-py)
Cross- and Auto-Correlation Demo
[Affine transform of an image](https://matplotlib.org/stable/gallery/images_contours_and_fields/affine_image.html#sphx-glr-gallery-images-contours-and-fields-affine-image-py)
Affine transform of an image
[Wind Barbs](https://matplotlib.org/stable/gallery/images_contours_and_fields/barb_demo.html#sphx-glr-gallery-images-contours-and-fields-barb-demo-py)
Wind Barbs
[Interactive Adjustment of Colormap Range](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_interactive_adjustment.html#sphx-glr-gallery-images-contours-and-fields-colormap-interactive-adjustment-py)
Interactive Adjustment of Colormap Range
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Colormap Normalizations SymLogNorm](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations_symlognorm.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-symlognorm-py)
Colormap Normalizations SymLogNorm
[Contour Corner Mask](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_corner_mask.html#sphx-glr-gallery-images-contours-and-fields-contour-corner-mask-py)
Contour Corner Mask
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
[Contour Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_image.html#sphx-glr-gallery-images-contours-and-fields-contour-image-py)
Contour Image
[Contour Label Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_label_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-label-demo-py)
Contour Label Demo
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Contourf Hatching](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_hatching.html#sphx-glr-gallery-images-contours-and-fields-contourf-hatching-py)
Contourf Hatching
[Contourf and log color scale](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_log.html#sphx-glr-gallery-images-contours-and-fields-contourf-log-py)
Contourf and log color scale
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[BboxImage Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/demo_bboximage.html#sphx-glr-gallery-images-contours-and-fields-demo-bboximage-py)
BboxImage Demo
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html#sphx-glr-gallery-images-contours-and-fields-image-antialiasing-py)
Image antialiasing
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
[Blend transparency with color in 2D images](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_transparency_blend.html#sphx-glr-gallery-images-contours-and-fields-image-transparency-blend-py)
Blend transparency with color in 2D images
[Modifying the coordinate formatter](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_zcoord.html#sphx-glr-gallery-images-contours-and-fields-image-zcoord-py)
Modifying the coordinate formatter
[Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html#sphx-glr-gallery-images-contours-and-fields-interpolation-methods-py)
Interpolations for imshow
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Multi Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/multi_image.html#sphx-glr-gallery-images-contours-and-fields-multi-image-py)
Multi Image
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
[pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-grids-py)
pcolormesh grids and shading
[pcolormesh](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-levels-py)
pcolormesh
[Streamplot](https://matplotlib.org/stable/gallery/images_contours_and_fields/plot_streamplot.html#sphx-glr-gallery-images-contours-and-fields-plot-streamplot-py)
Streamplot
[QuadMesh Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quadmesh_demo.html#sphx-glr-gallery-images-contours-and-fields-quadmesh-demo-py)
QuadMesh Demo
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
[Quiver Simple Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-simple-demo-py)
Quiver Simple Demo
[Shading example](https://matplotlib.org/stable/gallery/images_contours_and_fields/shading_example.html#sphx-glr-gallery-images-contours-and-fields-shading-example-py)
Shading example
[Spectrogram Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/specgram_demo.html#sphx-glr-gallery-images-contours-and-fields-specgram-demo-py)
Spectrogram Demo
[Spy Demos](https://matplotlib.org/stable/gallery/images_contours_and_fields/spy_demos.html#sphx-glr-gallery-images-contours-and-fields-spy-demos-py)
Spy Demos
[Tricontour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_demo.html#sphx-glr-gallery-images-contours-and-fields-tricontour-demo-py)
Tricontour Demo
[Tricontour Smooth Delaunay](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_delaunay.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-delaunay-py)
Tricontour Smooth Delaunay
[Tricontour Smooth User](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_user.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-user-py)
Tricontour Smooth User
[Trigradient Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/trigradient_demo.html#sphx-glr-gallery-images-contours-and-fields-trigradient-demo-py)
Trigradient Demo
[Triinterp Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/triinterp_demo.html#sphx-glr-gallery-images-contours-and-fields-triinterp-demo-py)
Triinterp Demo
[Tripcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tripcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-tripcolor-demo-py)
Tripcolor Demo
[Triplot Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/triplot_demo.html#sphx-glr-gallery-images-contours-and-fields-triplot-demo-py)
Triplot Demo
[Watermark image](https://matplotlib.org/stable/gallery/images_contours_and_fields/watermark_image.html#sphx-glr-gallery-images-contours-and-fields-watermark-image-py)
Watermark image
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Controlling view limits using margins and sticky\_edges](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_margins.html#sphx-glr-gallery-subplots-axes-and-figures-axes-margins-py)
Controlling view limits using margins and sticky\_edges
[Axes Props](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_props.html#sphx-glr-gallery-subplots-axes-and-figures-axes-props-py)
Axes Props
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Equal axis aspect ratio](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axis_equal_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axis-equal-demo-py)
Equal axis aspect ratio
[Axis Label Position](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axis_labels_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axis-labels-demo-py)
Axis Label Position
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Placing Colorbars](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/colorbar_placement.html#sphx-glr-gallery-subplots-axes-and-figures-colorbar-placement-py)
Placing Colorbars
[Resizing axes with constrained layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_constrained_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-constrained-layout-py)
Resizing axes with constrained layout
[Resizing axes with tight layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_tight_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-tight-layout-py)
Resizing axes with tight layout
[Different scales on the same axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/fahrenheit_celsius_scales.html#sphx-glr-gallery-subplots-axes-and-figures-fahrenheit-celsius-scales-py)
Different scales on the same axes
[Figure size in different units](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_size_units.html#sphx-glr-gallery-subplots-axes-and-figures-figure-size-units-py)
Figure size in different units
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Creating adjacent subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/ganged_plots.html#sphx-glr-gallery-subplots-axes-and-figures-ganged-plots-py)
Creating adjacent subplots
[Combining two subplots using subplots and GridSpec](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_and_subplots.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-and-subplots-py)
Combining two subplots using subplots and GridSpec
[Invert Axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/invert_axes.html#sphx-glr-gallery-subplots-axes-and-figures-invert-axes-py)
Invert Axes
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html#sphx-glr-gallery-subplots-axes-and-figures-subfigures-py)
Figure subfigures
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Creating multiple subplots using plt.subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-demo-py)
Creating multiple subplots using ``plt.subplots``
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html#sphx-glr-gallery-subplots-axes-and-figures-two-scales-py)
Plots with different scales
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Percentiles as horizontal bar chart](https://matplotlib.org/stable/gallery/statistics/barchart_demo.html#sphx-glr-gallery-statistics-barchart-demo-py)
Percentiles as horizontal bar chart
[Artist customization in box plots](https://matplotlib.org/stable/gallery/statistics/boxplot.html#sphx-glr-gallery-statistics-boxplot-py)
Artist customization in box plots
[Box plots with custom fill colors](https://matplotlib.org/stable/gallery/statistics/boxplot_color.html#sphx-glr-gallery-statistics-boxplot-color-py)
Box plots with custom fill colors
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Box plot vs. violin plot comparison](https://matplotlib.org/stable/gallery/statistics/boxplot_vs_violin.html#sphx-glr-gallery-statistics-boxplot-vs-violin-py)
Box plot vs. violin plot comparison
[Boxplot drawer function](https://matplotlib.org/stable/gallery/statistics/bxp.html#sphx-glr-gallery-statistics-bxp-py)
Boxplot drawer function
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
[Errorbar function](https://matplotlib.org/stable/gallery/statistics/errorbar.html#sphx-glr-gallery-statistics-errorbar-py)
Errorbar function
[Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html#sphx-glr-gallery-statistics-errorbar-features-py)
Different ways of specifying error bars
[Including upper and lower limits in error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_limits.html#sphx-glr-gallery-statistics-errorbar-limits-py)
Including upper and lower limits in error bars
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Hexagonal binned plot](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html#sphx-glr-gallery-statistics-hexbin-demo-py)
Hexagonal binned plot
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Using histograms to plot a cumulative distribution](https://matplotlib.org/stable/gallery/statistics/histogram_cumulative.html#sphx-glr-gallery-statistics-histogram-cumulative-py)
Using histograms to plot a cumulative distribution
[Some features of the histogram (hist) function](https://matplotlib.org/stable/gallery/statistics/histogram_features.html#sphx-glr-gallery-statistics-histogram-features-py)
Some features of the histogram (hist) function
[Demo of the histogram function's different histtype settings](https://matplotlib.org/stable/gallery/statistics/histogram_histtypes.html#sphx-glr-gallery-statistics-histogram-histtypes-py)
Demo of the histogram function's different ``histtype`` settings
[The histogram (hist) function with multiple data sets](https://matplotlib.org/stable/gallery/statistics/histogram_multihist.html#sphx-glr-gallery-statistics-histogram-multihist-py)
The histogram (hist) function with multiple data sets
[Producing multiple histograms side by side](https://matplotlib.org/stable/gallery/statistics/multiple_histograms_side_by_side.html#sphx-glr-gallery-statistics-multiple-histograms-side-by-side-py)
Producing multiple histograms side by side
[Time Series Histogram](https://matplotlib.org/stable/gallery/statistics/time_series_histogram.html#sphx-glr-gallery-statistics-time-series-histogram-py)
Time Series Histogram
[Violin plot basics](https://matplotlib.org/stable/gallery/statistics/violinplot.html#sphx-glr-gallery-statistics-violinplot-py)
Violin plot basics
[Basic pie chart](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_features.html#sphx-glr-gallery-pie-and-polar-charts-pie-features-py)
Basic pie chart
[Pie Demo2](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_demo2.html#sphx-glr-gallery-pie-and-polar-charts-pie-demo2-py)
Pie Demo2
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Nested pie charts](https://matplotlib.org/stable/gallery/pie_and_polar_charts/nested_pie.html#sphx-glr-gallery-pie-and-polar-charts-nested-pie-py)
Nested pie charts
[Labeling a pie and a donut](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py)
Labeling a pie and a donut
[Polar plot](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_demo.html#sphx-glr-gallery-pie-and-polar-charts-polar-demo-py)
Polar plot
[Using accented text in Matplotlib](https://matplotlib.org/stable/gallery/text_labels_and_annotations/accented_text.html#sphx-glr-gallery-text-labels-and-annotations-accented-text-py)
Using accented text in Matplotlib
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Labeling ticks using engineering notation](https://matplotlib.org/stable/gallery/text_labels_and_annotations/engineering_formatter.html#sphx-glr-gallery-text-labels-and-annotations-engineering-formatter-py)
Labeling ticks using engineering notation
[Figure legend demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/figlegend_demo.html#sphx-glr-gallery-text-labels-and-annotations-figlegend-demo-py)
Figure legend demo
[Configuring the font family](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_family_rc.html#sphx-glr-gallery-text-labels-and-annotations-font-family-rc-py)
Configuring the font family
[Using a ttf font file in Matplotlib](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_file.html#sphx-glr-gallery-text-labels-and-annotations-font-file-py)
Using a ttf font file in Matplotlib
[Font table](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_table.html#sphx-glr-gallery-text-labels-and-annotations-font-table-py)
Font table
[Legend using pre-defined labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend.html#sphx-glr-gallery-text-labels-and-annotations-legend-py)
Legend using pre-defined labels
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[Artist within an artist](https://matplotlib.org/stable/gallery/text_labels_and_annotations/line_with_text.html#sphx-glr-gallery-text-labels-and-annotations-line-with-text-py)
Artist within an artist
[Mathtext](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_demo.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-demo-py)
Mathtext
[Math fontfamily](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_fontfamily_example.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-fontfamily-example-py)
Math fontfamily
[Multiline](https://matplotlib.org/stable/gallery/text_labels_and_annotations/multiline.html#sphx-glr-gallery-text-labels-and-annotations-multiline-py)
Multiline
[Placing text boxes](https://matplotlib.org/stable/gallery/text_labels_and_annotations/placing_text_boxes.html#sphx-glr-gallery-text-labels-and-annotations-placing-text-boxes-py)
Placing text boxes
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Default text rotation demonstration](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-py)
Default text rotation demonstration
[Text Rotation Relative To Line](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation_relative_to_line.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-relative-to-line-py)
Text Rotation Relative To Line
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
[Text watermark](https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html#sphx-glr-gallery-text-labels-and-annotations-watermark-text-py)
Text watermark
[Align y-labels](https://matplotlib.org/stable/gallery/pyplots/align_ylabels.html#sphx-glr-gallery-pyplots-align-ylabels-py)
Align y-labels
[Annotate Transform](https://matplotlib.org/stable/gallery/pyplots/annotate_transform.html#sphx-glr-gallery-pyplots-annotate-transform-py)
Annotate Transform
[Annotating a plot](https://matplotlib.org/stable/gallery/pyplots/annotation_basic.html#sphx-glr-gallery-pyplots-annotation-basic-py)
Annotating a plot
[Programmatically controlling subplot adjustment](https://matplotlib.org/stable/gallery/pyplots/auto_subplots_adjust.html#sphx-glr-gallery-pyplots-auto-subplots-adjust-py)
Programmatically controlling subplot adjustment
[Boxplot Demo](https://matplotlib.org/stable/gallery/pyplots/boxplot_demo_pyplot.html#sphx-glr-gallery-pyplots-boxplot-demo-pyplot-py)
Boxplot Demo
[Dollar Ticks](https://matplotlib.org/stable/gallery/pyplots/dollar_ticks.html#sphx-glr-gallery-pyplots-dollar-ticks-py)
Dollar Ticks
[Color Demo](https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-gallery-color-color-demo-py)
Color Demo
[Color by y-value](https://matplotlib.org/stable/gallery/color/color_by_yvalue.html#sphx-glr-gallery-color-color-by-yvalue-py)
Color by y-value
[Colors in the default property cycle](https://matplotlib.org/stable/gallery/color/color_cycle_default.html#sphx-glr-gallery-color-color-cycle-default-py)
Colors in the default property cycle
[Colorbar](https://matplotlib.org/stable/gallery/color/colorbar_basics.html#sphx-glr-gallery-color-colorbar-basics-py)
Colorbar
[Colormap reference](https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-gallery-color-colormap-reference-py)
Colormap reference
[Creating a colormap from a list of colors](https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-gallery-color-custom-cmap-py)
Creating a colormap from a list of colors
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
[Compound path](https://matplotlib.org/stable/gallery/shapes_and_collections/compound_path.html#sphx-glr-gallery-shapes-and-collections-compound-path-py)
Compound path
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[Ellipse Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_collection.html#sphx-glr-gallery-shapes-and-collections-ellipse-collection-py)
Ellipse Collection
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html#sphx-glr-gallery-shapes-and-collections-hatch-style-reference-py)
Hatch style reference
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[Bezier Curve](https://matplotlib.org/stable/gallery/shapes_and_collections/quad_bezier.html#sphx-glr-gallery-shapes-and-collections-quad-bezier-py)
Bezier Curve
[Bayesian Methods for Hackers style sheet](https://matplotlib.org/stable/gallery/style_sheets/bmh.html#sphx-glr-gallery-style-sheets-bmh-py)
Bayesian Methods for Hackers style sheet
[Dark background style sheet](https://matplotlib.org/stable/gallery/style_sheets/dark_background.html#sphx-glr-gallery-style-sheets-dark-background-py)
Dark background style sheet
[FiveThirtyEight style sheet](https://matplotlib.org/stable/gallery/style_sheets/fivethirtyeight.html#sphx-glr-gallery-style-sheets-fivethirtyeight-py)
FiveThirtyEight style sheet
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Grayscale style sheet](https://matplotlib.org/stable/gallery/style_sheets/grayscale.html#sphx-glr-gallery-style-sheets-grayscale-py)
Grayscale style sheet
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Anchored Direction Arrow](https://matplotlib.org/stable/gallery/axes_grid1/demo_anchored_direction_arrows.html#sphx-glr-gallery-axes-grid1-demo-anchored-direction-arrows-py)
Anchored Direction Arrow
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Showing RGB channels using RGBAxes](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html#sphx-glr-gallery-axes-grid1-demo-axes-rgb-py)
Showing RGB channels using RGBAxes
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Colorbar with AxesDivider](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-axes-divider-py)
Colorbar with `.AxesDivider`
[Controlling the position and size of colorbars with Inset Axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_inset_locator.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-inset-locator-py)
Controlling the position and size of colorbars with Inset Axes
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Scatter Histogram (Locatable Axes)](https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-gallery-axes-grid1-scatter-hist-locatable-axes-py)
Scatter Histogram (Locatable Axes)
[Simple Anchored Artists](https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-gallery-axes-grid1-simple-anchored-artists-py)
Simple Anchored Artists
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
[Animated histogram](https://matplotlib.org/stable/gallery/animation/animated_histogram.html#sphx-glr-gallery-animation-animated-histogram-py)
Animated histogram
[pyplot animation](https://matplotlib.org/stable/gallery/animation/animation_demo.html#sphx-glr-gallery-animation-animation-demo-py)
pyplot animation
 [The Bayes update](https://matplotlib.org/stable/gallery/animation/bayes_update.html#sphx-glr-gallery-animation-bayes-update-py)
The Bayes update
 [Animated image using a precomputed list of images](https://matplotlib.org/stable/gallery/animation/dynamic_image.html#sphx-glr-gallery-animation-dynamic-image-py)
Animated image using a precomputed list of images
[Pausing and Resuming an Animation](https://matplotlib.org/stable/gallery/animation/pause_resume.html#sphx-glr-gallery-animation-pause-resume-py)
Pausing and Resuming an Animation
[Animated line plot](https://matplotlib.org/stable/gallery/animation/simple_anim.html#sphx-glr-gallery-animation-simple-anim-py)
Animated line plot
[Oscilloscope](https://matplotlib.org/stable/gallery/animation/strip_chart.html#sphx-glr-gallery-animation-strip-chart-py)
Oscilloscope
[Mouse move and click events](https://matplotlib.org/stable/gallery/event_handling/coords_demo.html#sphx-glr-gallery-event-handling-coords-demo-py)
Mouse move and click events
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
[Figure/Axes enter and leave events](https://matplotlib.org/stable/gallery/event_handling/figure_axes_enter_leave.html#sphx-glr-gallery-event-handling-figure-axes-enter-leave-py)
Figure/Axes enter and leave events
[Image Slices Viewer](https://matplotlib.org/stable/gallery/event_handling/image_slices_viewer.html#sphx-glr-gallery-event-handling-image-slices-viewer-py)
Image Slices Viewer
[Keypress event](https://matplotlib.org/stable/gallery/event_handling/keypress_demo.html#sphx-glr-gallery-event-handling-keypress-demo-py)
Keypress event
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Pick Event Demo2](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo2.html#sphx-glr-gallery-event-handling-pick-event-demo2-py)
Pick Event Demo2
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Pong](https://matplotlib.org/stable/gallery/event_handling/pong_sgskip.html#sphx-glr-gallery-event-handling-pong-sgskip-py)
Pong
[Resampling Data](https://matplotlib.org/stable/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py)
Resampling Data
[Timers](https://matplotlib.org/stable/gallery/event_handling/timers.html#sphx-glr-gallery-event-handling-timers-py)
Timers
[Trifinder Event Demo](https://matplotlib.org/stable/gallery/event_handling/trifinder_event_demo.html#sphx-glr-gallery-event-handling-trifinder-event-demo-py)
Trifinder Event Demo
[Viewlims](https://matplotlib.org/stable/gallery/event_handling/viewlims.html#sphx-glr-gallery-event-handling-viewlims-py)
Viewlims
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Changing colors of lines intersecting a box](https://matplotlib.org/stable/gallery/misc/bbox_intersect.html#sphx-glr-gallery-misc-bbox-intersect-py)
Changing colors of lines intersecting a box
[Manual Contour](https://matplotlib.org/stable/gallery/misc/contour_manual.html#sphx-glr-gallery-misc-contour-manual-py)
Manual Contour
[Coords Report](https://matplotlib.org/stable/gallery/misc/coords_report.html#sphx-glr-gallery-misc-coords-report-py)
Coords Report
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[AGG filter](https://matplotlib.org/stable/gallery/misc/demo_agg_filter.html#sphx-glr-gallery-misc-demo-agg-filter-py)
AGG filter
[Ribbon Box](https://matplotlib.org/stable/gallery/misc/demo_ribbon_box.html#sphx-glr-gallery-misc-demo-ribbon-box-py)
Ribbon Box
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[Plotting with keywords](https://matplotlib.org/stable/gallery/misc/keyword_plotting.html#sphx-glr-gallery-misc-keyword-plotting-py)
Plotting with keywords
[Multiprocess](https://matplotlib.org/stable/gallery/misc/multiprocess_sgskip.html#sphx-glr-gallery-misc-multiprocess-sgskip-py)
Multiprocess
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Pythonic Matplotlib](https://matplotlib.org/stable/gallery/misc/pythonic_matplotlib.html#sphx-glr-gallery-misc-pythonic-matplotlib-py)
Pythonic Matplotlib
[Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html#sphx-glr-gallery-misc-rasterization-demo-py)
Rasterization for vector graphics
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[Custom hillshading in a 3D surface plot](https://matplotlib.org/stable/gallery/mplot3d/custom_shaded_3d_surface.html#sphx-glr-gallery-mplot3d-custom-shaded-3d-surface-py)
Custom hillshading in a 3D surface plot
[3D plot projection types](https://matplotlib.org/stable/gallery/mplot3d/projections.html#sphx-glr-gallery-mplot3d-projections-py)
3D plot projection types
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
[3D surface (colormap)](https://matplotlib.org/stable/gallery/mplot3d/surface3d.html#sphx-glr-gallery-mplot3d-surface3d-py)
3D surface (colormap)
[3D wireframe plots in one direction](https://matplotlib.org/stable/gallery/mplot3d/wire3d_zero_stride.html#sphx-glr-gallery-mplot3d-wire3d-zero-stride-py)
3D wireframe plots in one direction
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Log Bar](https://matplotlib.org/stable/gallery/scales/log_bar.html#sphx-glr-gallery-scales-log-bar-py)
Log Bar
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Logit Demo](https://matplotlib.org/stable/gallery/scales/logit_demo.html#sphx-glr-gallery-scales-logit-demo-py)
Logit Demo
[Exploring normalizations](https://matplotlib.org/stable/gallery/scales/power_norm.html#sphx-glr-gallery-scales-power-norm-py)
Exploring normalizations
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[Log Axis](https://matplotlib.org/stable/gallery/scales/semilogx_demo.html#sphx-glr-gallery-scales-semilogx-demo-py)
Log Axis
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
[Hillshading](https://matplotlib.org/stable/gallery/specialty_plots/advanced_hillshading.html#sphx-glr-gallery-specialty-plots-advanced-hillshading-py)
Hillshading
[Anscombe's quartet](https://matplotlib.org/stable/gallery/specialty_plots/anscombe.html#sphx-glr-gallery-specialty-plots-anscombe-py)
Anscombe's quartet
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[MRI](https://matplotlib.org/stable/gallery/specialty_plots/mri_demo.html#sphx-glr-gallery-specialty-plots-mri-demo-py)
===
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[Topographic hillshading](https://matplotlib.org/stable/gallery/specialty_plots/topographic_hillshading.html#sphx-glr-gallery-specialty-plots-topographic-hillshading-py)
Topographic hillshading
[Centered spines with arrows](https://matplotlib.org/stable/gallery/spines/centered_spines_with_arrows.html#sphx-glr-gallery-spines-centered-spines-with-arrows-py)
Centered spines with arrows
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Spines](https://matplotlib.org/stable/gallery/spines/spines.html#sphx-glr-gallery-spines-spines-py)
Spines
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
[Dropped spines](https://matplotlib.org/stable/gallery/spines/spines_dropped.html#sphx-glr-gallery-spines-spines-dropped-py)
Dropped spines
[Automatically setting tick positions](https://matplotlib.org/stable/gallery/ticks/auto_ticks.html#sphx-glr-gallery-ticks-auto-ticks-py)
Automatically setting tick positions
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Custom Ticker](https://matplotlib.org/stable/gallery/ticks/custom_ticker1.html#sphx-glr-gallery-ticks-custom-ticker1-py)
Custom Ticker
[Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html#sphx-glr-gallery-ticks-date-concise-formatter-py)
Formatting date ticks using ConciseDateFormatter
[Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html#sphx-glr-gallery-ticks-date-demo-convert-py)
Date Demo Convert
[Placing date ticks using recurrence rules](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html#sphx-glr-gallery-ticks-date-demo-rrule-py)
Placing date ticks using recurrence rules
[Date tick locators and formatters](https://matplotlib.org/stable/gallery/ticks/date_formatters_locators.html#sphx-glr-gallery-ticks-date-formatters-locators-py)
Date tick locators and formatters
[Custom tick formatter for time series](https://matplotlib.org/stable/gallery/ticks/date_index_formatter.html#sphx-glr-gallery-ticks-date-index-formatter-py)
Custom tick formatter for time series
[Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html#sphx-glr-gallery-ticks-date-precision-and-epochs-py)
Date Precision and Epochs
[Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html#sphx-glr-gallery-ticks-major-minor-demo-py)
Major and minor ticks
[The default tick formatter](https://matplotlib.org/stable/gallery/ticks/scalarformatter.html#sphx-glr-gallery-ticks-scalarformatter-py)
The default tick formatter
[Tick formatters](https://matplotlib.org/stable/gallery/ticks/tick-formatters.html#sphx-glr-gallery-ticks-tick-formatters-py)
Tick formatters
[Tick locators](https://matplotlib.org/stable/gallery/ticks/tick-locators.html#sphx-glr-gallery-ticks-tick-locators-py)
Tick locators
[Set default y-axis tick labels on the right](https://matplotlib.org/stable/gallery/ticks/tick_label_right.html#sphx-glr-gallery-ticks-tick-label-right-py)
Set default y-axis tick labels on the right
[Setting tick labels from a list of values](https://matplotlib.org/stable/gallery/ticks/tick_labels_from_values.html#sphx-glr-gallery-ticks-tick-labels-from-values-py)
Setting tick labels from a list of values
[Move x-axis tick labels to the top](https://matplotlib.org/stable/gallery/ticks/tick_xlabel_top.html#sphx-glr-gallery-ticks-tick-xlabel-top-py)
Move x-axis tick labels to the top
[Fixing too many ticks](https://matplotlib.org/stable/gallery/ticks/ticks_too_many.html#sphx-glr-gallery-ticks-ticks-too-many-py)
Fixing too many ticks
[Annotation with units](https://matplotlib.org/stable/gallery/units/annotate_with_units.html#sphx-glr-gallery-units-annotate-with-units-py)
Annotation with units
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Bar demo with units](https://matplotlib.org/stable/gallery/units/bar_demo2.html#sphx-glr-gallery-units-bar-demo2-py)
Bar demo with units
[Group barchart with units](https://matplotlib.org/stable/gallery/units/bar_unit_demo.html#sphx-glr-gallery-units-bar-unit-demo-py)
Group barchart with units
[Evans test](https://matplotlib.org/stable/gallery/units/evans_test.html#sphx-glr-gallery-units-evans-test-py)
Evans test
[Radian ticks](https://matplotlib.org/stable/gallery/units/radian_demo.html#sphx-glr-gallery-units-radian-demo-py)
Radian ticks
[Inches and Centimeters](https://matplotlib.org/stable/gallery/units/units_sample.html#sphx-glr-gallery-units-units-sample-py)
Inches and Centimeters
[Unit handling](https://matplotlib.org/stable/gallery/units/units_scatter.html#sphx-glr-gallery-units-units-scatter-py)
Unit handling
[pyplot with GTK3](https://matplotlib.org/stable/gallery/user_interfaces/pylab_with_gtk3_sgskip.html#sphx-glr-gallery-user-interfaces-pylab-with-gtk3-sgskip-py)
pyplot with GTK3
[pyplot with GTK4](https://matplotlib.org/stable/gallery/user_interfaces/pylab_with_gtk4_sgskip.html#sphx-glr-gallery-user-interfaces-pylab-with-gtk4-sgskip-py)
pyplot with GTK4
[SVG Tooltip](https://matplotlib.org/stable/gallery/user_interfaces/svg_tooltip_sgskip.html#sphx-glr-gallery-user-interfaces-svg-tooltip-sgskip-py)
SVG Tooltip
[Anchored Box04](https://matplotlib.org/stable/gallery/userdemo/anchored_box04.html#sphx-glr-gallery-userdemo-anchored-box04-py)
Anchored Box04
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Annotate Simple01](https://matplotlib.org/stable/gallery/userdemo/annotate_simple01.html#sphx-glr-gallery-userdemo-annotate-simple01-py)
Annotate Simple01
[Annotate Simple02](https://matplotlib.org/stable/gallery/userdemo/annotate_simple02.html#sphx-glr-gallery-userdemo-annotate-simple02-py)
Annotate Simple02
[Annotate Simple03](https://matplotlib.org/stable/gallery/userdemo/annotate_simple03.html#sphx-glr-gallery-userdemo-annotate-simple03-py)
Annotate Simple03
[Annotate Simple04](https://matplotlib.org/stable/gallery/userdemo/annotate_simple04.html#sphx-glr-gallery-userdemo-annotate-simple04-py)
Annotate Simple04
[Annotate Simple Coord01](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord01.html#sphx-glr-gallery-userdemo-annotate-simple-coord01-py)
Annotate Simple Coord01
[Annotate Simple Coord02](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord02.html#sphx-glr-gallery-userdemo-annotate-simple-coord02-py)
Annotate Simple Coord02
[Annotate Simple Coord03](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord03.html#sphx-glr-gallery-userdemo-annotate-simple-coord03-py)
Annotate Simple Coord03
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
[Connection styles for annotations](https://matplotlib.org/stable/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py)
Connection styles for annotations
[Custom box styles](https://matplotlib.org/stable/gallery/userdemo/custom_boxstyle01.html#sphx-glr-gallery-userdemo-custom-boxstyle01-py)
Custom box styles
[PGF fonts](https://matplotlib.org/stable/gallery/userdemo/pgf_fonts.html#sphx-glr-gallery-userdemo-pgf-fonts-py)
PGF fonts
[PGF preamble](https://matplotlib.org/stable/gallery/userdemo/pgf_preamble_sgskip.html#sphx-glr-gallery-userdemo-pgf-preamble-sgskip-py)
PGF preamble
[PGF texsystem](https://matplotlib.org/stable/gallery/userdemo/pgf_texsystem.html#sphx-glr-gallery-userdemo-pgf-texsystem-py)
PGF texsystem
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Simple Legend02](https://matplotlib.org/stable/gallery/userdemo/simple_legend02.html#sphx-glr-gallery-userdemo-simple-legend02-py)
Simple Legend02
[Annotated Cursor](https://matplotlib.org/stable/gallery/widgets/annotated_cursor.html#sphx-glr-gallery-widgets-annotated-cursor-py)
Annotated Cursor
[Buttons](https://matplotlib.org/stable/gallery/widgets/buttons.html#sphx-glr-gallery-widgets-buttons-py)
Buttons
[Check Buttons](https://matplotlib.org/stable/gallery/widgets/check_buttons.html#sphx-glr-gallery-widgets-check-buttons-py)
Check Buttons
[Cursor](https://matplotlib.org/stable/gallery/widgets/cursor.html#sphx-glr-gallery-widgets-cursor-py)
Cursor
[Lasso Selector](https://matplotlib.org/stable/gallery/widgets/lasso_selector_demo_sgskip.html#sphx-glr-gallery-widgets-lasso-selector-demo-sgskip-py)
Lasso Selector
[Mouse Cursor](https://matplotlib.org/stable/gallery/widgets/mouse_cursor.html#sphx-glr-gallery-widgets-mouse-cursor-py)
Mouse Cursor
[Multicursor](https://matplotlib.org/stable/gallery/widgets/multicursor.html#sphx-glr-gallery-widgets-multicursor-py)
Multicursor
[Select indices from a collection using polygon selector](https://matplotlib.org/stable/gallery/widgets/polygon_selector_demo.html#sphx-glr-gallery-widgets-polygon-selector-demo-py)
Select indices from a collection using polygon selector
[Polygon Selector](https://matplotlib.org/stable/gallery/widgets/polygon_selector_simple.html#sphx-glr-gallery-widgets-polygon-selector-simple-py)
Polygon Selector
[Radio Buttons](https://matplotlib.org/stable/gallery/widgets/radio_buttons.html#sphx-glr-gallery-widgets-radio-buttons-py)
Radio Buttons
[Thresholding an Image with RangeSlider](https://matplotlib.org/stable/gallery/widgets/range_slider.html#sphx-glr-gallery-widgets-range-slider-py)
Thresholding an Image with RangeSlider
[Slider](https://matplotlib.org/stable/gallery/widgets/slider_demo.html#sphx-glr-gallery-widgets-slider-demo-py)
Slider
[Snapping Sliders to Discrete Values](https://matplotlib.org/stable/gallery/widgets/slider_snap_demo.html#sphx-glr-gallery-widgets-slider-snap-demo-py)
Snapping Sliders to Discrete Values
[Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html#sphx-glr-gallery-widgets-span-selector-py)
Span Selector
[Textbox](https://matplotlib.org/stable/gallery/widgets/textbox.html#sphx-glr-gallery-widgets-textbox-py)
Textbox
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Styling with cycler](https://matplotlib.org/stable/tutorials/intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py)
Styling with cycler
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[Autoscaling](https://matplotlib.org/stable/tutorials/intermediate/autoscale.html#sphx-glr-tutorials-intermediate-autoscale-py)
Autoscaling
[Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html#sphx-glr-tutorials-advanced-blitting-py)
Faster rendering by using blitting
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py)
Creating Colormaps in Matplotlib
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
[plot(x, y)](https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py)
plot(x, y)
[scatter(x, y)](https://matplotlib.org/stable/plot_types/basic/scatter_plot.html#sphx-glr-plot-types-basic-scatter-plot-py)
scatter(x, y)
[bar(x, height)](https://matplotlib.org/stable/plot_types/basic/bar.html#sphx-glr-plot-types-basic-bar-py)
bar(x, height)
[stem(x, y)](https://matplotlib.org/stable/plot_types/basic/stem.html#sphx-glr-plot-types-basic-stem-py)
stem(x, y)
[step(x, y)](https://matplotlib.org/stable/plot_types/basic/step.html#sphx-glr-plot-types-basic-step-py)
step(x, y)
[fill\_between(x, y1, y2)](https://matplotlib.org/stable/plot_types/basic/fill_between.html#sphx-glr-plot-types-basic-fill-between-py)
fill\_between(x, y1, y2)
[stackplot(x, y)](https://matplotlib.org/stable/plot_types/basic/stackplot.html#sphx-glr-plot-types-basic-stackplot-py)
stackplot(x, y)
[imshow(Z)](https://matplotlib.org/stable/plot_types/arrays/imshow.html#sphx-glr-plot-types-arrays-imshow-py)
imshow(Z)
[pcolormesh(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/pcolormesh.html#sphx-glr-plot-types-arrays-pcolormesh-py)
pcolormesh(X, Y, Z)
[contour(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/contour.html#sphx-glr-plot-types-arrays-contour-py)
contour(X, Y, Z)
[contourf(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/contourf.html#sphx-glr-plot-types-arrays-contourf-py)
contourf(X, Y, Z)
[barbs(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/barbs.html#sphx-glr-plot-types-arrays-barbs-py)
barbs(X, Y, U, V)
[quiver(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/quiver.html#sphx-glr-plot-types-arrays-quiver-py)
quiver(X, Y, U, V)
[streamplot(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/streamplot.html#sphx-glr-plot-types-arrays-streamplot-py)
streamplot(X, Y, U, V)
[hist(x)](https://matplotlib.org/stable/plot_types/stats/hist_plot.html#sphx-glr-plot-types-stats-hist-plot-py)
hist(x)
[boxplot(X)](https://matplotlib.org/stable/plot_types/stats/boxplot_plot.html#sphx-glr-plot-types-stats-boxplot-plot-py)
boxplot(X)
[errorbar(x, y, yerr, xerr)](https://matplotlib.org/stable/plot_types/stats/errorbar_plot.html#sphx-glr-plot-types-stats-errorbar-plot-py)
errorbar(x, y, yerr, xerr)
[violinplot(D)](https://matplotlib.org/stable/plot_types/stats/violin.html#sphx-glr-plot-types-stats-violin-py)
violinplot(D)
[eventplot(D)](https://matplotlib.org/stable/plot_types/stats/eventplot.html#sphx-glr-plot-types-stats-eventplot-py)
eventplot(D)
[hist2d(x, y)](https://matplotlib.org/stable/plot_types/stats/hist2d.html#sphx-glr-plot-types-stats-hist2d-py)
hist2d(x, y)
[hexbin(x, y, C)](https://matplotlib.org/stable/plot_types/stats/hexbin.html#sphx-glr-plot-types-stats-hexbin-py)
hexbin(x, y, C)
[pie(x)](https://matplotlib.org/stable/plot_types/stats/pie.html#sphx-glr-plot-types-stats-pie-py)
pie(x)
[tricontour(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontour.html#sphx-glr-plot-types-unstructured-tricontour-py)
tricontour(x, y, z)
[tricontourf(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py)
tricontourf(x, y, z)
[tripcolor(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tripcolor.html#sphx-glr-plot-types-unstructured-tripcolor-py)
tripcolor(x, y, z)
[triplot(x, y)](https://matplotlib.org/stable/plot_types/unstructured/triplot.html#sphx-glr-plot-types-unstructured-triplot-py)
triplot(x, y)
| programming_docs |
matplotlib matplotlib.patches.draw_bbox matplotlib.patches.draw\_bbox
=============================
matplotlib.patches.draw\_bbox(*bbox*, *renderer*, *color='k'*, *trans=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2169-L2179)
A debug function to draw a rectangle around the bounding box returned by an artist's [`Artist.get_window_extent`](matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent") to test whether the artist is returning the correct bbox.
matplotlib matplotlib.axis.Axis.set_inverted matplotlib.axis.Axis.set\_inverted
==================================
Axis.set\_inverted(*inverted*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1064-L1074)
Set whether this Axis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.
matplotlib mpl_toolkits.mplot3d.axes3d.Axes3D mpl\_toolkits.mplot3d.axes3d.Axes3D
===================================
*class*mpl\_toolkits.mplot3d.axes3d.Axes3D(*fig*, *rect=None*, *\*args*, *elev=30*, *azim=-60*, *roll=0*, *sharez=None*, *proj\_type='persp'*, *box\_aspect=None*, *computed\_zorder=True*, *focal\_length=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L42-L3245)
Bases: [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes._axes.Axes")
3D Axes object.
Parameters:
**fig**Figure
The parent figure.
**rect**tuple (left, bottom, width, height), default: None.
The `(left, bottom, width, height)` axes position.
**elev**float, default: 30
The elevation angle in degrees rotates the camera above and below the x-y plane, with a positive angle corresponding to a location above the plane.
**azim**float, default: -60
The azimuthal angle in degrees rotates the camera about the z axis, with a positive angle corresponding to a right-handed rotation. In other words, a positive azimuth rotates the camera about the origin from its location along the +x axis towards the +y axis.
**roll**float, default: 0
The roll angle in degrees rotates the camera about the viewing axis. A positive angle spins the camera clockwise, causing the scene to rotate counter-clockwise.
**sharez**Axes3D, optional
Other Axes to share z-limits with.
**proj\_type**{'persp', 'ortho'}
The projection type, default 'persp'.
**box\_aspect**3-tuple of floats, default: None
Changes the physical dimensions of the Axes3D, such that the ratio of the axis lengths in display units is x:y:z. If None, defaults to 4:4:3
**computed\_zorder**bool, default: True
If True, the draw order is computed based on the average position of the [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s along the view direction. Set to False if you want to manually control the order in which Artists are drawn on top of each other using their *zorder* attribute. This can be used for fine-tuning if the automatic order does not produce the desired result. Note however, that a manual zorder will only be correct for a limited view angle. If the figure is rotated by the user, it will look wrong from certain angles.
**auto\_add\_to\_figure**bool, default: False
Prior to Matplotlib 3.4 Axes3D would add themselves to their host Figure on init. Other Axes class do not do this.
This behavior is deprecated in 3.4, the default is changed to False in 3.6. The keyword will be undocumented and a non-False value will be an error in 3.7.
**focal\_length**float, default: None
For a projection type of 'persp', the focal length of the virtual camera. Must be > 0. If None, defaults to 1. For a projection type of 'ortho', must be set to either None or infinity (numpy.inf). If None, defaults to infinity. The focal length can be computed from a desired Field Of View via the equation: focal\_length = 1/tan(FOV/2)
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect "mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect") | {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'} |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`autoscalez_on`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscalez_on "mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscalez_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect "mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect") | 3-tuple of floats or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_frame_on "mpl_toolkits.mplot3d.axes3d.Axes3D.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`proj_type`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type "mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type") | {'persp', 'ortho'} |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") or xlim3d | (bottom: float, top: float) |
| [`xlim3d`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_xscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") or ylim3d | (bottom: float, top: float) |
| [`ylim3d`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_yscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zbound`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zbound "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zbound") | unknown |
| [`zlabel`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlabel "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlabel") | unknown |
| [`zlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim") or zlim3d | unknown |
| [`zmargin`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin") | float greater than -0.5 |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| [`zscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale") | unknown |
| [`zticklabels`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticklabels "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticklabels") | unknown |
| [`zticks`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks") | unknown |
add\_collection3d(*col*, *zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2083-L2114)
Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
Supported are:
* PolyCollection
* LineCollection
* PatchCollection
add\_contour\_set(*cset*, *extend3d=False*, *stride=5*, *zdir='z'*, *offset=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1858-L1867)
add\_contourf\_set(*cset*, *zdir='z'*, *offset=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1869-L1870)
apply\_aspect(*position=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L391-L406)
Adjust the Axes for a specified data aspect ratio.
Depending on [`get_adjustable`](matplotlib.axes.axes.get_adjustable#matplotlib.axes.Axes.get_adjustable "matplotlib.axes.Axes.get_adjustable") this will modify either the Axes box (position) or the view limits. In the former case, [`get_anchor`](matplotlib.axes.axes.get_anchor#matplotlib.axes.Axes.get_anchor "matplotlib.axes.Axes.get_anchor") will affect the position.
Parameters:
**position**None or .Bbox
If not `None`, this defines the position of the Axes within the figure as a Bbox. See [`get_position`](matplotlib.axes.axes.get_position#matplotlib.axes.Axes.get_position "matplotlib.axes.Axes.get_position") for further details.
See also
[`matplotlib.axes.Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect")
For a description of aspect ratio handling.
[`matplotlib.axes.Axes.set_adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable")
Set how the Axes adjusts to achieve the required aspect ratio.
[`matplotlib.axes.Axes.set_anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor")
Set the position in case of extra space.
#### Notes
This is called automatically when each Axes is drawn. You may need to call it yourself if you need to update the Axes position and/or view limits before the Figure is drawn.
auto\_scale\_xyz(*X*, *Y*, *Z=None*, *had\_data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L571-L583)
autoscale(*enable=True*, *axis='both'*, *tight=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L536-L569)
Convenience method for simple axis view autoscaling.
See [`Axes.autoscale`](matplotlib.axes.axes.autoscale#matplotlib.axes.Axes.autoscale "matplotlib.axes.Axes.autoscale") for full documentation. Because this function applies to 3D Axes, *axis* can also be set to 'z', and setting *axis* to 'both' autoscales all three axes.
autoscale\_view(*tight=None*, *scalex=True*, *scaley=True*, *scalez=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L585-L645)
Autoscale the view limits using the data limits.
See [`Axes.autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") for full documentation. Because this function applies to 3D Axes, it also takes a *scalez* argument.
bar(*left*, *height*, *zs=0*, *zdir='z'*, *\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2192-L2244)
Add 2D bar(s).
Parameters:
**left**1D array-like
The x coordinates of the left sides of the bars.
**height**1D array-like
The height of the bars.
**zs**float or 1D array-like
Z coordinate of bars; if a single value is specified, it will be used for all bars.
**zdir**{'x', 'y', 'z'}, default: 'z'
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.bar`](matplotlib.axes.axes.bar#matplotlib.axes.Axes.bar "matplotlib.axes.Axes.bar").
Returns:
mpl\_toolkits.mplot3d.art3d.Patch3DCollection
bar3d(*x*, *y*, *z*, *dx*, *dy*, *dz*, *color=None*, *zsort='average'*, *shade=True*, *lightsource=None*, *\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2246-L2410)
Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
Parameters:
**x, y, z**array-like
The coordinates of the anchor point of the bars.
**dx, dy, dz**float or array-like
The width, depth, and height of the bars, respectively.
**color**sequence of colors, optional
The color of the bars can be specified globally or individually. This parameter can be:
* A single color, to color all bars the same color.
* An array of colors of length N bars, to color each bar independently.
* An array of colors of length 6, to color the faces of the bars similarly.
* An array of colors of length 6 \* N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
1. -Z (bottom of box)
2. +Z (top of box)
3. -Y
4. +Y
5. -X
6. +X
**zsort**str, optional
The z-axis sorting scheme passed onto [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection")
**shade**bool, default: True
When true, this shades the dark sides of the bars (relative to the plot's source of light).
**lightsource**[`LightSource`](matplotlib.colors.lightsource#matplotlib.colors.LightSource "matplotlib.colors.LightSource")
The lightsource to use when *shade* is True.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Any additional keyword arguments are passed onto [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection").
Returns:
**collection**[`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection")
A collection of three dimensional polygons representing the bars.
can\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L937-L943)
Return whether this Axes supports the pan/zoom button functionality.
Axes3d objects do not use the pan/zoom button.
can\_zoom()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L929-L935)
Return whether this Axes supports the zoom box button functionality.
Axes3D objects do not use the zoom box button.
clabel(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L732-L734)
Currently not implemented for 3D axes, and returns *None*.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L964-L971)
Clear the Axes.
contour(*X*, *Y*, *Z*, *\*args*, *extend3d=False*, *stride=5*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1897-L1933)
Create a 3D contour plot.
Parameters:
**X, Y, Z**array-like,
Input data. See [`Axes.contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") for supported data shapes.
**extend3d**bool, default: False
Whether to extend contour in 3D.
**stride**int
Step size for extending contour.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
Returns:
matplotlib.contour.QuadContourSet
contour3D(*X*, *Y*, *Z*, *\*args*, *extend3d=False*, *stride=5*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1897-L1933)
Create a 3D contour plot.
Parameters:
**X, Y, Z**array-like,
Input data. See [`Axes.contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") for supported data shapes.
**extend3d**bool, default: False
Whether to extend contour in 3D.
**stride**int
Step size for extending contour.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
Returns:
matplotlib.contour.QuadContourSet
contourf(*X*, *Y*, *Z*, *\*args*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2000-L2030)
Create a 3D filled contour plot.
Parameters:
**X, Y, Z**array-like
Input data. See [`Axes.contourf`](matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") for supported data shapes.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.contourf`](matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf").
Returns:
matplotlib.contour.QuadContourSet
contourf3D(*X*, *Y*, *Z*, *\*args*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2000-L2030)
Create a 3D filled contour plot.
Parameters:
**X, Y, Z**array-like
Input data. See [`Axes.contourf`](matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") for supported data shapes.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.contourf`](matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf").
Returns:
matplotlib.contour.QuadContourSet
convert\_zunits(*z*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L196-L201)
For artists in an Axes, if the zaxis has units support, convert *z* using zaxis unit type
disable\_mouse\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L925-L927)
Disable mouse buttons for 3D rotation and zooming.
*property*dist[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L408-L462)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
errorbar(*x*, *y*, *z*, *zerr=None*, *yerr=None*, *xerr=None*, *fmt=''*, *barsabove=False*, *errorevery=1*, *ecolor=None*, *elinewidth=None*, *capsize=None*, *capthick=None*, *xlolims=False*, *xuplims=False*, *ylolims=False*, *yuplims=False*, *zlolims=False*, *zuplims=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2788-L3110)
Plot lines and/or markers with errorbars around them.
*x*/*y*/*z* define the data locations, and *xerr*/*yerr*/*zerr* define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt='none' to draw errorbars only.
Parameters:
**x, y, z**float or array-like
The data positions.
**xerr, yerr, zerr**float or array-like, shape (N,) or (2, N), optional
The errorbar sizes:
* scalar: Symmetric +/- values for all data points.
* shape(N,): Symmetric +/-values for each data point.
* shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.
* *None*: No errorbar.
Note that all error arrays should have *positive* values.
**fmt**str, default: ''
The format for the data points / data lines. See [`plot`](#mpl_toolkits.mplot3d.axes3d.Axes3D.plot "mpl_toolkits.mplot3d.axes3d.Axes3D.plot") for details.
Use 'none' (case insensitive) to plot errorbars without any data markers.
**ecolor**color, default: None
The color of the errorbar lines. If None, use the color of the line connecting the markers.
**elinewidth**float, default: None
The linewidth of the errorbar lines. If None, the linewidth of the current style is used.
**capsize**float, default: `[rcParams["errorbar.capsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=errorbar.capsize#matplotlibrc-sample)` (default: `0.0`)
The length of the error bar caps in points.
**capthick**float, default: None
An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if *mew* or *markeredgewidth* are given, then they will over-ride *capthick*. This may change in future releases.
**barsabove**bool, default: False
If True, will plot the errorbars above the plot symbols. Default is below.
**xlolims, ylolims, zlolims**bool, default: False
These arguments can be used to indicate that a value gives only lower limits. In that case a caret symbol is used to indicate this. *lims*-arguments may be scalars, or array-likes of the same length as the errors. To use limits with inverted axes, [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") or [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") must be called before [`errorbar`](#mpl_toolkits.mplot3d.axes3d.Axes3D.errorbar "mpl_toolkits.mplot3d.axes3d.Axes3D.errorbar"). Note the tricky parameter names: setting e.g. *ylolims* to True means that the y-value is a *lower* limit of the True value, so, only an *upward*-pointing arrow will be drawn!
**xuplims, yuplims, zuplims**bool, default: False
Same as above, but for controlling the upper limits.
**errorevery**int or (int, int), default: 1
draws error bars on a subset of the data. *errorevery* =N draws error bars on the points (x[::N], y[::N], z[::N]). *errorevery* =(start, N) draws error bars on the points (x[start::N], y[start::N], z[start::N]). e.g. errorevery=(6, 3) adds error bars to the data at (x[6], x[9], x[12], x[15], ...). Used to avoid overlapping error bars when two series share x-axis values.
Returns:
**errlines**list
List of [`Line3DCollection`](mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection "mpl_toolkits.mplot3d.art3d.Line3DCollection") instances each containing an errorbar line.
**caplines**list
List of [`Line3D`](mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D "mpl_toolkits.mplot3d.art3d.Line3D") instances each containing a capline object.
**limmarks**list
List of [`Line3D`](mpl_toolkits.mplot3d.art3d.line3d#mpl_toolkits.mplot3d.art3d.Line3D "mpl_toolkits.mplot3d.art3d.Line3D") instances each containing a marker with an upper or lower limit.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *z*, *xerr*, *yerr*, *zerr*
**\*\*kwargs**
All other keyword arguments for styling errorbar lines are passed [`Line3DCollection`](mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection "mpl_toolkits.mplot3d.art3d.Line3DCollection").
#### Examples
([Source code](https://matplotlib.org/stable/gallery/mplot3d/errorbar3d.py), [png](https://matplotlib.org/stable/gallery/mplot3d/errorbar3d.png))
format\_coord(*xd*, *yd*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1013-L1051)
Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
format\_zdata(*z*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1000-L1011)
Return *z* string formatted. This function will use the `fmt_zdata` attribute if it is callable, else will fall back on the zaxis major formatter
get\_autoscalez\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return whether the zaxis is autoscaled.
get\_axis\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L464-L470)
get\_frame\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1146-L1148)
Get whether the 3D axes panels are drawn.
get\_proj()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L838-L905)
Create the projection matrix from the current viewing position.
get\_tightbbox(*renderer=None*, *call\_axes\_locator=True*, *bbox\_extra\_artists=None*, *\**, *for\_layout\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L3112-L3126)
Return the tight bounding box of the Axes, including axis and their decorators (xlabel, title, etc).
Artists that have `artist.set_in_layout(False)` are not included in the bbox.
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
**bbox\_extra\_artists**list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or `None`
List of artists to include in the tight bounding box. If `None` (default), then all artist children of the Axes are included in the tight bounding box.
**call\_axes\_locator**bool, default: True
If *call\_axes\_locator* is `False`, it does not call the `_axes_locator` attribute, which is necessary to get the correct bounding box. `call_axes_locator=False` can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox.
**for\_layout\_only**default: False
The bounding box will *not* include the x-extent of the title and the xlabel, or the y-extent of the ylabel.
Returns:
[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
Bounding box in figure pixel coordinates.
See also
[`matplotlib.axes.Axes.get_window_extent`](matplotlib.axes.axes.get_window_extent#matplotlib.axes.Axes.get_window_extent "matplotlib.axes.Axes.get_window_extent")
[`matplotlib.axis.Axis.get_tightbbox`](matplotlib.axis.axis.get_tightbbox#matplotlib.axis.Axis.get_tightbbox "matplotlib.axis.Axis.get_tightbbox")
[`matplotlib.spines.Spine.get_window_extent`](../spines_api#matplotlib.spines.Spine.get_window_extent "matplotlib.spines.Spine.get_window_extent")
get\_w\_lims()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L647-L652)
Get 3D world limits.
get\_xlim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L679-L681)
Return the x-axis view limits.
Returns:
**left, right**(float, float)
The current x-axis limits in data coordinates.
See also
[`Axes.set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim")
`set_xbound`, `get_xbound`
`invert_xaxis`, `xaxis_inverted`
#### Notes
The x-axis may be inverted, in which case the *left* value will be greater than the *right* value.
get\_xlim3d()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L679-L681)
Alias for [`get_xlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim "mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim").
get\_ylim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L683-L685)
Return the y-axis view limits.
Returns:
**bottom, top**(float, float)
The current y-axis limits in data coordinates.
See also
[`Axes.set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim")
`set_ybound`, `get_ybound`
`invert_yaxis`, `yaxis_inverted`
#### Notes
The y-axis may be inverted, in which case the *bottom* value will be greater than the *top* value.
get\_ylim3d()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L683-L685)
Alias for [`get_ylim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim "mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim").
get\_zaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L221-L223)
Return the `ZAxis` ([`Axis`](mpl_toolkits.mplot3d.axis3d.axis#mpl_toolkits.mplot3d.axis3d.Axis "mpl_toolkits.mplot3d.axis3d.Axis")) instance.
get\_zbound()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1222-L1230)
Return the lower and upper z-axis bounds, in increasing order.
get\_zgridlines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' grid lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
get\_zlabel()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1137-L1142)
Get the z-label text string.
get\_zlim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L687-L689)
Get 3D z limits.
get\_zlim3d()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L687-L689)
Alias for [`get_zlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_zlim "mpl_toolkits.mplot3d.axes3d.Axes3D.get_zlim").
get\_zmajorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' major tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
get\_zminorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' minor tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
get\_zscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' scale (as a str).
get\_zticklabels(*minor=False*, *which=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Get the zaxis' tick labels.
Parameters:
**minor**bool
Whether to return the minor or the major ticklabels.
**which**None, ('minor', 'major', 'both')
Overrides *minor*.
Selects which ticklabels to return
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
get\_zticklines(*minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' tick lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
get\_zticks(*\**, *minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the zaxis' tick locations in data coordinates.
The locations are not clipped to the current axis limits and hence may contain locations that are not visible in the output.
Parameters:
**minor**bool, default: False
True to return the minor tick directions, False to return the major tick directions.
Returns:
numpy array of tick locations
grid(*visible=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1161-L1176)
Set / unset 3D grid.
Note
Currently, this function does not behave the same as [`axes.Axes.grid`](matplotlib.axes.axes.grid#matplotlib.axes.Axes.grid "matplotlib.axes.Axes.grid"), but it is intended to eventually support that behavior.
invert\_zaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1208-L1213)
Invert the z-axis.
margins(*\*margins*, *x=None*, *y=None*, *z=None*, *tight=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L500-L534)
Set or retrieve autoscaling margins.
See [`Axes.margins`](matplotlib.axes.axes.margins#matplotlib.axes.Axes.margins "matplotlib.axes.Axes.margins") for full documentation. Because this function applies to 3D Axes, it also takes a *z* argument, and returns `(xmargin, ymargin, zmargin)`.
mouse\_init(*rotate\_btn=1*, *zoom\_btn=3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L907-L923)
Set the mouse buttons for 3D rotation and zooming.
Parameters:
**rotate\_btn**int or list of int, default: 1
The mouse button or buttons to use for 3D rotation of the axes.
**zoom\_btn**int or list of int, default: 3
The mouse button or buttons to use to zoom the 3D axes.
name*='3d'*
plot(*xs*, *ys*, *\*args*, *zdir='z'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1265-L1304)
Plot 2D or 3D data.
Parameters:
**xs**1D array-like
x coordinates of vertices.
**ys**1D array-like
y coordinates of vertices.
**zs**float or 1D array-like
z coordinates of vertices; either one for all points or one for each point.
**zdir**{'x', 'y', 'z'}, default: 'z'
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
**\*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
plot3D(*xs*, *ys*, *\*args*, *zdir='z'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1265-L1304)
Plot 2D or 3D data.
Parameters:
**xs**1D array-like
x coordinates of vertices.
**ys**1D array-like
y coordinates of vertices.
**zs**float or 1D array-like
z coordinates of vertices; either one for all points or one for each point.
**zdir**{'x', 'y', 'z'}, default: 'z'
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
**\*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
plot\_surface(*X*, *Y*, *Z*, *\**, *norm=None*, *vmin=None*, *vmax=None*, *lightsource=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1308-L1507)
Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports colormapping by supplying the *cmap* argument.
Note
The *rcount* and *ccount* kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Note
To maximize rendering speed consider setting *rstride* and *cstride* to divisors of the number of rows minus 1 and columns minus 1 respectively. For example, given 51 rows rstride can be any of the divisors of 50.
Similarly, a setting of *rstride* and *cstride* equal to 1 (or *rcount* and *ccount* equal the number of rows and columns) can use the optimized path.
Parameters:
**X, Y, Z**2D arrays
Data values.
**rcount, ccount**int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
**rstride, cstride**int
Downsampling stride in each direction. These arguments are mutually exclusive with *rcount* and *ccount*. If only one of *rstride* or *cstride* is set, the other defaults to 10.
'classic' mode uses a default of `rstride = cstride = 10` instead of the new default of `rcount = ccount = 50`.
**color**color-like
Color of the surface patches.
**cmap**Colormap
Colormap of the surface patches.
**facecolors**array-like of colors.
Colors of each individual patch.
**norm**Normalize
Normalization for the colormap.
**vmin, vmax**float
Bounds for the normalization.
**shade**bool, default: True
Whether to shade the facecolors. Shading is always disabled when *cmap* is specified.
**lightsource**[`LightSource`](matplotlib.colors.lightsource#matplotlib.colors.LightSource "matplotlib.colors.LightSource")
The lightsource to use when *shade* is True.
**\*\*kwargs**
Other arguments are forwarded to [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection").
plot\_trisurf(*\*args*, *color=None*, *norm=None*, *vmin=None*, *vmax=None*, *lightsource=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1706-L1805)
Plot a triangulated surface.
The (optional) triangulation can be specified in one of two ways; either:
```
plot_trisurf(triangulation, ...)
```
where triangulation is a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object, or:
```
plot_trisurf(X, Y, ...)
plot_trisurf(X, Y, triangles, ...)
plot_trisurf(X, Y, triangles=triangles, ...)
```
in which case a Triangulation object will be created. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for a explanation of these possibilities.
The remaining arguments are:
```
plot_trisurf(..., Z)
```
where *Z* is the array of values to contour, one per point in the triangulation.
Parameters:
**X, Y, Z**array-like
Data values as 1D arrays.
**color**
Color of the surface patches.
**cmap**
A colormap for the surface patches.
**norm**Normalize
An instance of Normalize to map values to colors.
**vmin, vmax**float, default: None
Minimum and maximum value to map.
**shade**bool, default: True
Whether to shade the facecolors. Shading is always disabled when *cmap* is specified.
**lightsource**[`LightSource`](matplotlib.colors.lightsource#matplotlib.colors.LightSource "matplotlib.colors.LightSource")
The lightsource to use when *shade* is True.
**\*\*kwargs**
All other arguments are passed on to [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection")
#### Examples
([Source code](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d.py), [png](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d.png))
([Source code](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d_2.py), [png](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d_2.png))
plot\_wireframe(*X*, *Y*, *Z*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1588-L1704)
Plot a 3D wireframe.
Note
The *rcount* and *ccount* kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
Parameters:
**X, Y, Z**2D arrays
Data values.
**rcount, ccount**int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
**rstride, cstride**int
Downsampling stride in each direction. These arguments are mutually exclusive with *rcount* and *ccount*. If only one of *rstride* or *cstride* is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
'classic' mode uses a default of `rstride = cstride = 1` instead of the new default of `rcount = ccount = 50`.
**\*\*kwargs**
Other arguments are forwarded to [`Line3DCollection`](mpl_toolkits.mplot3d.art3d.line3dcollection#mpl_toolkits.mplot3d.art3d.Line3DCollection "mpl_toolkits.mplot3d.art3d.Line3DCollection").
quiver(*X*, *Y*, *Z*, *U*, *V*, *W*, */*, *length=1*, *arrow\_length\_ratio=.3*, *pivot='tail'*, *normalize=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2419-L2568)
Plot a 3D field of arrows.
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Parameters:
**X, Y, Z**array-like
The x, y and z coordinates of the arrow locations (default is tail of arrow; see *pivot* kwarg).
**U, V, W**array-like
The x, y and z components of the arrow vectors.
**length**float, default: 1
The length of each quiver.
**arrow\_length\_ratio**float, default: 0.3
The ratio of the arrow head with respect to the quiver.
**pivot**{'tail', 'middle', 'tip'}, default: 'tail'
The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name *pivot*.
**normalize**bool, default: False
Whether all arrows are normalized to have the same length, or keep the lengths defined by *u*, *v*, and *w*.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Any additional keyword arguments are delegated to [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
quiver3D(*X*, *Y*, *Z*, *U*, *V*, *W*, */*, *length=1*, *arrow\_length\_ratio=.3*, *pivot='tail'*, *normalize=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2419-L2568)
Plot a 3D field of arrows.
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Parameters:
**X, Y, Z**array-like
The x, y and z coordinates of the arrow locations (default is tail of arrow; see *pivot* kwarg).
**U, V, W**array-like
The x, y and z components of the arrow vectors.
**length**float, default: 1
The length of each quiver.
**arrow\_length\_ratio**float, default: 0.3
The ratio of the arrow head with respect to the quiver.
**pivot**{'tail', 'middle', 'tip'}, default: 'tail'
The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name *pivot*.
**normalize**bool, default: False
Whether all arrows are normalized to have the same length, or keep the lengths defined by *u*, *v*, and *w*.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Any additional keyword arguments are delegated to [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
scatter(*xs*, *ys*, *zs=0*, *zdir='z'*, *s=20*, *c=None*, *depthshade=True*, *\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2116-L2188)
Create a scatter plot.
Parameters:
**xs, ys**array-like
The data positions.
**zs**float or array-like, default: 0
The z-positions. Either an array of the same length as *xs* and *ys* or a single value to place all points in the same plane.
**zdir**{'x', 'y', 'z', '-x', '-y', '-z'}, default: 'z'
The axis direction for the *zs*. This is useful when plotting 2D data on a 3D Axes. The data must be passed as *xs*, *ys*. Setting *zdir* to 'y' then plots the data to the x-z-plane.
See also [Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html).
**s**float or array-like, default: 20
The marker size in points\*\*2. Either an array of the same length as *xs* and *ys* or a single value to make all markers the same size.
**c**color, sequence, or sequence of colors, optional
The marker color. Possible values:
* A single color format string.
* A sequence of colors of length n.
* A sequence of n numbers to be mapped to colors using *cmap* and *norm*.
* A 2D array in which the rows are RGB or RGBA.
For more details see the *c* argument of [`scatter`](matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
**depthshade**bool, default: True
Whether to shade the scatter markers to give the appearance of depth. Each call to `scatter()` will perform its depthshading independently.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*xs*, *ys*, *zs*, *s*, *edgecolors*, *c*, *facecolor*, *facecolors*, *color*
**\*\*kwargs**
All other arguments are passed on to [`scatter`](matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
Returns:
**paths**[`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")
scatter3D(*xs*, *ys*, *zs=0*, *zdir='z'*, *s=20*, *c=None*, *depthshade=True*, *\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2116-L2188)
Create a scatter plot.
Parameters:
**xs, ys**array-like
The data positions.
**zs**float or array-like, default: 0
The z-positions. Either an array of the same length as *xs* and *ys* or a single value to place all points in the same plane.
**zdir**{'x', 'y', 'z', '-x', '-y', '-z'}, default: 'z'
The axis direction for the *zs*. This is useful when plotting 2D data on a 3D Axes. The data must be passed as *xs*, *ys*. Setting *zdir* to 'y' then plots the data to the x-z-plane.
See also [Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html).
**s**float or array-like, default: 20
The marker size in points\*\*2. Either an array of the same length as *xs* and *ys* or a single value to make all markers the same size.
**c**color, sequence, or sequence of colors, optional
The marker color. Possible values:
* A single color format string.
* A sequence of colors of length n.
* A sequence of n numbers to be mapped to colors using *cmap* and *norm*.
* A 2D array in which the rows are RGB or RGBA.
For more details see the *c* argument of [`scatter`](matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
**depthshade**bool, default: True
Whether to shade the scatter markers to give the appearance of depth. Each call to `scatter()` will perform its depthshading independently.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*xs*, *ys*, *zs*, *s*, *edgecolors*, *c*, *facecolor*, *facecolors*, *color*
**\*\*kwargs**
All other arguments are passed on to [`scatter`](matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
Returns:
**paths**[`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *autoscalez\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *proj\_type=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xlim3d=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ylim3d=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zbound=<UNSET>*, *zlabel=<UNSET>*, *zlim=<UNSET>*, *zlim3d=<UNSET>*, *zmargin=<UNSET>*, *zorder=<UNSET>*, *zscale=<UNSET>*, *zticklabels=<UNSET>*, *zticks=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect "mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect") | {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'} |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`autoscalez_on`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscalez_on "mpl_toolkits.mplot3d.axes3d.Axes3D.set_autoscalez_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect "mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect") | 3-tuple of floats or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_frame_on "mpl_toolkits.mplot3d.axes3d.Axes3D.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`proj_type`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type "mpl_toolkits.mplot3d.axes3d.Axes3D.set_proj_type") | {'persp', 'ortho'} |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xlim3d`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_xscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ylim3d`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_yscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zbound`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zbound "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zbound") | unknown |
| [`zlabel`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlabel "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlabel") | unknown |
| [`zlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim") | unknown |
| [`zlim3d`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim") | unknown |
| [`zmargin`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zmargin") | float greater than -0.5 |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| [`zscale`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale") | unknown |
| [`zticklabels`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticklabels "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticklabels") | unknown |
| [`zticks`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks") | unknown |
set\_aspect(*aspect*, *adjustable=None*, *anchor=None*, *share=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L271-L350)
Set the aspect ratios.
Parameters:
**aspect**{'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'}
Possible values:
| value | description |
| --- | --- |
| 'auto' | automatic; fill the position rectangle with data. |
| 'equal' | adapt all the axes to have equal aspect ratios. |
| 'equalxy' | adapt the x and y axes to have equal aspect ratios. |
| 'equalxz' | adapt the x and z axes to have equal aspect ratios. |
| 'equalyz' | adapt the y and z axes to have equal aspect ratios. |
**adjustable**None
Currently ignored by Axes3D
If not *None*, this defines which parameter will be adjusted to meet the required aspect. See [`set_adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") for further details.
**anchor**None or str or 2-tuple of float, optional
If not *None*, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to to specify the anchor are abbreviations of cardinal directions:
| value | description |
| --- | --- |
| 'C' | centered |
| 'SW' | lower left corner |
| 'S' | middle of bottom edge |
| 'SE' | lower right corner |
| etc. | |
See [`set_anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") for further details.
**share**bool, default: False
If `True`, apply the settings to all shared Axes.
See also
[`mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect "mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect")
set\_autoscalez\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set whether the zaxis is autoscaled when drawing or by [`Axes.autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view").
Parameters:
**b**bool
set\_axis\_off()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L188-L190)
Turn the x- and y-axis off.
This affects the axis lines, ticks, ticklabels, grid and axis labels.
set\_axis\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L192-L194)
Turn the x- and y-axis on.
This affects the axis lines, ticks, ticklabels, grid and axis labels.
set\_box\_aspect(*aspect*, *\**, *zoom=1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L352-L389)
Set the Axes box aspect.
The box aspect is the ratio of height to width in display units for each face of the box when viewed perpendicular to that face. This is not to be confused with the data aspect (which for Axes3D is always 'auto'). The default ratios are 4:4:3 (x:y:z).
To simulate having equal aspect in data space, set the box aspect to match your data range in each dimension.
*zoom* controls the overall size of the Axes3D in the figure.
Parameters:
**aspect**3-tuple of floats or None
Changes the physical dimensions of the Axes3D, such that the ratio of the axis lengths in display units is x:y:z. If None, defaults to (4,4,3).
**zoom**float, default: 1
Control overall size of the Axes3D in the figure. Must be > 0.
set\_frame\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1150-L1159)
Set whether the 3D axes panels are drawn.
Parameters:
**b**bool
set\_proj\_type(*proj\_type*, *focal\_length=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L806-L832)
Set the projection type.
Parameters:
**proj\_type**{'persp', 'ortho'}
The projection type.
**focal\_length**float, default: None
For a projection type of 'persp', the focal length of the virtual camera. Must be > 0. If None, defaults to 1. The focal length can be computed from a desired Field Of View via the equation: focal\_length = 1/tan(FOV/2)
set\_title(*label*, *fontdict=None*, *loc='center'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2412-L2417)
Set a title for the Axes.
Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.
Parameters:
**label**str
Text to use for the title
**fontdict**dict
A dictionary controlling the appearance of the title text, the default *fontdict* is:
```
{'fontsize': rcParams['axes.titlesize'],
'fontweight': rcParams['axes.titleweight'],
'color': rcParams['axes.titlecolor'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}
```
**loc**{'center', 'left', 'right'}, default: `[rcParams["axes.titlelocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titlelocation#matplotlibrc-sample)` (default: `'center'`)
Which title to set.
**y**float, default: `[rcParams["axes.titley"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titley#matplotlibrc-sample)` (default: `None`)
Vertical Axes location for the title (1.0 is the top). If None (the default) and `[rcParams["axes.titley"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titley#matplotlibrc-sample)` (default: `None`) is also None, y is determined automatically to avoid decorators on the Axes.
**pad**float, default: `[rcParams["axes.titlepad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titlepad#matplotlibrc-sample)` (default: `6.0`)
The offset of the title from the top of the Axes, in points.
Returns:
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The matplotlib text instance representing the title
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties
Other keyword arguments are text properties, see [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") for a list of valid text properties.
set\_top\_view()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L203-L213)
set\_xlim3d(*left=None*, *right=None*, *\**, *emit=True*, *auto=False*, *xmin=None*, *xmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3615-L3692)
Set the x-axis view limits.
Parameters:
**left**float, optional
The left xlim in data coordinates. Passing *None* leaves the limit unchanged.
The left and right xlims may also be passed as the tuple (*left*, *right*) as the first positional argument (or as the *left* keyword argument).
**right**float, optional
The right xlim in data coordinates. Passing *None* leaves the limit unchanged.
**emit**bool, default: True
Whether to notify observers of limit change.
**auto**bool or None, default: False
Whether to turn on autoscaling of the x-axis. True turns on, False turns off, None leaves unchanged.
**xmin, xmax**float, optional
They are equivalent to left and right respectively, and it is an error to pass both *xmin* and *left* or *xmax* and *right*.
Returns:
**left, right**(float, float)
The new x-axis limits in data coordinates.
See also
[`get_xlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim "mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim")
`set_xbound`, `get_xbound`
`invert_xaxis`, `xaxis_inverted`
#### Notes
The *left* value may be greater than the *right* value, in which case the x-axis values will decrease from left to right.
#### Examples
```
>>> set_xlim(left, right)
>>> set_xlim((left, right))
>>> left, right = set_xlim(left, right)
```
One limit may be left unchanged.
```
>>> set_xlim(right=right_lim)
```
Limits may be passed in reverse order to flip the direction of the x-axis. For example, suppose *x* represents the number of years before present. The x-axis limits might be set like the following so 5000 years ago is on the left of the plot and the present is on the right.
```
>>> set_xlim(5000, 0)
```
set\_xscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the x-axis scale.
Parameters:
**value**{"linear"}
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
**\*\*kwargs**
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
set\_ylim3d(*bottom=None*, *top=None*, *\**, *emit=True*, *auto=False*, *ymin=None*, *ymax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3847-L3924)
Set the y-axis view limits.
Parameters:
**bottom**float, optional
The bottom ylim in data coordinates. Passing *None* leaves the limit unchanged.
The bottom and top ylims may also be passed as the tuple (*bottom*, *top*) as the first positional argument (or as the *bottom* keyword argument).
**top**float, optional
The top ylim in data coordinates. Passing *None* leaves the limit unchanged.
**emit**bool, default: True
Whether to notify observers of limit change.
**auto**bool or None, default: False
Whether to turn on autoscaling of the y-axis. *True* turns on, *False* turns off, *None* leaves unchanged.
**ymin, ymax**float, optional
They are equivalent to bottom and top respectively, and it is an error to pass both *ymin* and *bottom* or *ymax* and *top*.
Returns:
**bottom, top**(float, float)
The new y-axis limits in data coordinates.
See also
[`get_ylim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim "mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim")
`set_ybound`, `get_ybound`
`invert_yaxis`, `yaxis_inverted`
#### Notes
The *bottom* value may be greater than the *top* value, in which case the y-axis values will decrease from *bottom* to *top*.
#### Examples
```
>>> set_ylim(bottom, top)
>>> set_ylim((bottom, top))
>>> bottom, top = set_ylim(bottom, top)
```
One limit may be left unchanged.
```
>>> set_ylim(top=top_lim)
```
Limits may be passed in reverse order to flip the direction of the y-axis. For example, suppose `y` represents depth of the ocean in m. The y-axis limits might be set like the following so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top.
```
>>> set_ylim(5000, 0)
```
set\_yscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the y-axis scale.
Parameters:
**value**{"linear"}
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
**\*\*kwargs**
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
set\_zbound(*lower=None*, *upper=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1232-L1250)
Set the lower and upper numerical bounds of the z-axis.
This method will honor axes inversion regardless of parameter order. It will not change the autoscaling setting ([`get_autoscalez_on()`](#mpl_toolkits.mplot3d.axes3d.Axes3D.get_autoscalez_on "mpl_toolkits.mplot3d.axes3d.Axes3D.get_autoscalez_on")).
set\_zlabel(*zlabel*, *fontdict=None*, *labelpad=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1129-L1135)
Set zlabel. See doc for [`set_ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") for description.
set\_zlim(*bottom=None*, *top=None*, *\**, *emit=True*, *auto=False*, *zmin=None*, *zmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L655-L673)
Set 3D z limits.
See [`Axes.set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") for full documentation
set\_zlim3d(*bottom=None*, *top=None*, *\**, *emit=True*, *auto=False*, *zmin=None*, *zmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L655-L673)
Alias for [`set_zlim`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim").
set\_zmargin(*m*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L478-L498)
Set padding of Z data limits prior to autoscaling.
*m* times the data interval will be added to each end of that interval before it is used in autoscaling. If *m* is negative, this will clip the data range instead of expanding it.
For example, if your data is in the range [0, 2], a margin of 0.1 will result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range of [0.2, 1.8].
Parameters:
**m**float greater than -0.5
set\_zscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the z-axis scale.
Parameters:
**value**{"linear"}
The axis scale type to apply. 3D axes currently only support linear scales; other scales yield nonsensical results.
**\*\*kwargs**
Keyword arguments are nominally forwarded to the scale class, but none of them is applicable for linear scales.
set\_zticklabels(*labels*, *\**, *fontdict=None*, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the zaxis' labels with list of string labels.
Warning
This method should only be used after fixing the tick positions using [`Axes3D.set_zticks`](#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks "mpl_toolkits.mplot3d.axes3d.Axes3D.set_zticks"). Otherwise, the labels may end up in unexpected positions.
Parameters:
**labels**list of str
The label texts.
**fontdict**dict, optional
A dictionary controlling the appearance of the ticklabels. The default *fontdict* is:
```
{'fontsize': rcParams['axes.titlesize'],
'fontweight': rcParams['axes.titleweight'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}
```
**minor**bool, default: False
Whether to set the minor ticklabels rather than the major ones.
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The labels.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
set\_zticks(*ticks*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the zaxis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
Parameters:
**ticks**list of floats
List of tick locations. The axis [`Locator`](../ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") is replaced by a [`FixedLocator`](../ticker_api#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator").
Some tick formatters will not label arbitrary tick positions; e.g. log formatters only label decade ticks by default. In such a case you can set a formatter explicitly on the axis using [`Axis.set_major_formatter`](matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") or provide formatted *labels* yourself.
**labels**list of str, optional
List of tick labels. If not set, the labels are generated with the axis tick [`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter").
**minor**bool, default: False
If `False`, set the major ticks; if `True`, the minor ticks.
**\*\*kwargs**
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels. These take effect only if you pass *labels*. In other cases, please use [`tick_params`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
#### Notes
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
sharez(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L945-L962)
Share the z-axis with *other*.
This is equivalent to passing `sharex=other` when constructing the Axes, and cannot be used if the z-axis is already being shared with another Axes.
stem(*x*, *y*, *z*, *\**, *linefmt='C0-'*, *markerfmt='C0o'*, *basefmt='C3-'*, *bottom=0*, *label=None*, *orientation='z'*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L3128-L3243)
Create a 3D stem plot.
A stem plot draws lines perpendicular to a baseline, and places markers at the heads. By default, the baseline is defined by *x* and *y*, and stems are drawn vertically from *bottom* to *z*.
Parameters:
**x, y, z**array-like
The positions of the heads of the stems. The stems are drawn along the *orientation*-direction from the baseline at *bottom* (in the *orientation*-coordinate) to the heads. By default, the *x* and *y* positions are used for the baseline and *z* for the head position, but this can be changed by *orientation*.
**linefmt**str, default: 'C0-'
A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle:
| Character | Line Style |
| --- | --- |
| `'-'` | solid line |
| `'--'` | dashed line |
| `'-.'` | dash-dot line |
| `':'` | dotted line |
Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. 'rx' or '-.'), this is beyond the intention of the method and will most likely not result in a reasonable plot.
**markerfmt**str, default: 'C0o'
A string defining the properties of the markers at the stem heads.
**basefmt**str, default: 'C3-'
A format string defining the properties of the baseline.
**bottom**float, default: 0
The position of the baseline, in *orientation*-coordinates.
**label**str, default: None
The label to use for the stems in legends.
**orientation**{'x', 'y', 'z'}, default: 'z'
The direction along which stems are drawn.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
Returns:
[`StemContainer`](../container_api#matplotlib.container.StemContainer "matplotlib.container.StemContainer")
The container may be treated like a tuple (*markerline*, *stemlines*, *baseline*)
#### Examples
([Source code](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.py), [png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_00_00.png))
([png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_01_00.png))
([png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_02_00.png))
stem3D(*x*, *y*, *z*, *\**, *linefmt='C0-'*, *markerfmt='C0o'*, *basefmt='C3-'*, *bottom=0*, *label=None*, *orientation='z'*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L3128-L3243)
Create a 3D stem plot.
A stem plot draws lines perpendicular to a baseline, and places markers at the heads. By default, the baseline is defined by *x* and *y*, and stems are drawn vertically from *bottom* to *z*.
Parameters:
**x, y, z**array-like
The positions of the heads of the stems. The stems are drawn along the *orientation*-direction from the baseline at *bottom* (in the *orientation*-coordinate) to the heads. By default, the *x* and *y* positions are used for the baseline and *z* for the head position, but this can be changed by *orientation*.
**linefmt**str, default: 'C0-'
A string defining the properties of the vertical lines. Usually, this will be a color or a color and a linestyle:
| Character | Line Style |
| --- | --- |
| `'-'` | solid line |
| `'--'` | dashed line |
| `'-.'` | dash-dot line |
| `':'` | dotted line |
Note: While it is technically possible to specify valid formats other than color or color and linestyle (e.g. 'rx' or '-.'), this is beyond the intention of the method and will most likely not result in a reasonable plot.
**markerfmt**str, default: 'C0o'
A string defining the properties of the markers at the stem heads.
**basefmt**str, default: 'C3-'
A format string defining the properties of the baseline.
**bottom**float, default: 0
The position of the baseline, in *orientation*-coordinates.
**label**str, default: None
The label to use for the stems in legends.
**orientation**{'x', 'y', 'z'}, default: 'z'
The direction along which stems are drawn.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
Returns:
[`StemContainer`](../container_api#matplotlib.container.StemContainer "matplotlib.container.StemContainer")
The container may be treated like a tuple (*markerline*, *stemlines*, *baseline*)
#### Examples
([Source code](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.py), [png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_00_00.png))
([png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_01_00.png))
([png](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo_02_00.png))
text(*x*, *y*, *z*, *s*, *zdir=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1252-L1260)
Add text to the plot. kwargs will be passed on to Axes.text, except for the *zdir* keyword, which sets the direction to be used as the z direction.
text2D(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L615-L681)
Add text to the Axes.
Add the text *s* to the Axes at location *x*, *y* in data coordinates.
Parameters:
**x, y**float
The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the *transform* parameter.
**s**str
The text.
**fontdict**dict, default: None
A dictionary to override the default text properties. If fontdict is None, the defaults are determined by [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams").
Returns:
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The created [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
#### Examples
Individual keyword arguments can be used to override any given parameter:
```
>>> text(x, y, s, fontsize=12)
```
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes:
```
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
... verticalalignment='center', transform=ax.transAxes)
```
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword *bbox*. *bbox* is a dictionary of [`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") properties. For example:
```
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
```
text3D(*x*, *y*, *z*, *s*, *zdir=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1252-L1260)
Add text to the plot. kwargs will be passed on to Axes.text, except for the *zdir* keyword, which sets the direction to be used as the z direction.
tick\_params(*axis='both'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1178-L1204)
Convenience method for changing the appearance of ticks and tick labels.
See [`Axes.tick_params`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params") for full documentation. Because this function applies to 3D Axes, *axis* can also be set to 'z', and setting *axis* to 'both' autoscales all three axes.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the 'z' axis will accept settings as if it was like the 'y' axis.
Note
Axes3D currently ignores some of these settings.
tricontour(*\*args*, *extend3d=False*, *stride=5*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1937-L1988)
Create a 3D contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Parameters:
**X, Y, Z**array-like
Input data. See [`Axes.tricontour`](matplotlib.axes.axes.tricontour#matplotlib.axes.Axes.tricontour "matplotlib.axes.Axes.tricontour") for supported data shapes.
**extend3d**bool, default: False
Whether to extend contour in 3D.
**stride**int
Step size for extending contour.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.tricontour`](matplotlib.axes.axes.tricontour#matplotlib.axes.Axes.tricontour "matplotlib.axes.Axes.tricontour").
Returns:
matplotlib.tri.tricontour.TriContourSet
tricontourf(*\*args*, *zdir='z'*, *offset=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2034-L2081)
Create a 3D filled contour plot.
Note
This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
Parameters:
**X, Y, Z**array-like
Input data. See [`Axes.tricontourf`](matplotlib.axes.axes.tricontourf#matplotlib.axes.Axes.tricontourf "matplotlib.axes.Axes.tricontourf") for supported data shapes.
**zdir**{'x', 'y', 'z'}, default: 'z'
The direction to use.
**offset**float, optional
If specified, plot a projection of the contour lines at this position in a plane normal to zdir.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*args, \*\*kwargs**
Other arguments are forwarded to [`matplotlib.axes.Axes.tricontourf`](matplotlib.axes.axes.tricontourf#matplotlib.axes.Axes.tricontourf "matplotlib.axes.Axes.tricontourf").
Returns:
matplotlib.tri.tricontour.TriContourSet
tunit\_cube(*vals=None*, *M=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L246-L251)
tunit\_edges(*vals=None*, *M=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L253-L269)
unit\_cube(*vals=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L235-L244)
update\_datalim(*xys*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L472-L473)
Extend the `dataLim` Bbox to include the given points.
If no data is set currently, the Bbox will ignore its limits and set the bound to be the bounds of the xydata (*xys*). Otherwise, it will compute the bounds of the union of its current data and the data in *xys*.
Parameters:
**xys**2D array-like
The points to include in the data limits Bbox. This can be either a list of (x, y) tuples or a Nx2 array.
**updatex, updatey**bool, default: True
Whether to update the x/y limits.
view\_init(*elev=None*, *azim=None*, *roll=None*, *vertical\_axis='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L736-L804)
Set the elevation and azimuth of the axes in degrees (not radians).
This can be used to rotate the axes programmatically.
To look normal to the primary planes, the following elevation and azimuth angles can be used. A roll angle of 0, 90, 180, or 270 deg will rotate these views while keeping the axes at right angles.
| view plane | elev | azim |
| --- | --- | --- |
| XY | 90 | -90 |
| XZ | 0 | -90 |
| YZ | 0 | 0 |
| -XY | -90 | 90 |
| -XZ | 0 | 90 |
| -YZ | 0 | 180 |
Parameters:
**elev**float, default: None
The elevation angle in degrees rotates the camera above the plane pierced by the vertical axis, with a positive angle corresponding to a location above that plane. For example, with the default vertical axis of 'z', the elevation defines the angle of the camera location above the x-y plane. If None, then the initial value as specified in the [`Axes3D`](#mpl_toolkits.mplot3d.axes3d.Axes3D "mpl_toolkits.mplot3d.axes3d.Axes3D") constructor is used.
**azim**float, default: None
The azimuthal angle in degrees rotates the camera about the vertical axis, with a positive angle corresponding to a right-handed rotation. For example, with the default vertical axis of 'z', a positive azimuth rotates the camera about the origin from its location along the +x axis towards the +y axis. If None, then the initial value as specified in the [`Axes3D`](#mpl_toolkits.mplot3d.axes3d.Axes3D "mpl_toolkits.mplot3d.axes3d.Axes3D") constructor is used.
**roll**float, default: None
The roll angle in degrees rotates the camera about the viewing axis. A positive angle spins the camera clockwise, causing the scene to rotate counter-clockwise. If None, then the initial value as specified in the [`Axes3D`](#mpl_toolkits.mplot3d.axes3d.Axes3D "mpl_toolkits.mplot3d.axes3d.Axes3D") constructor is used.
**vertical\_axis**{"z", "x", "y"}, default: "z"
The axis to align vertically. *azim* rotates about this axis.
voxels([*x*, *y*, *z*, ]*/*, *filled*, *facecolors=None*, *edgecolors=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L2572-L2786)
Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with `filled[0, 0, 0]` placed with its lower corner at the origin. Occluded faces are not plotted.
Parameters:
**filled**3D np.array of bool
A 3D array of values, with truthy values indicating which voxels to fill
**x, y, z**3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of *filled*. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by [`indices()`](https://numpy.org/doc/stable/reference/generated/numpy.indices.html#numpy.indices "(in NumPy v1.23)"). As indicated by the `/` in the function signature, these arguments can only be passed positionally.
**facecolors, edgecolors**array-like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. These parameters can be:
* A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
* `None`, the default, to use a single color for the faces, and the style default for the edges.
* A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
* A 4D ndarray of rgb/rgba data, with the components along the last axis.
**shade**bool, default: True
Whether to shade the facecolors. Shading is always disabled when *cmap* is specified.
**lightsource**[`LightSource`](matplotlib.colors.lightsource#matplotlib.colors.LightSource "matplotlib.colors.LightSource")
The lightsource to use when *shade* is True.
**\*\*kwargs**
Additional keyword arguments to pass onto [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection").
Returns:
**faces**dict
A dictionary indexed by coordinate, where `faces[i, j, k]` is a [`Poly3DCollection`](mpl_toolkits.mplot3d.art3d.poly3dcollection#mpl_toolkits.mplot3d.art3d.Poly3DCollection "mpl_toolkits.mplot3d.art3d.Poly3DCollection") of the faces drawn for the voxel `filled[i, j, k]`. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then `(i, j, k) not in faces`.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/mplot3d/voxels.py), [png](https://matplotlib.org/stable/gallery/mplot3d/voxels.png))
([Source code](https://matplotlib.org/stable/gallery/mplot3d/voxels_rgb.py), [png](https://matplotlib.org/stable/gallery/mplot3d/voxels_rgb.png))
([Source code](https://matplotlib.org/stable/gallery/mplot3d/voxels_torus.py), [png](https://matplotlib.org/stable/gallery/mplot3d/voxels_torus.png))
([Source code](https://matplotlib.org/stable/gallery/mplot3d/voxels_numpy_logo.py), [png](https://matplotlib.org/stable/gallery/mplot3d/voxels_numpy_logo.png))
*property*w\_xaxis[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*w\_yaxis[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*w\_zaxis[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
zaxis\_date(*tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set up axis ticks and labels to treat data along the zaxis as dates.
Parameters:
**tz**str or [`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
The timezone used to create date labels.
#### Notes
This function is merely provided for completeness, but 3D axes do not support dates for ticks, and so this may not work as expected.
zaxis\_inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/axes3d.py#L1215-L1220)
Returns True if the z-axis is inverted.
| programming_docs |
matplotlib matplotlib.pyplot.polar matplotlib.pyplot.polar
=======================
matplotlib.pyplot.polar(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2171-L2190)
Make a polar plot.
call signature:
```
polar(theta, r, **kwargs)
```
Multiple *theta*, *r* arguments are supported, with format strings, as in [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot").
Examples using `matplotlib.pyplot.polar`
----------------------------------------
[transforms.offset\_copy](https://matplotlib.org/stable/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py)
transforms.offset\_copy
matplotlib matplotlib.axis.YAxis.axis_name matplotlib.axis.YAxis.axis\_name
================================
YAxis.axis\_name*='y'*
Read-only name identifying the axis.
matplotlib matplotlib.pyplot.draw_if_interactive matplotlib.pyplot.draw\_if\_interactive
=======================================
matplotlib.pyplot.draw\_if\_interactive()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L351-L360)
Redraw the current figure if in interactive mode.
Warning
End users will typically not have to call this function because the the interactive mode takes care of this.
matplotlib matplotlib.artist.Artist.get_window_extent matplotlib.artist.Artist.get\_window\_extent
============================================
Artist.get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L302-L320)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
Examples using `matplotlib.artist.Artist.get_window_extent`
-----------------------------------------------------------
[BboxImage Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/demo_bboximage.html#sphx-glr-gallery-images-contours-and-fields-demo-bboximage-py)
BboxImage Demo
matplotlib matplotlib.pyplot.get_figlabels matplotlib.pyplot.get\_figlabels
================================
matplotlib.pyplot.get\_figlabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L843-L847)
Return a list of existing figure labels.
matplotlib mpl_toolkits.mplot3d.art3d.poly_collection_2d_to_3d mpl\_toolkits.mplot3d.art3d.poly\_collection\_2d\_to\_3d
========================================================
mpl\_toolkits.mplot3d.art3d.poly\_collection\_2d\_to\_3d(*col*, *zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L887-L893)
Convert a PolyCollection to a Poly3DCollection object.
matplotlib matplotlib.axes.Axes.have_units matplotlib.axes.Axes.have\_units
================================
Axes.have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
matplotlib mpl_toolkits.mplot3d.art3d.rotate_axes mpl\_toolkits.mplot3d.art3d.rotate\_axes
========================================
mpl\_toolkits.mplot3d.art3d.rotate\_axes(*xs*, *ys*, *zs*, *zdir*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L912-L929)
Reorder coordinates so that the axes are rotated with zdir along the original z axis. Prepending the axis with a '-' does the inverse transform, so zdir can be x, -x, y, -y, z or -z
matplotlib mpl_toolkits.axisartist.angle_helper.LocatorH mpl\_toolkits.axisartist.angle\_helper.LocatorH
===============================================
*class*mpl\_toolkits.axisartist.angle\_helper.LocatorH(*nbins*, *include\_last=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L163-L166)
Bases: [`LocatorBase`](mpl_toolkits.axisartist.angle_helper.locatorbase#mpl_toolkits.axisartist.angle_helper.LocatorBase "mpl_toolkits.axisartist.angle_helper.LocatorBase")
\_\_call\_\_(*v1*, *v2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L164-L166)
Call self as a function.
matplotlib matplotlib.axes.Axes.get_renderer_cache matplotlib.axes.Axes.get\_renderer\_cache
=========================================
Axes.get\_renderer\_cache()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3128-L3130)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use Axes.figure.canvas.get\_renderer() instead.
matplotlib matplotlib.pyplot.quiverkey matplotlib.pyplot.quiverkey
===========================
matplotlib.pyplot.quiverkey(*Q*, *X*, *Y*, *U*, *label*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2767-L2769)
Add a key to a quiver plot.
The positioning of the key depends on *X*, *Y*, *coordinates*, and *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions the head, and if *labelpos* is 'W', *X*, *Y* positions the tail; in either of these two cases, *X*, *Y* is somewhere in the middle of the arrow+label key object.
Parameters:
**Q**[`matplotlib.quiver.Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")
A [`Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver") object as returned by a call to [`quiver()`](matplotlib.axes.axes.quiver#matplotlib.axes.Axes.quiver "matplotlib.axes.Axes.quiver").
**X, Y**float
The location of the key.
**U**float
The length of the key.
**label**str
The key label (e.g., length and units of the key).
**angle**float, default: 0
The angle of the key arrow, in degrees anti-clockwise from the x-axis.
**coordinates**{'axes', 'figure', 'data', 'inches'}, default: 'axes'
Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are normalized coordinate systems with (0, 0) in the lower left and (1, 1) in the upper right; 'data' are the axes data coordinates (used for the locations of the vectors in the quiver plot itself); 'inches' is position in the figure in inches, with (0, 0) at the lower left corner.
**color**color
Overrides face and edge colors from *Q*.
**labelpos**{'N', 'S', 'E', 'W'}
Position the label above, below, to the right, to the left of the arrow, respectively.
**labelsep**float, default: 0.1
Distance in inches between the arrow and the label.
**labelcolor**color, default: `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`)
Label color.
**fontproperties**dict, optional
A dictionary with keyword arguments accepted by the [`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") initializer: *family*, *style*, *variant*, *size*, *weight*.
**\*\*kwargs**
Any additional keyword arguments are used to override vector properties taken from *Q*.
matplotlib mpl_toolkits.axes_grid1.axes_divider mpl\_toolkits.axes\_grid1.axes\_divider
=======================================
Helper classes to adjust the positions of multiple axes at drawing time.
Classes
-------
| | |
| --- | --- |
| [`AxesDivider`](mpl_toolkits.axes_grid1.axes_divider.axesdivider#mpl_toolkits.axes_grid1.axes_divider.AxesDivider "mpl_toolkits.axes_grid1.axes_divider.AxesDivider")(axes[, xref, yref]) | Divider based on the preexisting axes. |
| [`AxesLocator`](mpl_toolkits.axes_grid1.axes_divider.axeslocator#mpl_toolkits.axes_grid1.axes_divider.AxesLocator "mpl_toolkits.axes_grid1.axes_divider.AxesLocator")(axes\_divider, nx, ny[, nx1, ny1]) | A callable object which returns the position and size of a given AxesDivider cell. |
| [`Divider`](mpl_toolkits.axes_grid1.axes_divider.divider#mpl_toolkits.axes_grid1.axes_divider.Divider "mpl_toolkits.axes_grid1.axes_divider.Divider")(fig, pos, horizontal, vertical[, ...]) | An Axes positioning class. |
| [`HBoxDivider`](mpl_toolkits.axes_grid1.axes_divider.hboxdivider#mpl_toolkits.axes_grid1.axes_divider.HBoxDivider "mpl_toolkits.axes_grid1.axes_divider.HBoxDivider")(fig, \*args[, horizontal, ...]) | A [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider") for laying out axes horizontally, while ensuring that they have equal heights. |
| [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider")(fig, \*args[, horizontal, ...]) | The Divider class whose rectangle area is specified as a subplot geometry. |
| [`VBoxDivider`](mpl_toolkits.axes_grid1.axes_divider.vboxdivider#mpl_toolkits.axes_grid1.axes_divider.VBoxDivider "mpl_toolkits.axes_grid1.axes_divider.VBoxDivider")(fig, \*args[, horizontal, ...]) | A [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider") for laying out axes vertically, while ensuring that they have equal widths. |
Functions
---------
| | |
| --- | --- |
| [`make_axes_area_auto_adjustable`](mpl_toolkits.axes_grid1.axes_divider.make_axes_area_auto_adjustable#mpl_toolkits.axes_grid1.axes_divider.make_axes_area_auto_adjustable "mpl_toolkits.axes_grid1.axes_divider.make_axes_area_auto_adjustable")(ax[, ...]) | Add auto-adjustable padding around *ax* to take its decorations (title, labels, ticks, ticklabels) into account during layout, using [`Divider.add_auto_adjustable_area`](mpl_toolkits.axes_grid1.axes_divider.divider#mpl_toolkits.axes_grid1.axes_divider.Divider.add_auto_adjustable_area "mpl_toolkits.axes_grid1.axes_divider.Divider.add_auto_adjustable_area"). |
| [`make_axes_locatable`](mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable#mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable "mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable")(axes) | |
matplotlib matplotlib.pyplot.xlabel matplotlib.pyplot.xlabel
========================
matplotlib.pyplot.xlabel(*xlabel*, *fontdict=None*, *labelpad=None*, *\**, *loc=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L3005-L3009)
Set the label for the x-axis.
Parameters:
**xlabel**str
The label text.
**labelpad**float, default: `[rcParams["axes.labelpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.labelpad#matplotlibrc-sample)` (default: `4.0`)
Spacing in points from the Axes bounding box including ticks and tick labels. If None, the previous value is left as is.
**loc**{'left', 'center', 'right'}, default: `[rcParams["xaxis.labellocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=xaxis.labellocation#matplotlibrc-sample)` (default: `'center'`)
The label position. This is a high-level alternative for passing parameters *x* and *horizontalalignment*.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties control the appearance of the label.
See also
[`text`](matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text")
Documents the properties supported by [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
Examples using `matplotlib.pyplot.xlabel`
-----------------------------------------
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Solarized Light stylesheet](https://matplotlib.org/stable/gallery/style_sheets/plot_solarizedlight2.html#sphx-glr-gallery-style-sheets-plot-solarizedlight2-py)
Solarized Light stylesheet
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib matplotlib.axes.Axes.magnitude_spectrum matplotlib.axes.Axes.magnitude\_spectrum
========================================
Axes.magnitude\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *scale=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7269-L7353)
Plot the magnitude spectrum.
Compute the magnitude spectrum of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**scale**{'default', 'linear', 'dB'}
The scaling of the values in the *spec*. 'linear' is no scaling. 'dB' returns the values in dB scale, i.e., the dB amplitude (20 \* log10). 'default' is 'linear'.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the magnitude spectrum before scaling (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`psd`](matplotlib.axes.axes.psd#matplotlib.axes.Axes.psd "matplotlib.axes.Axes.psd")
Plots the power spectral density.
[`angle_spectrum`](matplotlib.axes.axes.angle_spectrum#matplotlib.axes.Axes.angle_spectrum "matplotlib.axes.Axes.angle_spectrum")
Plots the angles of the corresponding frequencies.
[`phase_spectrum`](matplotlib.axes.axes.phase_spectrum#matplotlib.axes.Axes.phase_spectrum "matplotlib.axes.Axes.phase_spectrum")
Plots the phase (unwrapped angle) of the corresponding frequencies.
[`specgram`](matplotlib.axes.axes.specgram#matplotlib.axes.Axes.specgram "matplotlib.axes.Axes.specgram")
Can plot the magnitude spectrum of segments within the signal in a colormap.
| programming_docs |
matplotlib mpl_toolkits.axisartist.axis_artist.AttributeCopier mpl\_toolkits.axisartist.axis\_artist.AttributeCopier
=====================================================
*class*mpl\_toolkits.axisartist.axis\_artist.AttributeCopier[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L93-L104)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
get\_attribute\_from\_ref\_artist(*attr\_name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L101-L104)
get\_ref\_artist()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L94-L99)
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
matplotlib mpl_toolkits.axes_grid1.axes_size.AddList mpl\_toolkits.axes\_grid1.axes\_size.AddList
============================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.AddList(*add\_list*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L40-L49)
Bases: `_Base`
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use sum(sizes, start=Fixed(0)) instead.
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L46-L49)
matplotlib matplotlib.axes.Axes.get_autoscalex_on matplotlib.axes.Axes.get\_autoscalex\_on
========================================
Axes.get\_autoscalex\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return whether the xaxis is autoscaled.
matplotlib matplotlib.pyplot.psd matplotlib.pyplot.psd
=====================
matplotlib.pyplot.psd(*x*, *NFFT=None*, *Fs=None*, *Fc=None*, *detrend=None*, *window=None*, *noverlap=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*, *return\_line=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2744-L2753)
Plot the power spectral density.
The power spectral density \(P\_{xx}\) by Welch's average periodogram method. The vector *x* is divided into *NFFT* length segments. Each segment is detrended by function *detrend* and windowed by function *window*. *noverlap* gives the length of the overlap between segments. The \(|\mathrm{fft}(i)|^2\) of each segment \(i\) are averaged to compute \(P\_{xx}\), with a scaling to correct for power loss due to windowing.
If len(*x*) < *NFFT*, it will be zero padded to *NFFT*.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](../mlab_api#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between segments.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
**return\_line**bool, default: False
Whether to include the line object plotted in the returned values.
Returns:
**Pxx**1-D array
The values for the power spectrum \(P\_{xx}\) before scaling (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *Pxx*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function. Only returned if *return\_line* is True.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`specgram`](matplotlib.pyplot.specgram#matplotlib.pyplot.specgram "matplotlib.pyplot.specgram")
Differs in the default overlap; in not returning the mean of the segment periodograms; in returning the times of the segments; and in plotting a colormap instead of a line.
[`magnitude_spectrum`](matplotlib.pyplot.magnitude_spectrum#matplotlib.pyplot.magnitude_spectrum "matplotlib.pyplot.magnitude_spectrum")
Plots the magnitude spectrum.
[`csd`](matplotlib.pyplot.csd#matplotlib.pyplot.csd "matplotlib.pyplot.csd")
Plots the spectral density between two signals.
#### Notes
For plotting, the power is plotted as \(10\log\_{10}(P\_{xx})\) for decibels, though *Pxx* itself is returned.
#### References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib matplotlib.patches.ArrowStyle matplotlib.patches.ArrowStyle
=============================
*class*matplotlib.patches.ArrowStyle(*stylename*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3087-L3835)
Bases: `_Style`
[`ArrowStyle`](#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. These are mainly used with [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch").
A arrowstyle object can be either created as:
```
ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
```
or:
```
ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
```
or:
```
ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
```
The following classes are defined
| Class | Name | Attrs |
| --- | --- | --- |
| Curve | `-` | None |
| CurveA | `<-` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveB | `->` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveAB | `<->` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledA | `<|-` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledB | `-|>` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledAB | `<|-|>` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| BracketA | `]-` | widthA=1.0, lengthA=0.2, angleA=0 |
| BracketB | `-[` | widthB=1.0, lengthB=0.2, angleB=0 |
| BracketAB | `]-[` | widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0 |
| BarAB | `|-|` | widthA=1.0, angleA=0, widthB=1.0, angleB=0 |
| BracketCurve | `]->` | widthA=1.0, lengthA=0.2, angleA=None |
| CurveBracket | `<-[` | widthB=1.0, lengthB=0.2, angleB=None |
| Simple | `simple` | head\_length=0.5, head\_width=0.5, tail\_width=0.2 |
| Fancy | `fancy` | head\_length=0.4, head\_width=0.4, tail\_width=0.4 |
| Wedge | `wedge` | tail\_width=0.3, shrink\_factor=0.5 |
An instance of any arrow style class is a callable object, whose call signature is:
```
__call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
```
and it returns a tuple of a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") instance and a boolean value. *path* is a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") instance along which the arrow will be drawn. *mutation\_size* and *aspect\_ratio* have the same meaning as in [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle"). *linewidth* is a line width to be stroked. This is meant to be used to correct the location of the head so that it does not overshoot the destination point, but not all classes support it.
Return the instance of the subclass with the given style name.
*class*BarAB(*widthA=1.0*, *angleA=0*, *widthB=1.0*, *angleB=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3563-L3579)
Bases: `_Curve`
An arrow with vertical bars `|` at both ends.
Parameters:
**widthA, widthB**float, default: 1.0
Width of the bracket.
**angleA, angleB**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*='|-|'*
*class*BracketA(*widthA=1.0*, *lengthA=0.2*, *angleA=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3503-L3520)
Bases: `_Curve`
An arrow with an outward square bracket at its start.
Parameters:
**widthA**float, default: 1.0
Width of the bracket.
**lengthA**float, default: 0.2
Length of the bracket.
**angleA**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*=']-'*
*class*BracketAB(*widthA=1.0*, *lengthA=0.2*, *angleA=0*, *widthB=1.0*, *lengthB=0.2*, *angleB=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3541-L3561)
Bases: `_Curve`
An arrow with outward square brackets at both ends.
Parameters:
**widthA, widthB**float, default: 1.0
Width of the bracket.
**lengthA, lengthB**float, default: 0.2
Length of the bracket.
**angleA, angleB**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*=']-['*
*class*BracketB(*widthB=1.0*, *lengthB=0.2*, *angleB=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3522-L3539)
Bases: `_Curve`
An arrow with an outward square bracket at its end.
Parameters:
**widthB**float, default: 1.0
Width of the bracket.
**lengthB**float, default: 0.2
Length of the bracket.
**angleB**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*='-['*
*class*BracketCurve(*widthA=1.0*, *lengthA=0.2*, *angleA=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3581-L3601)
Bases: `_Curve`
An arrow with an outward square bracket at its start and a head at the end.
Parameters:
**widthA**float, default: 1.0
Width of the bracket.
**lengthA**float, default: 0.2
Length of the bracket.
**angleA**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*=']->'*
*class*Curve[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3464-L3471)
Bases: `_Curve`
A simple curve without any arrow head.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
*class*CurveA(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3473-L3476)
Bases: `_Curve`
An arrow with a head at its begin point.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='<-'*
*class*CurveAB(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3483-L3486)
Bases: `_Curve`
An arrow with heads both at the begin and the end point.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='<->'*
*class*CurveB(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3478-L3481)
Bases: `_Curve`
An arrow with a head at its end point.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='->'*
*class*CurveBracket(*widthB=1.0*, *lengthB=0.2*, *angleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3603-L3623)
Bases: `_Curve`
An arrow with an outward square bracket at its end and a head at the start.
Parameters:
**widthB**float, default: 1.0
Width of the bracket.
**lengthB**float, default: 0.2
Length of the bracket.
**angleB**float, default: 0 degrees
Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.
arrow*='<-['*
*class*CurveFilledA(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3488-L3491)
Bases: `_Curve`
An arrow with filled triangle head at the begin.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='<|-'*
*class*CurveFilledAB(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3498-L3501)
Bases: `_Curve`
An arrow with filled triangle heads at both ends.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='<|-|>'*
*class*CurveFilledB(*head\_length=0.4*, *head\_width=0.2*, *widthA=1.0*, *widthB=1.0*, *lengthA=0.2*, *lengthB=0.2*, *angleA=0*, *angleB=0*, *scaleA=None*, *scaleB=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3493-L3496)
Bases: `_Curve`
An arrow with filled triangle head at the end.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head, relative to *mutation\_scale*.
**head\_width**float, default: 0.2
Width of the arrow head, relative to *mutation\_scale*.
**widthA**float, default: 1.0
Width of the bracket at the beginning of the arrow
**widthB**float, default: 1.0
Width of the bracket at the end of the arrow
**lengthA**float, default: 0.2
Length of the bracket at the beginning of the arrow
**lengthB**float, default: 0.2
Length of the bracket at the end of the arrow
**angleA**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**angleB**float, default 0
Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
**scaleA**float, default *mutation\_size*
The mutation\_size for the beginning bracket
**scaleB**float, default *mutation\_size*
The mutation\_size for the end bracket
arrow*='-|>'*
*class*Fancy(*head\_length=0.4*, *head\_width=0.4*, *tail\_width=0.4*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3705-L3791)
Bases: `_Base`
A fancy arrow. Only works with a quadratic Bezier curve.
Parameters:
**head\_length**float, default: 0.4
Length of the arrow head.
**head\_width**float, default: 0.4
Width of the arrow head.
**tail\_width**float, default: 0.4
Width of the arrow tail.
transmute(*path*, *mutation\_size*, *linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3726-L3791)
The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.
*class*Simple(*head\_length=0.5*, *head\_width=0.5*, *tail\_width=0.2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3625-L3703)
Bases: `_Base`
A simple arrow. Only works with a quadratic Bezier curve.
Parameters:
**head\_length**float, default: 0.5
Length of the arrow head.
**head\_width**float, default: 0.5
Width of the arrow head.
**tail\_width**float, default: 0.2
Width of the arrow tail.
transmute(*path*, *mutation\_size*, *linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3646-L3703)
The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.
*class*Wedge(*tail\_width=0.3*, *shrink\_factor=0.5*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3793-L3835)
Bases: `_Base`
Wedge(?) shape. Only works with a quadratic Bezier curve. The begin point has a width of the tail\_width and the end point has a width of 0. At the middle, the width is shrink\_factor\*tail\_width.
Parameters:
**tail\_width**float, default: 0.3
Width of the tail.
**shrink\_factor**float, default: 0.5
Fraction of the arrow width at the middle point.
transmute(*path*, *mutation\_size*, *linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3815-L3835)
The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation\_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.parasite_axes.HostAxes mpl\_toolkits.axes\_grid1.parasite\_axes.HostAxes
=================================================
mpl\_toolkits.axes\_grid1.parasite\_axes.HostAxes[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py)
alias of `AxesHostAxes`
matplotlib matplotlib.pyplot.rgrids matplotlib.pyplot.rgrids
========================
matplotlib.pyplot.rgrids(*radii=None*, *labels=None*, *angle=None*, *fmt=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1880-L1948)
Get or set the radial gridlines on the current polar plot.
Call signatures:
```
lines, labels = rgrids()
lines, labels = rgrids(radii, labels=None, angle=22.5, fmt=None, **kwargs)
```
When called with no arguments, [`rgrids`](#matplotlib.pyplot.rgrids "matplotlib.pyplot.rgrids") simply returns the tuple (*lines*, *labels*). When called with arguments, the labels will appear at the specified radial distances and angle.
Parameters:
**radii**tuple with floats
The radii for the radial gridlines
**labels**tuple with strings or None
The labels to use at each radial gridline. The [`matplotlib.ticker.ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") will be used if None.
**angle**float
The angular position of the radius labels in degrees.
**fmt**str or None
Format string used in [`matplotlib.ticker.FormatStrFormatter`](../ticker_api#matplotlib.ticker.FormatStrFormatter "matplotlib.ticker.FormatStrFormatter"). For example '%f'.
Returns:
**lines**list of [`lines.Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The radial gridlines.
**labels**list of [`text.Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The tick labels.
Other Parameters:
**\*\*kwargs**
*kwargs* are optional [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels.
See also
[`pyplot.thetagrids`](matplotlib.pyplot.thetagrids#matplotlib.pyplot.thetagrids "matplotlib.pyplot.thetagrids")
[`projections.polar.PolarAxes.set_rgrids`](../projections_api#matplotlib.projections.polar.PolarAxes.set_rgrids "matplotlib.projections.polar.PolarAxes.set_rgrids")
[`Axis.get_gridlines`](matplotlib.axis.axis.get_gridlines#matplotlib.axis.Axis.get_gridlines "matplotlib.axis.Axis.get_gridlines")
[`Axis.get_ticklabels`](matplotlib.axis.axis.get_ticklabels#matplotlib.axis.Axis.get_ticklabels "matplotlib.axis.Axis.get_ticklabels")
#### Examples
```
# set the locations of the radial gridlines
lines, labels = rgrids( (0.25, 0.5, 1.0) )
# set the locations and labels of the radial gridlines
lines, labels = rgrids( (0.25, 0.5, 1.0), ('Tom', 'Dick', 'Harry' ))
```
matplotlib matplotlib.axis.Axis.get_majorticklocs matplotlib.axis.Axis.get\_majorticklocs
=======================================
Axis.get\_majorticklocs()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1414-L1416)
Return this Axis' major tick locations in data coordinates.
matplotlib matplotlib.axes.Axes.get_shared_x_axes matplotlib.axes.Axes.get\_shared\_x\_axes
=========================================
Axes.get\_shared\_x\_axes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4531-L4533)
Return an immutable view on the shared x-axes Grouper.
matplotlib mpl_toolkits.mplot3d.art3d.Path3DCollection mpl\_toolkits.mplot3d.art3d.Path3DCollection
============================================
*class*mpl\_toolkits.mplot3d.art3d.Path3DCollection(*\*args*, *zs=0*, *zdir='z'*, *depthshade=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L492-L634)
Bases: [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")
A collection of 3D paths.
Create a collection of flat 3D paths with its normal vector pointed in *zdir* direction, and located at *zs* on the *zdir* axis. 'zs' can be a scalar or an array-like of the same length as the number of paths in the collection.
Constructor arguments are the same as for [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection"). In addition, keywords *zs=0* and *zdir='z'* are available.
Also, the keyword argument *depthshade* is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is *True*). This is typically desired in scatter plots.
do\_3d\_projection()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L585-L613)
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L518-L520)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_depthshade()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L569-L570)
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L628-L634)
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L625-L626)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *depthshade=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *sort\_zpos=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`3d_properties`](#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_3d_properties "mpl_toolkits.mplot3d.art3d.Path3DCollection.set_3d_properties") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`depthshade`](#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_depthshade "mpl_toolkits.mplot3d.art3d.Path3DCollection.set_depthshade") | bool |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | unknown |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PathCollection.set_paths "matplotlib.collections.PathCollection.set_paths") | unknown |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | unknown |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`sort_zpos`](#mpl_toolkits.mplot3d.art3d.Path3DCollection.set_sort_zpos "mpl_toolkits.mplot3d.art3d.Path3DCollection.set_sort_zpos") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_3d\_properties(*zs*, *zdir*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L527-L557)
set\_depthshade(*depthshade*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L572-L583)
Set whether depth shading is performed on collection members.
Parameters:
**depthshade**bool
Whether to shade the patches in order to give the appearance of depth.
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L564-L567)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L559-L562)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sort\_zpos(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L522-L525)
Set the position to use for z-sorting.
matplotlib matplotlib.axes.Axes.set_autoscaley_on matplotlib.axes.Axes.set\_autoscaley\_on
========================================
Axes.set\_autoscaley\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set whether the yaxis is autoscaled when drawing or by [`Axes.autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view").
Parameters:
**b**bool
matplotlib matplotlib.pyplot.tricontour matplotlib.pyplot.tricontour
============================
matplotlib.pyplot.tricontour(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2922-L2926)
Draw contour lines on an unstructured triangular grid.
Call signatures:
```
tricontour(triangulation, Z, [levels], ...)
tricontour(x, y, Z, [levels], *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters. If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly.
It is possible to pass *triangles* positionally, i.e. `tricontour(x, y, triangles, Z, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"), optional
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**Z**array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet")
Other Parameters:
**colors**color string or sequence of colors, optional
The colors of the levels, i.e., the contour lines.
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it is repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `tricontour`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call to [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed") is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") because it internally calls [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed").
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**linewidths**float or array-like, default: `[rcParams["contour.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.linewidth#matplotlibrc-sample)` (default: `None`)
The line width of the contour lines.
If a number, all levels will be plotted with this linewidth.
If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified.
If None, this falls back to `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`).
**linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
If *linestyles* is *None*, the default is 'solid' unless the lines are monochrome. In that case, negative contours will take their linestyle from `[rcParams["contour.negative\_linestyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.negative_linestyle#matplotlibrc-sample)` (default: `'dashed'`) setting.
*linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
| programming_docs |
matplotlib matplotlib.quiver.QuiverKey matplotlib.quiver.QuiverKey
===========================
*class*matplotlib.quiver.QuiverKey(*Q*, *X*, *Y*, *U*, *label*, *\**, *angle=0*, *coordinates='axes'*, *color=None*, *labelsep=0.1*, *labelpos='N'*, *labelcolor=None*, *fontproperties=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L235-L396)
Bases: [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
Labelled arrow for use as a quiver plot scale key.
Add a key to a quiver plot.
The positioning of the key depends on *X*, *Y*, *coordinates*, and *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions the head, and if *labelpos* is 'W', *X*, *Y* positions the tail; in either of these two cases, *X*, *Y* is somewhere in the middle of the arrow+label key object.
Parameters:
**Q**[`matplotlib.quiver.Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")
A [`Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver") object as returned by a call to [`quiver()`](matplotlib.axes.axes.quiver#matplotlib.axes.Axes.quiver "matplotlib.axes.Axes.quiver").
**X, Y**float
The location of the key.
**U**float
The length of the key.
**label**str
The key label (e.g., length and units of the key).
**angle**float, default: 0
The angle of the key arrow, in degrees anti-clockwise from the x-axis.
**coordinates**{'axes', 'figure', 'data', 'inches'}, default: 'axes'
Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are normalized coordinate systems with (0, 0) in the lower left and (1, 1) in the upper right; 'data' are the axes data coordinates (used for the locations of the vectors in the quiver plot itself); 'inches' is position in the figure in inches, with (0, 0) at the lower left corner.
**color**color
Overrides face and edge colors from *Q*.
**labelpos**{'N', 'S', 'E', 'W'}
Position the label above, below, to the right, to the left of the arrow, respectively.
**labelsep**float, default: 0.1
Distance in inches between the arrow and the label.
**labelcolor**color, default: `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`)
Label color.
**fontproperties**dict, optional
A dictionary with keyword arguments accepted by the [`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") initializer: *family*, *style*, *variant*, *size*, *weight*.
**\*\*kwargs**
Any additional keyword arguments are used to override vector properties taken from *Q*.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L387-L396)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](../backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L365-L373)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
halign*={'E': 'left', 'N': 'center', 'S': 'center', 'W': 'right'}*
*property*labelsep
pivot*={'E': 'tip', 'N': 'middle', 'S': 'middle', 'W': 'tail'}*
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | unknown |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L383-L385)
Set the [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
valign*={'E': 'center', 'N': 'bottom', 'S': 'top', 'W': 'center'}*
Examples using `matplotlib.quiver.QuiverKey`
--------------------------------------------
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
matplotlib matplotlib.axes.Axes.get_xgridlines matplotlib.axes.Axes.get\_xgridlines
====================================
Axes.get\_xgridlines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the xaxis' grid lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
matplotlib mpl_toolkits.axisartist.floating_axes.FloatingAxisArtistHelper mpl\_toolkits.axisartist.floating\_axes.FloatingAxisArtistHelper
================================================================
*class*mpl\_toolkits.axisartist.floating\_axes.FloatingAxisArtistHelper(*grid\_helper*, *nth\_coord*, *value*, *axis\_direction=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py#L25-L27)
Bases: [`FloatingAxisArtistHelper`](mpl_toolkits.axisartist.grid_helper_curvelinear.floatingaxisartisthelper#mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper "mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper")
nth\_coord = along which coordinate value varies.
nth\_coord = 0 -> x axis, nth\_coord = 1 -> y axis
matplotlib matplotlib.pyplot.title matplotlib.pyplot.title
=======================
matplotlib.pyplot.title(*label*, *fontdict=None*, *loc=None*, *pad=None*, *\**, *y=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2998-L3001)
Set a title for the Axes.
Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.
Parameters:
**label**str
Text to use for the title
**fontdict**dict
A dictionary controlling the appearance of the title text, the default *fontdict* is:
```
{'fontsize': rcParams['axes.titlesize'],
'fontweight': rcParams['axes.titleweight'],
'color': rcParams['axes.titlecolor'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}
```
**loc**{'center', 'left', 'right'}, default: `[rcParams["axes.titlelocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titlelocation#matplotlibrc-sample)` (default: `'center'`)
Which title to set.
**y**float, default: `[rcParams["axes.titley"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titley#matplotlibrc-sample)` (default: `None`)
Vertical Axes location for the title (1.0 is the top). If None (the default) and `[rcParams["axes.titley"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titley#matplotlibrc-sample)` (default: `None`) is also None, y is determined automatically to avoid decorators on the Axes.
**pad**float, default: `[rcParams["axes.titlepad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.titlepad#matplotlibrc-sample)` (default: `6.0`)
The offset of the title from the top of the Axes, in points.
Returns:
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The matplotlib text instance representing the title
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties
Other keyword arguments are text properties, see [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") for a list of valid text properties.
Examples using `matplotlib.pyplot.title`
----------------------------------------
[Plotting masked and NaN values](https://matplotlib.org/stable/gallery/lines_bars_and_markers/masked_demo.html#sphx-glr-gallery-lines-bars-and-markers-masked-demo-py)
Plotting masked and NaN values
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py)
Step Demo
[Geographic Projections](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py)
Geographic Projections
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Solarized Light stylesheet](https://matplotlib.org/stable/gallery/style_sheets/plot_solarizedlight2.html#sphx-glr-gallery-style-sheets-plot-solarizedlight2-py)
Solarized Light stylesheet
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Multipage PDF](https://matplotlib.org/stable/gallery/misc/multipage_pdf.html#sphx-glr-gallery-misc-multipage-pdf-py)
Multipage PDF
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[Rotating a 3D plot](https://matplotlib.org/stable/gallery/mplot3d/rotate_axes3d_sgskip.html#sphx-glr-gallery-mplot3d-rotate-axes3d-sgskip-py)
Rotating a 3D plot
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[The Sankey class](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics.html#sphx-glr-gallery-specialty-plots-sankey-basics-py)
The Sankey class
[SVG Histogram](https://matplotlib.org/stable/gallery/user_interfaces/svg_histogram_sgskip.html#sphx-glr-gallery-user-interfaces-svg-histogram-sgskip-py)
SVG Histogram
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib matplotlib.axis.Tick.get_pad matplotlib.axis.Tick.get\_pad
=============================
Tick.get\_pad()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L275-L277)
Get the value of the tick label pad in points.
matplotlib matplotlib.pyplot.disconnect matplotlib.pyplot.disconnect
============================
matplotlib.pyplot.disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L872-L874)
Disconnect the callback with id *cid*.
#### Examples
```
cid = canvas.mpl_connect('button_press_event', on_press)
# ... later
canvas.mpl_disconnect(cid)
```
Examples using `matplotlib.pyplot.disconnect`
---------------------------------------------
[Mouse move and click events](https://matplotlib.org/stable/gallery/event_handling/coords_demo.html#sphx-glr-gallery-event-handling-coords-demo-py)
Mouse move and click events
matplotlib matplotlib.artist.Artist.pchanged matplotlib.artist.Artist.pchanged
=================================
Artist.pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](matplotlib.artist.artist.add_callback#matplotlib.artist.Artist.add_callback "matplotlib.artist.Artist.add_callback")
[`remove_callback`](matplotlib.artist.artist.remove_callback#matplotlib.artist.Artist.remove_callback "matplotlib.artist.Artist.remove_callback")
matplotlib matplotlib.artist.Artist.findobj matplotlib.artist.Artist.findobj
================================
Artist.findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
Examples using `matplotlib.artist.Artist.findobj`
-------------------------------------------------
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
matplotlib mpl_toolkits.axisartist.angle_helper mpl\_toolkits.axisartist.angle\_helper
======================================
Classes
-------
| | |
| --- | --- |
| [`ExtremeFinderCycle`](mpl_toolkits.axisartist.angle_helper.extremefindercycle#mpl_toolkits.axisartist.angle_helper.ExtremeFinderCycle "mpl_toolkits.axisartist.angle_helper.ExtremeFinderCycle")(nx, ny[, lon\_cycle, ...]) | This subclass handles the case where one or both coordinates should be taken modulo 360, or be restricted to not exceed a specific range. |
| [`FormatterDMS`](mpl_toolkits.axisartist.angle_helper.formatterdms#mpl_toolkits.axisartist.angle_helper.FormatterDMS "mpl_toolkits.axisartist.angle_helper.FormatterDMS")() | |
| [`FormatterHMS`](mpl_toolkits.axisartist.angle_helper.formatterhms#mpl_toolkits.axisartist.angle_helper.FormatterHMS "mpl_toolkits.axisartist.angle_helper.FormatterHMS")() | |
| [`LocatorBase`](mpl_toolkits.axisartist.angle_helper.locatorbase#mpl_toolkits.axisartist.angle_helper.LocatorBase "mpl_toolkits.axisartist.angle_helper.LocatorBase")(nbins[, include\_last]) | |
| [`LocatorD`](mpl_toolkits.axisartist.angle_helper.locatord#mpl_toolkits.axisartist.angle_helper.LocatorD "mpl_toolkits.axisartist.angle_helper.LocatorD")(nbins[, include\_last]) | |
| [`LocatorDM`](mpl_toolkits.axisartist.angle_helper.locatordm#mpl_toolkits.axisartist.angle_helper.LocatorDM "mpl_toolkits.axisartist.angle_helper.LocatorDM")(nbins[, include\_last]) | |
| [`LocatorDMS`](mpl_toolkits.axisartist.angle_helper.locatordms#mpl_toolkits.axisartist.angle_helper.LocatorDMS "mpl_toolkits.axisartist.angle_helper.LocatorDMS")(nbins[, include\_last]) | |
| [`LocatorH`](mpl_toolkits.axisartist.angle_helper.locatorh#mpl_toolkits.axisartist.angle_helper.LocatorH "mpl_toolkits.axisartist.angle_helper.LocatorH")(nbins[, include\_last]) | |
| [`LocatorHM`](mpl_toolkits.axisartist.angle_helper.locatorhm#mpl_toolkits.axisartist.angle_helper.LocatorHM "mpl_toolkits.axisartist.angle_helper.LocatorHM")(nbins[, include\_last]) | |
| [`LocatorHMS`](mpl_toolkits.axisartist.angle_helper.locatorhms#mpl_toolkits.axisartist.angle_helper.LocatorHMS "mpl_toolkits.axisartist.angle_helper.LocatorHMS")(nbins[, include\_last]) | |
Functions
---------
| | |
| --- | --- |
| [`select_step`](mpl_toolkits.axisartist.angle_helper.select_step#mpl_toolkits.axisartist.angle_helper.select_step "mpl_toolkits.axisartist.angle_helper.select_step")(v1, v2, nv[, hour, ...]) | |
| [`select_step24`](mpl_toolkits.axisartist.angle_helper.select_step24#mpl_toolkits.axisartist.angle_helper.select_step24 "mpl_toolkits.axisartist.angle_helper.select_step24")(v1, v2, nv[, include\_last, ...]) | |
| [`select_step360`](mpl_toolkits.axisartist.angle_helper.select_step360#mpl_toolkits.axisartist.angle_helper.select_step360 "mpl_toolkits.axisartist.angle_helper.select_step360")(v1, v2, nv[, include\_last, ...]) | |
| [`select_step_degree`](mpl_toolkits.axisartist.angle_helper.select_step_degree#mpl_toolkits.axisartist.angle_helper.select_step_degree "mpl_toolkits.axisartist.angle_helper.select_step_degree")(dv) | |
| [`select_step_hour`](mpl_toolkits.axisartist.angle_helper.select_step_hour#mpl_toolkits.axisartist.angle_helper.select_step_hour "mpl_toolkits.axisartist.angle_helper.select_step_hour")(dv) | |
| [`select_step_sub`](mpl_toolkits.axisartist.angle_helper.select_step_sub#mpl_toolkits.axisartist.angle_helper.select_step_sub "mpl_toolkits.axisartist.angle_helper.select_step_sub")(dv) | |
| programming_docs |
matplotlib matplotlib.pyplot.colorbar matplotlib.pyplot.colorbar
==========================
matplotlib.pyplot.colorbar(*mappable=None*, *cax=None*, *ax=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2044-L2054)
Add a colorbar to a plot.
Parameters:
**mappable**
The [`matplotlib.cm.ScalarMappable`](../cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") (i.e., [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"), [`ContourSet`](../contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), etc.) described by this colorbar. This argument is mandatory for the [`Figure.colorbar`](../figure_api#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") method but optional for the [`pyplot.colorbar`](#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") function, which sets the default to the current image.
Note that one can create a [`ScalarMappable`](../cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") "on-the-fly" to generate colorbars not attached to a previously drawn artist, e.g.
```
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
```
**cax**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Axes into which the colorbar will be drawn.
**ax**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), list of Axes, optional
One or more parent axes from which space for a new colorbar axes will be stolen, if *cax* is None. This has no effect if *cax* is set.
**use\_gridspec**bool, optional
If *cax* is `None`, a new *cax* is created as an instance of Axes. If *ax* is an instance of Subplot and *use\_gridspec* is `True`, *cax* is created as an instance of Subplot using the [`gridspec`](../gridspec_api#module-matplotlib.gridspec "matplotlib.gridspec") module.
Returns:
**colorbar**[`Colorbar`](../colorbar_api#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar")
Other Parameters:
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
**extend**{'neither', 'both', 'min', 'max'}
Make pointed end(s) for out-of-range values (unless 'neither'). These are set for a given colormap using the colormap set\_under and set\_over methods.
**extendfrac**{*None*, 'auto', length, lengths}
If set to *None*, both the minimum and maximum triangular colorbar extensions will have a length of 5% of the interior colorbar length (this is the default setting).
If set to 'auto', makes the triangular colorbar extensions the same lengths as the interior boxes (when *spacing* is set to 'uniform') or the same lengths as the respective adjacent interior boxes (when *spacing* is set to 'proportional').
If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length.
**extendrect**bool
If *False* the minimum and maximum colorbar extensions will be triangular (the default). If *True* the extensions will be rectangular.
**spacing**{'uniform', 'proportional'}
For discrete colorbars ([`BoundaryNorm`](matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm") or contours), 'uniform' gives each color the same space; 'proportional' makes the space proportional to the data interval.
**ticks**None or list of ticks or Locator
If None, ticks are determined automatically from the input.
**format**None or str or Formatter
If None, [`ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used. Format strings, e.g., `"%4.2e"` or `"{x:.2e}"`, are supported. An alternative [`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") may be given instead.
**drawedges**bool
Whether to draw lines at color boundaries.
**label**str
The label on the colorbar's long axis.
**boundaries, values**None or a sequence
If unset, the colormap will be displayed on a 0-1 scale. If sequences, *values* must have a length 1 less than *boundaries*. For each region delimited by adjacent entries in *boundaries*, the color mapped to the corresponding value in values will be used. Normally only useful for indexed colors (i.e. `norm=NoNorm()`) or other unusual circumstances.
#### Notes
If *mappable* is a [`ContourSet`](../contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), its *extend* kwarg is included automatically.
The *shrink* kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if *cax* is specified, it determines the size of the colorbar and *shrink* and *aspect* kwargs are ignored.
For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs.
It is known that some vector graphics viewers (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers, not Matplotlib. As a workaround, the colorbar can be rendered with overlapping segments:
```
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
```
However this has negative consequences in other circumstances, e.g. with semi-transparent images (alpha < 1) and colorbar extensions; therefore, this workaround is not used by default (see issue #1188).
Examples using `matplotlib.pyplot.colorbar`
-------------------------------------------
[Subplots spacings and margins](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_adjust.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-adjust-py)
Subplots spacings and margins
[Ellipse Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_collection.html#sphx-glr-gallery-shapes-and-collections-ellipse-collection-py)
Ellipse Collection
[Axes Divider](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-divider-py)
Axes Divider
[Simple Colorbar](https://matplotlib.org/stable/gallery/axes_grid1/simple_colorbar.html#sphx-glr-gallery-axes-grid1-simple-colorbar-py)
Simple Colorbar
[Image tutorial](https://matplotlib.org/stable/tutorials/introductory/images.html#sphx-glr-tutorials-introductory-images-py)
Image tutorial
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.pyplot.tricontourf matplotlib.pyplot.tricontourf
=============================
matplotlib.pyplot.tricontourf(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2930-L2934)
Draw contour regions on an unstructured triangular grid.
Call signatures:
```
tricontourf(triangulation, Z, [levels], ...)
tricontourf(x, y, Z, [levels], *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters. If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly.
It is possible to pass *triangles* positionally, i.e. `tricontourf(x, y, triangles, Z, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"), optional
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**Z**array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet")
Other Parameters:
**colors**color string or sequence of colors, optional
The colors of the levels, i.e., the contour regions.
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it is repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `tricontourf`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call to [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed") is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") because it internally calls [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed").
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**hatches**list[str], optional
A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
#### Notes
[`tricontourf`](#matplotlib.pyplot.tricontourf "matplotlib.pyplot.tricontourf") fills intervals that are closed at the top; that is, for boundaries *z1* and *z2*, the filled region is:
```
z1 < Z <= z2
```
except for the lowest interval, which is closed on both sides (i.e. it includes the lowest value).
matplotlib matplotlib.axis.Axis.get_remove_overlapping_locs matplotlib.axis.Axis.get\_remove\_overlapping\_locs
===================================================
Axis.get\_remove\_overlapping\_locs()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L733-L734)
matplotlib matplotlib.pyplot.tripcolor matplotlib.pyplot.tripcolor
===========================
matplotlib.pyplot.tripcolor(*\*args*, *alpha=1.0*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *shading='flat'*, *facecolors=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2938-L2946)
Create a pseudocolor plot of an unstructured triangular grid.
Call signatures:
```
tripcolor(triangulation, C, *, ...)
tripcolor(x, y, C, *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters.
It is possible to pass the triangles positionally, i.e. `tripcolor(x, y, triangles, C, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly. In this case, it does not make sense to provide colors at the triangle faces via *C* or *facecolors* because there are multiple possible triangulations for a group of points and you don't know which triangles will be constructed.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**C**array-like
The color values, either for the points or for the triangles. Which one is automatically inferred from the length of *C*, i.e. does it match the number of points or the number of triangles. If there are the same number of points and triangles in the triangulation it is assumed that color values are defined at points; to force the use of color values at triangles use the keyword argument `facecolors=C` instead of just `C`. This parameter is position-only.
**facecolors**array-like, optional
Can be used alternatively to *C* to specify colors at the triangle faces. This parameter takes precedence over *C*.
**shading**{'flat', 'gouraud'}, default: 'flat'
If 'flat' and the color values *C* are defined at points, the color values used for each triangle are from the mean C of the triangle's three points. If *shading* is 'gouraud' then color values must be defined at points.
**other\_parameters**
All other parameters are the same as for [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor").
| programming_docs |
matplotlib matplotlib.colors.ListedColormap matplotlib.colors.ListedColormap
================================
*class*matplotlib.colors.ListedColormap(*colors*, *name='from\_list'*, *N=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1107-L1199)
Bases: [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")
Colormap object generated from a list of colors.
This may be most useful when indexing directly into a colormap, but it can also be used to generate special colormaps for ordinary mapping.
Parameters:
**colors**list, array
List of Matplotlib color specifications, or an equivalent Nx3 or Nx4 floating point array (*N* rgb or rgba values).
**name**str, optional
String to identify the colormap.
**N**int, optional
Number of entries in the map. The default is *None*, in which case there is one colormap entry for each element in the list of colors. If
```
N < len(colors)
```
the list will be truncated at *N*. If
```
N > len(colors)
```
the list will be extended by repetition.
Parameters:
**name**str
The name of the colormap.
**N**int
The number of rgb quantization levels.
resampled(*lutsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1165-L1173)
Return a new colormap with *lutsize* entries.
reversed(*name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1175-L1199)
Return a reversed instance of the Colormap.
Parameters:
**name**str, optional
The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "\_r".
Returns:
ListedColormap
A reversed instance of the colormap.
Examples using `matplotlib.colors.ListedColormap`
-------------------------------------------------
[Multicolored lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multicolored_line.html#sphx-glr-gallery-lines-bars-and-markers-multicolored-line-py)
Multicolored lines
[Mapping marker properties to multivariate data](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html#sphx-glr-gallery-lines-bars-and-markers-multivariate-marker-plot-py)
Mapping marker properties to multivariate data
[Layer Images](https://matplotlib.org/stable/gallery/images_contours_and_fields/layer_images.html#sphx-glr-gallery-images-contours-and-fields-layer-images-py)
Layer Images
[QuadMesh Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quadmesh_demo.html#sphx-glr-gallery-images-contours-and-fields-quadmesh-demo-py)
QuadMesh Demo
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Time Series Histogram](https://matplotlib.org/stable/gallery/statistics/time_series_histogram.html#sphx-glr-gallery-statistics-time-series-histogram-py)
Time Series Histogram
[Nested pie charts](https://matplotlib.org/stable/gallery/pie_and_polar_charts/nested_pie.html#sphx-glr-gallery-pie-and-polar-charts-nested-pie-py)
Nested pie charts
[Bar chart on polar axis](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_bar.html#sphx-glr-gallery-pie-and-polar-charts-polar-bar-py)
Bar chart on polar axis
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py)
Creating Colormaps in Matplotlib
matplotlib matplotlib.pyplot.gci matplotlib.pyplot.gci
=====================
matplotlib.pyplot.gci()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2229-L2231)
Get the current colorable artist.
Specifically, returns the current [`ScalarMappable`](../cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") instance (`Image` created by [`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow") or [`figimage`](matplotlib.pyplot.figimage#matplotlib.pyplot.figimage "matplotlib.pyplot.figimage"), [`Collection`](../collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection") created by [`pcolor`](matplotlib.pyplot.pcolor#matplotlib.pyplot.pcolor "matplotlib.pyplot.pcolor") or [`scatter`](matplotlib.pyplot.scatter#matplotlib.pyplot.scatter "matplotlib.pyplot.scatter"), etc.), or *None* if no such instance has been defined.
The current image is an attribute of the current Axes, or the nearest earlier Axes in the current figure that contains an image.
#### Notes
Historically, the only colorable artists were images; hence the name `gci` (get current image).
matplotlib matplotlib.axes.Axes.get_xticks matplotlib.axes.Axes.get\_xticks
================================
Axes.get\_xticks(*\**, *minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the xaxis' tick locations in data coordinates.
The locations are not clipped to the current axis limits and hence may contain locations that are not visible in the output.
Parameters:
**minor**bool, default: False
True to return the minor tick directions, False to return the major tick directions.
Returns:
numpy array of tick locations
matplotlib matplotlib.patches.Arc matplotlib.patches.Arc
======================
*class*matplotlib.patches.Arc(*xy*, *width*, *height*, *\**, *angle=0.0*, *theta1=0.0*, *theta2=360.0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1898-L2143)
Bases: [`Ellipse`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse "matplotlib.patches.Ellipse")
An elliptical arc, i.e. a segment of an ellipse.
Due to internal optimizations, the arc cannot be filled.
Parameters:
**xy**(float, float)
The center of the ellipse.
**width**float
The length of the horizontal axis.
**height**float
The length of the vertical axis.
**angle**float
Rotation of the ellipse in degrees (counterclockwise).
**theta1, theta2**float, default: 0, 360
Starting and ending angles of the arc in degrees. These values are relative to *angle*, e.g. if *angle* = 45 and *theta1* = 90 the absolute starting angle is 135. Default *theta1* = 0, *theta2* = 360, i.e. a complete ellipse. The arc is drawn in the counterclockwise direction. Angles greater than or equal to 360, or smaller than 0, are represented by an equivalent angle in the range [0, 360), by taking the input value mod 360.
Other Parameters:
**\*\*kwargs**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties
Most [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties are supported as keyword arguments, with the exception of *fill* and *facecolor* because filling is not supported.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1962-L2103)
Draw the arc to the given *renderer*.
#### Notes
Ellipses are normally drawn using an approximation that uses eight cubic Bezier splines. The error of this approximation is 1.89818e-6, according to this unverified source:
Lancaster, Don. *Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines.*
<https://www.tinaja.com/glib/ellipse4.pdf>
There is a use case where very large ellipses must be drawn with very high accuracy, and it is too expensive to render the entire ellipse with enough segments (either splines or line segments). Therefore, in the case where either radius of the ellipse is large enough that the error of the spline approximation will be visible (greater than one pixel offset from the ideal), a different technique is used.
In that case, only the visible parts of the ellipse are drawn, with each visible arc using a fixed number of spline segments (8). The algorithm proceeds as follows:
1. The points where the ellipse intersects the axes (or figure) bounding box are located. (This is done by performing an inverse transformation on the bbox such that it is relative to the unit circle -- this makes the intersection calculation much easier than doing rotated ellipse intersection directly.)
This uses the "line intersecting a circle" algorithm from:
Vince, John. *Geometry for Computer Graphics: Formulae, Examples & Proofs.* London: Springer-Verlag, 2005.
2. The angles of each of the intersection points are calculated.
3. Proceeding counterclockwise starting in the positive x-direction, each of the visible arc-segments between the pairs of vertices are drawn using the Bezier arc approximation technique implemented in [`Path.arc`](../path_api#matplotlib.path.Path.arc "matplotlib.path.Path.arc").
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *center=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_angle "matplotlib.patches.Ellipse.set_angle") | float |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`center`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_center "matplotlib.patches.Ellipse.set_center") | (float, float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_height "matplotlib.patches.Ellipse.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_width "matplotlib.patches.Ellipse.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.patches.Arc`
---------------------------------------
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Ellipse with units](https://matplotlib.org/stable/gallery/units/ellipse_with_units.html#sphx-glr-gallery-units-ellipse-with-units-py)
Ellipse with units
| programming_docs |
matplotlib matplotlib.artist.Artist.convert_yunits matplotlib.artist.Artist.convert\_yunits
========================================
Artist.convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
matplotlib matplotlib.artist.Artist.get_animated matplotlib.artist.Artist.get\_animated
======================================
Artist.get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
matplotlib matplotlib.axes.Axes.fill_betweenx matplotlib.axes.Axes.fill\_betweenx
===================================
Axes.fill\_betweenx(*y*, *x1*, *x2=0*, *where=None*, *step=None*, *interpolate=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5347-L5351)
Fill the area between two vertical curves.
The curves are defined by the points (*y*, *x1*) and (*y*, *x2*). This creates one or multiple polygons describing the filled area.
You may exclude some vertical sections from filling using *where*.
By default, the edges connect the given points directly. Use *step* if the filling should be a step function, i.e. constant in between *y*.
Parameters:
**y**array (length N)
The y coordinates of the nodes defining the curves.
**x1**array (length N) or scalar
The x coordinates of the nodes defining the first curve.
**x2**array (length N) or scalar, default: 0
The x coordinates of the nodes defining the second curve.
**where**array of bool (length N), optional
Define *where* to exclude some vertical regions from being filled. The filled regions are defined by the coordinates `y[where]`. More precisely, fill between `y[i]` and `y[i+1]` if `where[i] and where[i+1]`. Note that this definition implies that an isolated *True* value between two *False* values in *where* will not result in filling. Both sides of the *True* position remain unfilled due to the adjacent *False* values.
**interpolate**bool, default: False
This option is only relevant if *where* is used and the two curves are crossing each other.
Semantically, *where* is often used for *x1* > *x2* or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the *y* array. Such a polygon cannot describe the above semantics close to the intersection. The y-sections containing the intersection are simply clipped.
Setting *interpolate* to *True* will calculate the actual intersection point and extend the filled region up to this point.
**step**{'pre', 'post', 'mid'}, optional
Define *step* if the filling should be a step function, i.e. constant in between *y*. The value determines where the step will occur:
* 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval `(x[i-1], x[i]]` has the value `y[i]`.
* 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval `[x[i], x[i+1])` has the value `y[i]`.
* 'mid': Steps occur half-way between the *x* positions.
Returns:
[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") containing the plotted polygons.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*y*, *x1*, *x2*, *where*
**\*\*kwargs**
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"). They control the [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`fill_between`](matplotlib.axes.axes.fill_between#matplotlib.axes.Axes.fill_between "matplotlib.axes.Axes.fill_between")
Fill between two sets of y-values.
[`fill_betweenx`](#matplotlib.axes.Axes.fill_betweenx "matplotlib.axes.Axes.fill_betweenx")
Fill between two sets of x-values.
Examples using `matplotlib.axes.Axes.fill_betweenx`
---------------------------------------------------
[Fill Betweenx Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_betweenx_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-betweenx-demo-py)
Fill Betweenx Demo
matplotlib matplotlib.artist.Artist.stale matplotlib.artist.Artist.stale
==============================
*property*Artist.stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
matplotlib matplotlib.axes.Axes.indicate_inset_zoom matplotlib.axes.Axes.indicate\_inset\_zoom
==========================================
Axes.indicate\_inset\_zoom(*inset\_ax*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L502-L539)
Add an inset indicator rectangle to the Axes based on the axis limits for an *inset\_ax* and draw connectors between *inset\_ax* and the rectangle.
Parameters:
**inset\_ax**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Inset Axes to draw connecting lines to. Two lines are drawn connecting the indicator box to the inset Axes on corners chosen so as to not overlap with the indicator box.
**\*\*kwargs**
Other keyword arguments are passed on to [`Axes.indicate_inset`](matplotlib.axes.axes.indicate_inset#matplotlib.axes.Axes.indicate_inset "matplotlib.axes.Axes.indicate_inset")
Returns:
**rectangle\_patch**[`patches.Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle")
Rectangle artist.
**connector\_lines**4-tuple of [`patches.ConnectionPatch`](matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch "matplotlib.patches.ConnectionPatch")
Each of four connector lines coming from the rectangle drawn on this axis, in the order lower left, upper left, lower right, upper right. Two are set with visibility to *False*, but the user can set the visibility to *True* if the automatic choice is not deemed correct.
Warning
This method is experimental as of 3.0, and the API may change.
Examples using `matplotlib.axes.Axes.indicate_inset_zoom`
---------------------------------------------------------
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
matplotlib matplotlib.colors.same_color matplotlib.colors.same\_color
=============================
matplotlib.colors.same\_color(*c1*, *c2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L246-L262)
Return whether the colors *c1* and *c2* are the same.
*c1*, *c2* can be single colors or lists/arrays of colors.
matplotlib matplotlib.axes.Axes.get_ylabel matplotlib.axes.Axes.get\_ylabel
================================
Axes.get\_ylabel()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3705-L3710)
Get the ylabel text string.
matplotlib mpl_toolkits.axisartist.angle_helper.select_step_degree mpl\_toolkits.axisartist.angle\_helper.select\_step\_degree
===========================================================
mpl\_toolkits.axisartist.angle\_helper.select\_step\_degree(*dv*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L7-L30)
matplotlib matplotlib.axes.Axes.get_tightbbox matplotlib.axes.Axes.get\_tightbbox
===================================
Axes.get\_tightbbox(*renderer=None*, *call\_axes\_locator=True*, *bbox\_extra\_artists=None*, *\**, *for\_layout\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4371-L4456)
Return the tight bounding box of the Axes, including axis and their decorators (xlabel, title, etc).
Artists that have `artist.set_in_layout(False)` are not included in the bbox.
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
**bbox\_extra\_artists**list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or `None`
List of artists to include in the tight bounding box. If `None` (default), then all artist children of the Axes are included in the tight bounding box.
**call\_axes\_locator**bool, default: True
If *call\_axes\_locator* is `False`, it does not call the `_axes_locator` attribute, which is necessary to get the correct bounding box. `call_axes_locator=False` can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox.
**for\_layout\_only**default: False
The bounding box will *not* include the x-extent of the title and the xlabel, or the y-extent of the ylabel.
Returns:
[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
Bounding box in figure pixel coordinates.
See also
[`matplotlib.axes.Axes.get_window_extent`](matplotlib.axes.axes.get_window_extent#matplotlib.axes.Axes.get_window_extent "matplotlib.axes.Axes.get_window_extent")
[`matplotlib.axis.Axis.get_tightbbox`](matplotlib.axis.axis.get_tightbbox#matplotlib.axis.Axis.get_tightbbox "matplotlib.axis.Axis.get_tightbbox")
[`matplotlib.spines.Spine.get_window_extent`](../spines_api#matplotlib.spines.Spine.get_window_extent "matplotlib.spines.Spine.get_window_extent")
matplotlib matplotlib.axis.Tick.get_view_interval matplotlib.axis.Tick.get\_view\_interval
========================================
Tick.get\_view\_interval()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L350-L354)
Return the view limits `(min, max)` of the axis the tick belongs to.
matplotlib matplotlib.pyplot.autoscale matplotlib.pyplot.autoscale
===========================
matplotlib.pyplot.autoscale(*enable=True*, *axis='both'*, *tight=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2309-L2311)
Autoscale the axis view to the data (toggle).
Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or Axes.
Parameters:
**enable**bool or None, default: True
True turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged.
**axis**{'both', 'x', 'y'}, default: 'both'
The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three axes.)
**tight**bool or None, default: None
If True, first set the margins to zero. Then, this argument is forwarded to [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") (regardless of its value); see the description of its behavior there.
matplotlib matplotlib.axis.Tick.get_pad_pixels matplotlib.axis.Tick.get\_pad\_pixels
=====================================
Tick.get\_pad\_pixels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L248-L250)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib matplotlib.artist.Artist.update_from matplotlib.artist.Artist.update\_from
=====================================
Artist.update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1122-L1137)
Copy properties from *other* to *self*.
Examples using `matplotlib.artist.Artist.update_from`
-----------------------------------------------------
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
matplotlib matplotlib.pyplot.stairs matplotlib.pyplot.stairs
========================
matplotlib.pyplot.stairs(*values*, *edges=None*, *\**, *orientation='vertical'*, *baseline=0*, *fill=False*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2570-L2577)
A stepwise constant function as a line with bounding edges or a filled plot.
Parameters:
**values**array-like
The step heights.
**edges**array-like
The edge positions, with `len(edges) == len(vals) + 1`, between which the curve takes on vals values.
**orientation**{'vertical', 'horizontal'}, default: 'vertical'
The direction of the steps. Vertical means that *values* are along the y-axis, and edges are along the x-axis.
**baseline**float, array-like or None, default: 0
The bottom value of the bounding edges or when `fill=True`, position of lower edge. If *fill* is True or an array is passed to *baseline*, a closed path is drawn.
**fill**bool, default: False
Whether the area under the step curve should be filled.
Returns:
**StepPatch**[`matplotlib.patches.StepPatch`](matplotlib.patches.steppatch#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
[`StepPatch`](matplotlib.patches.steppatch#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch") properties
Examples using `matplotlib.pyplot.stairs`
-----------------------------------------
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
| programming_docs |
matplotlib matplotlib.axes.Axes.get_rasterization_zorder matplotlib.axes.Axes.get\_rasterization\_zorder
===============================================
Axes.get\_rasterization\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2795-L2797)
Return the zorder value below which artists will be rasterized.
matplotlib matplotlib.axes.Axes.csd matplotlib.axes.Axes.csd
========================
Axes.csd(*x*, *y*, *NFFT=None*, *Fs=None*, *Fc=None*, *detrend=None*, *window=None*, *noverlap=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*, *return\_line=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7167-L7267)
Plot the cross-spectral density.
The cross spectral density \(P\_{xy}\) by Welch's average periodogram method. The vectors *x* and *y* are divided into *NFFT* length segments. Each segment is detrended by function *detrend* and windowed by function *window*. *noverlap* gives the length of the overlap between segments. The product of the direct FFTs of *x* and *y* are averaged over each segment to compute \(P\_{xy}\), with a scaling to correct for power loss due to windowing.
If len(*x*) < *NFFT* or len(*y*) < *NFFT*, they will be zero padded to *NFFT*.
Parameters:
**x, y**1-D arrays or sequences
Arrays or sequences containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](../mlab_api#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between segments.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
**return\_line**bool, default: False
Whether to include the line object plotted in the returned values.
Returns:
**Pxy**1-D array
The values for the cross spectrum \(P\_{xy}\) before scaling (complex valued).
**freqs**1-D array
The frequencies corresponding to the elements in *Pxy*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function. Only returned if *return\_line* is True.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`psd`](matplotlib.axes.axes.psd#matplotlib.axes.Axes.psd "matplotlib.axes.Axes.psd")
is equivalent to setting `y = x`.
#### Notes
For plotting, the power is plotted as \(10 \log\_{10}(P\_{xy})\) for decibels, though \(P\_{xy}\) itself is returned.
#### References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
Examples using `matplotlib.axes.Axes.csd`
-----------------------------------------
[CSD Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/csd_demo.html#sphx-glr-gallery-lines-bars-and-markers-csd-demo-py)
CSD Demo
matplotlib matplotlib.artist.Artist.set matplotlib.artist.Artist.set
============================
Artist.set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1190-L1194)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.artist.Artist.set`
---------------------------------------------
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Simple Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py)
Simple Plot
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Creating multiple subplots using plt.subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-demo-py)
Creating multiple subplots using ``plt.subplots``
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Hexagonal binned plot](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html#sphx-glr-gallery-statistics-hexbin-demo-py)
Hexagonal binned plot
[Nested pie charts](https://matplotlib.org/stable/gallery/pie_and_polar_charts/nested_pie.html#sphx-glr-gallery-pie-and-polar-charts-nested-pie-py)
Nested pie charts
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Arrow Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/arrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-arrow-demo-py)
Arrow Demo
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Text Commands](https://matplotlib.org/stable/gallery/pyplots/text_commands.html#sphx-glr-gallery-pyplots-text-commands-py)
Text Commands
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Animated 3D random walk](https://matplotlib.org/stable/gallery/animation/random_walk.html#sphx-glr-gallery-animation-random-walk-py)
Animated 3D random walk
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Manual Contour](https://matplotlib.org/stable/gallery/misc/contour_manual.html#sphx-glr-gallery-misc-contour-manual-py)
Manual Contour
[Plotting with keywords](https://matplotlib.org/stable/gallery/misc/keyword_plotting.html#sphx-glr-gallery-misc-keyword-plotting-py)
Plotting with keywords
[3D box surface plot](https://matplotlib.org/stable/gallery/mplot3d/box3d.html#sphx-glr-gallery-mplot3d-box3d-py)
3D box surface plot
[Projecting contour profiles onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html#sphx-glr-gallery-mplot3d-contour3d-3-py)
Projecting contour profiles onto a graph
[Projecting filled contour onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contourf3d_2.html#sphx-glr-gallery-mplot3d-contourf3d-2-py)
Projecting filled contour onto a graph
[Generate polygons to fill under 3D line graph](https://matplotlib.org/stable/gallery/mplot3d/polys3d.html#sphx-glr-gallery-mplot3d-polys3d-py)
Generate polygons to fill under 3D line graph
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
[3D voxel / volumetric plot with rgb colors](https://matplotlib.org/stable/gallery/mplot3d/voxels_rgb.html#sphx-glr-gallery-mplot3d-voxels-rgb-py)
3D voxel / volumetric plot with rgb colors
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Connection styles for annotations](https://matplotlib.org/stable/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py)
Connection styles for annotations
[Nested GridSpecs](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec06.html#sphx-glr-gallery-userdemo-demo-gridspec06-py)
Nested GridSpecs
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Mouse Cursor](https://matplotlib.org/stable/gallery/widgets/mouse_cursor.html#sphx-glr-gallery-widgets-mouse-cursor-py)
Mouse Cursor
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[plot(x, y)](https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py)
plot(x, y)
[scatter(x, y)](https://matplotlib.org/stable/plot_types/basic/scatter_plot.html#sphx-glr-plot-types-basic-scatter-plot-py)
scatter(x, y)
[bar(x, height)](https://matplotlib.org/stable/plot_types/basic/bar.html#sphx-glr-plot-types-basic-bar-py)
bar(x, height)
[stem(x, y)](https://matplotlib.org/stable/plot_types/basic/stem.html#sphx-glr-plot-types-basic-stem-py)
stem(x, y)
[step(x, y)](https://matplotlib.org/stable/plot_types/basic/step.html#sphx-glr-plot-types-basic-step-py)
step(x, y)
[fill\_between(x, y1, y2)](https://matplotlib.org/stable/plot_types/basic/fill_between.html#sphx-glr-plot-types-basic-fill-between-py)
fill\_between(x, y1, y2)
[stackplot(x, y)](https://matplotlib.org/stable/plot_types/basic/stackplot.html#sphx-glr-plot-types-basic-stackplot-py)
stackplot(x, y)
[barbs(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/barbs.html#sphx-glr-plot-types-arrays-barbs-py)
barbs(X, Y, U, V)
[quiver(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/quiver.html#sphx-glr-plot-types-arrays-quiver-py)
quiver(X, Y, U, V)
[hist(x)](https://matplotlib.org/stable/plot_types/stats/hist_plot.html#sphx-glr-plot-types-stats-hist-plot-py)
hist(x)
[boxplot(X)](https://matplotlib.org/stable/plot_types/stats/boxplot_plot.html#sphx-glr-plot-types-stats-boxplot-plot-py)
boxplot(X)
[errorbar(x, y, yerr, xerr)](https://matplotlib.org/stable/plot_types/stats/errorbar_plot.html#sphx-glr-plot-types-stats-errorbar-plot-py)
errorbar(x, y, yerr, xerr)
[violinplot(D)](https://matplotlib.org/stable/plot_types/stats/violin.html#sphx-glr-plot-types-stats-violin-py)
violinplot(D)
[eventplot(D)](https://matplotlib.org/stable/plot_types/stats/eventplot.html#sphx-glr-plot-types-stats-eventplot-py)
eventplot(D)
[hist2d(x, y)](https://matplotlib.org/stable/plot_types/stats/hist2d.html#sphx-glr-plot-types-stats-hist2d-py)
hist2d(x, y)
[hexbin(x, y, C)](https://matplotlib.org/stable/plot_types/stats/hexbin.html#sphx-glr-plot-types-stats-hexbin-py)
hexbin(x, y, C)
[pie(x)](https://matplotlib.org/stable/plot_types/stats/pie.html#sphx-glr-plot-types-stats-pie-py)
pie(x)
[tricontour(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontour.html#sphx-glr-plot-types-unstructured-tricontour-py)
tricontour(x, y, z)
[tricontourf(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py)
tricontourf(x, y, z)
[tripcolor(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tripcolor.html#sphx-glr-plot-types-unstructured-tripcolor-py)
tripcolor(x, y, z)
[triplot(x, y)](https://matplotlib.org/stable/plot_types/unstructured/triplot.html#sphx-glr-plot-types-unstructured-triplot-py)
triplot(x, y)
| programming_docs |
matplotlib matplotlib.pyplot.axvline matplotlib.pyplot.axvline
=========================
matplotlib.pyplot.axvline(*x=0*, *ymin=0*, *ymax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2339-L2341)
Add a vertical line across the Axes.
Parameters:
**x**float, default: 0
x position in data coordinates of the vertical line.
**ymin**float, default: 0
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
**ymax**float, default: 1
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
Returns:
[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Other Parameters:
**\*\*kwargs**
Valid keyword arguments are [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties, with the exception of 'transform':
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`vlines`](matplotlib.pyplot.vlines#matplotlib.pyplot.vlines "matplotlib.pyplot.vlines")
Add vertical lines in data coordinates.
[`axvspan`](matplotlib.pyplot.axvspan#matplotlib.pyplot.axvspan "matplotlib.pyplot.axvspan")
Add a vertical span (rectangle) across the axis.
[`axline`](matplotlib.pyplot.axline#matplotlib.pyplot.axline "matplotlib.pyplot.axline")
Add a line with an arbitrary slope.
#### Examples
* draw a thick red vline at *x* = 0 that spans the yrange:
```
>>> axvline(linewidth=4, color='r')
```
* draw a default vline at *x* = 1 that spans the yrange:
```
>>> axvline(x=1)
```
* draw a default vline at *x* = .5 that spans the middle half of the yrange:
```
>>> axvline(x=.5, ymin=0.25, ymax=0.75)
```
Examples using `matplotlib.pyplot.axvline`
------------------------------------------
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
matplotlib matplotlib.axis.Axis.get_label_text matplotlib.axis.Axis.get\_label\_text
=====================================
Axis.get\_label\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1507-L1509)
Get the text of the label.
matplotlib matplotlib.pyplot.sci matplotlib.pyplot.sci
=====================
matplotlib.pyplot.sci(*im*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2992-L2994)
Set the current image.
This image will be the target of colormap functions like `pyplot.viridis`, and other functions such as [`clim`](matplotlib.pyplot.clim#matplotlib.pyplot.clim "matplotlib.pyplot.clim"). The current image is an attribute of the current Axes.
Examples using `matplotlib.pyplot.sci`
--------------------------------------
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
matplotlib matplotlib.artist.Artist.get_tightbbox matplotlib.artist.Artist.get\_tightbbox
=======================================
Artist.get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
matplotlib matplotlib.colors.NoNorm matplotlib.colors.NoNorm
========================
*class*matplotlib.colors.NoNorm(*vmin=None*, *vmax=None*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L2031-L2040)
Bases: [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
Dummy replacement for [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), for the case where we want to use indices directly in a [`ScalarMappable`](../cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable").
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L2036-L2037)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L2039-L2040)
matplotlib mpl_toolkits.axisartist.angle_helper.LocatorD mpl\_toolkits.axisartist.angle\_helper.LocatorD
===============================================
*class*mpl\_toolkits.axisartist.angle\_helper.LocatorD(*nbins*, *include\_last=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L180-L183)
Bases: [`LocatorBase`](mpl_toolkits.axisartist.angle_helper.locatorbase#mpl_toolkits.axisartist.angle_helper.LocatorBase "mpl_toolkits.axisartist.angle_helper.LocatorBase")
\_\_call\_\_(*v1*, *v2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L181-L183)
Call self as a function.
matplotlib matplotlib.axes.Axes.get_legend_handles_labels matplotlib.axes.Axes.get\_legend\_handles\_labels
=================================================
Axes.get\_legend\_handles\_labels(*legend\_handler\_map=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L172-L184)
Return handles and labels for legend
`ax.legend()` is equivalent to
```
h, l = ax.get_legend_handles_labels()
ax.legend(h, l)
```
Examples using `matplotlib.axes.Axes.get_legend_handles_labels`
---------------------------------------------------------------
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
matplotlib matplotlib.axis.Axis.get_major_ticks matplotlib.axis.Axis.get\_major\_ticks
======================================
Axis.get\_major\_ticks(*numticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1527-L1538)
Return the list of major [`Tick`](../axis_api#matplotlib.axis.Tick "matplotlib.axis.Tick")s.
matplotlib matplotlib.pyplot.fill_betweenx matplotlib.pyplot.fill\_betweenx
================================
matplotlib.pyplot.fill\_betweenx(*y*, *x1*, *x2=0*, *where=None*, *step=None*, *interpolate=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2520-L2526)
Fill the area between two vertical curves.
The curves are defined by the points (*y*, *x1*) and (*y*, *x2*). This creates one or multiple polygons describing the filled area.
You may exclude some vertical sections from filling using *where*.
By default, the edges connect the given points directly. Use *step* if the filling should be a step function, i.e. constant in between *y*.
Parameters:
**y**array (length N)
The y coordinates of the nodes defining the curves.
**x1**array (length N) or scalar
The x coordinates of the nodes defining the first curve.
**x2**array (length N) or scalar, default: 0
The x coordinates of the nodes defining the second curve.
**where**array of bool (length N), optional
Define *where* to exclude some vertical regions from being filled. The filled regions are defined by the coordinates `y[where]`. More precisely, fill between `y[i]` and `y[i+1]` if `where[i] and where[i+1]`. Note that this definition implies that an isolated *True* value between two *False* values in *where* will not result in filling. Both sides of the *True* position remain unfilled due to the adjacent *False* values.
**interpolate**bool, default: False
This option is only relevant if *where* is used and the two curves are crossing each other.
Semantically, *where* is often used for *x1* > *x2* or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the *y* array. Such a polygon cannot describe the above semantics close to the intersection. The y-sections containing the intersection are simply clipped.
Setting *interpolate* to *True* will calculate the actual intersection point and extend the filled region up to this point.
**step**{'pre', 'post', 'mid'}, optional
Define *step* if the filling should be a step function, i.e. constant in between *y*. The value determines where the step will occur:
* 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval `(x[i-1], x[i]]` has the value `y[i]`.
* 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval `[x[i], x[i+1])` has the value `y[i]`.
* 'mid': Steps occur half-way between the *x* positions.
Returns:
[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") containing the plotted polygons.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*y*, *x1*, *x2*, *where*
**\*\*kwargs**
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"). They control the [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`fill_between`](matplotlib.pyplot.fill_between#matplotlib.pyplot.fill_between "matplotlib.pyplot.fill_between")
Fill between two sets of y-values.
[`fill_betweenx`](#matplotlib.pyplot.fill_betweenx "matplotlib.pyplot.fill_betweenx")
Fill between two sets of x-values.
| programming_docs |
matplotlib matplotlib.axes.Axes.cohere matplotlib.axes.Axes.cohere
===========================
Axes.cohere(*x*, *y*, *NFFT=256*, *Fs=2*, *Fc=0*, *detrend=<function detrend\_none>*, *window=<function window\_hanning>*, *noverlap=0*, *pad\_to=None*, *sides='default'*, *scale\_by\_freq=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7493-L7555)
Plot the coherence between *x* and *y*.
Coherence is the normalized cross spectral density:
\[C\_{xy} = \frac{|P\_{xy}|^2}{P\_{xx}P\_{yy}}\] Parameters:
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](../mlab_api#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**noverlap**int, default: 0 (no overlap)
The number of points of overlap between blocks.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**Cxy**1-D array
The coherence vector.
**freqs**1-D array
The frequencies for the elements in *Cxy*.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
#### References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
matplotlib matplotlib.axis.Axis.pickradius matplotlib.axis.Axis.pickradius
===============================
*property*Axis.pickradius
The acceptance radius for containment tests. See also [`Axis.contains`](matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
matplotlib matplotlib.artist.Artist.set_clip_on matplotlib.artist.Artist.set\_clip\_on
======================================
Artist.set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
Examples using `matplotlib.artist.Artist.set_clip_on`
-----------------------------------------------------
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
matplotlib matplotlib.axes.Axes.secondary_xaxis matplotlib.axes.Axes.secondary\_xaxis
=====================================
Axes.secondary\_xaxis(*location*, *\**, *functions=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L541-L581)
Add a second x-axis to this Axes.
For example if we want to have a second scale for the data plotted on the xaxis.
Parameters:
**location**{'top', 'bottom', 'left', 'right'} or float
The position to put the secondary axis. Strings can be 'top' or 'bottom' for orientation='x' and 'right' or 'left' for orientation='y'. A float indicates the relative position on the parent axes to put the new axes, 0.0 being the bottom (or left) and 1.0 being the top (or right).
**functions**2-tuple of func, or Transform with an inverse
If a 2-tuple of functions, the user specifies the transform function and its inverse. i.e. `functions=(lambda x: 2 / x, lambda x: 2 / x)` would be an reciprocal transform with a factor of 2. Both functions must accept numpy arrays as input.
The user can also directly supply a subclass of [`transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") so long as it has an inverse.
See [Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html) for examples of making these conversions.
Returns:
**ax**axes.\_secondary\_axes.SecondaryAxis
Other Parameters:
**\*\*kwargs**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") properties.
Other miscellaneous axes parameters.
Warning
This method is experimental as of 3.1, and the API may change.
#### Examples
The main axis shows frequency, and the secondary axis shows period.
([Source code](matplotlib-axes-axes-secondary_xaxis-1.py), [png](matplotlib-axes-axes-secondary_xaxis-1.png))
Examples using `matplotlib.axes.Axes.secondary_xaxis`
-----------------------------------------------------
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib matplotlib.artist.Artist.get_picker matplotlib.artist.Artist.get\_picker
====================================
Artist.get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker").
See also
[`set_picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker"), [`pickable`](matplotlib.artist.artist.pickable#matplotlib.artist.Artist.pickable "matplotlib.artist.Artist.pickable"), [`pick`](matplotlib.artist.artist.pick#matplotlib.artist.Artist.pick "matplotlib.artist.Artist.pick")
matplotlib matplotlib.axes.Axes.secondary_yaxis matplotlib.axes.Axes.secondary\_yaxis
=====================================
Axes.secondary\_yaxis(*location*, *\**, *functions=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L583-L613)
Add a second y-axis to this Axes.
For example if we want to have a second scale for the data plotted on the yaxis.
Parameters:
**location**{'top', 'bottom', 'left', 'right'} or float
The position to put the secondary axis. Strings can be 'top' or 'bottom' for orientation='x' and 'right' or 'left' for orientation='y'. A float indicates the relative position on the parent axes to put the new axes, 0.0 being the bottom (or left) and 1.0 being the top (or right).
**functions**2-tuple of func, or Transform with an inverse
If a 2-tuple of functions, the user specifies the transform function and its inverse. i.e. `functions=(lambda x: 2 / x, lambda x: 2 / x)` would be an reciprocal transform with a factor of 2. Both functions must accept numpy arrays as input.
The user can also directly supply a subclass of [`transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") so long as it has an inverse.
See [Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html) for examples of making these conversions.
Returns:
**ax**axes.\_secondary\_axes.SecondaryAxis
Other Parameters:
**\*\*kwargs**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") properties.
Other miscellaneous axes parameters.
Warning
This method is experimental as of 3.1, and the API may change.
#### Examples
Add a secondary Axes that converts from radians to degrees
([Source code](matplotlib-axes-axes-secondary_yaxis-1.py), [png](matplotlib-axes-axes-secondary_yaxis-1.png))
Examples using `matplotlib.axes.Axes.secondary_yaxis`
-----------------------------------------------------
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
matplotlib matplotlib.axis.Axis.get_major_locator matplotlib.axis.Axis.get\_major\_locator
========================================
Axis.get\_major\_locator()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1511-L1513)
Get the locator of the major ticker.
Examples using `matplotlib.axis.Axis.get_major_locator`
-------------------------------------------------------
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
| programming_docs |
matplotlib matplotlib.lines.VertexSelector matplotlib.lines.VertexSelector
===============================
*class*matplotlib.lines.VertexSelector(*line*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1514-L1584)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Manage the callbacks to maintain a list of selected vertices for [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). Derived classes should override the [`process_selected`](#matplotlib.lines.VertexSelector.process_selected "matplotlib.lines.VertexSelector.process_selected") method to do something with the picks.
Here is an example which highlights the selected verts with red circles:
```
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
class HighlightSelected(lines.VertexSelector):
def __init__(self, line, fmt='ro', **kwargs):
super().__init__(line)
self.markers, = self.axes.plot([], [], fmt, **kwargs)
def process_selected(self, ind, xs, ys):
self.markers.set_data(xs, ys)
self.canvas.draw()
fig, ax = plt.subplots()
x, y = np.random.rand(2, 30)
line, = ax.plot(x, y, 'bs-', picker=5)
selector = HighlightSelected(line)
plt.show()
```
Parameters:
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line must already have been added to an [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") and must have its picker property set.
*property*canvas
onpick(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1577-L1584)
When the line is picked, update the set of selected indices.
process\_selected(*ind*, *xs*, *ys*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1564-L1575)
Default "do nothing" implementation of the [`process_selected`](#matplotlib.lines.VertexSelector.process_selected "matplotlib.lines.VertexSelector.process_selected") method.
Parameters:
**ind**list of int
The indices of the selected vertices.
**xs, ys**array-like
The coordinates of the selected vertices.
matplotlib matplotlib.animation.FileMovieWriter matplotlib.animation.FileMovieWriter
====================================
*class*matplotlib.animation.FileMovieWriter(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L379-L476)
[`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") for writing to individual files and stitching at the end.
This must be sub-classed to be useful.
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
\_\_init\_\_(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L385-L387)
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.FileMovieWriter.__init__ "matplotlib.animation.FileMovieWriter.__init__")(\*args, \*\*kwargs) | Parameters:
|
| `bin_path`() | Return the binary path to the commandline tool used by a specific subclass. |
| [`finish`](#matplotlib.animation.FileMovieWriter.finish "matplotlib.animation.FileMovieWriter.finish")() | Finish any processing for writing the movie. |
| [`grab_frame`](#matplotlib.animation.FileMovieWriter.grab_frame "matplotlib.animation.FileMovieWriter.grab_frame")(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| `isAvailable`() | Return whether a MovieWriter subclass is actually available. |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| [`setup`](#matplotlib.animation.FileMovieWriter.setup "matplotlib.animation.FileMovieWriter.setup")(fig, outfile[, dpi, frame\_prefix]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| [`frame_format`](#matplotlib.animation.FileMovieWriter.frame_format "matplotlib.animation.FileMovieWriter.frame_format") | Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses. |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
| `supported_formats` | |
finish()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L465-L476)
Finish any processing for writing the movie.
*property*frame\_format
Format (png, jpeg, etc.) to use for saving the frames, which can be decided by the individual subclasses.
grab\_frame(*\*\*savefig\_kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L453-L463)
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *savefig\_kwargs* are passed on to the [`savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") call that saves the figure.
setup(*fig*, *outfile*, *dpi=None*, *frame\_prefix=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L389-L423)
Setup for writing the movie file.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure to grab the rendered frames from.
**outfile**str
The filename of the resulting movie file.
**dpi**float, default: `fig.dpi`
The dpi of the output file. This, with the figure size, controls the size in pixels of the resulting movie file.
**frame\_prefix**str, optional
The filename prefix to use for temporary files. If *None* (the default), files are written to a temporary directory which is deleted by `cleanup`; if not *None*, no temporary files are deleted.
matplotlib matplotlib.axes.Axes.get_xticklines matplotlib.axes.Axes.get\_xticklines
====================================
Axes.get\_xticklines(*minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the xaxis' tick lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
matplotlib mpl_toolkits.mplot3d.art3d.line_2d_to_3d mpl\_toolkits.mplot3d.art3d.line\_2d\_to\_3d
============================================
mpl\_toolkits.mplot3d.art3d.line\_2d\_to\_3d(*line*, *zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L222-L226)
Convert a 2D line to 3D.
matplotlib matplotlib.axes.Axes.set_autoscalex_on matplotlib.axes.Axes.set\_autoscalex\_on
========================================
Axes.set\_autoscalex\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set whether the xaxis is autoscaled when drawing or by [`Axes.autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view").
Parameters:
**b**bool
matplotlib mpl_toolkits.mplot3d.art3d.PathPatch3D mpl\_toolkits.mplot3d.art3d.PathPatch3D
=======================================
*class*mpl\_toolkits.mplot3d.art3d.PathPatch3D(*path*, *\**, *zs=()*, *zdir='z'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L349-L369)
Bases: [`Patch3D`](mpl_toolkits.mplot3d.art3d.patch3d#mpl_toolkits.mplot3d.art3d.Patch3D "mpl_toolkits.mplot3d.art3d.Patch3D")
3D PathPatch object.
The following kwarg properties are supported
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
do\_3d\_projection()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L363-L369)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`3d_properties`](#mpl_toolkits.mplot3d.art3d.PathPatch3D.set_3d_properties "mpl_toolkits.mplot3d.art3d.PathPatch3D.set_3d_properties") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_3d\_properties(*path*, *zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L359-L361)
Examples using `mpl_toolkits.mplot3d.art3d.PathPatch3D`
-------------------------------------------------------
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.axes_divider.AxesLocator mpl\_toolkits.axes\_grid1.axes\_divider.AxesLocator
===================================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.AxesLocator(*axes\_divider*, *nx*, *ny*, *nx1=None*, *ny1=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L291-L349)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A callable object which returns the position and size of a given AxesDivider cell.
Parameters:
**axes\_divider**AxesDivider
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
**ny, ny1**int
Same as *nx* and *nx1*, but for row positions.
\_\_call\_\_(*axes*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L333-L343)
Call self as a function.
get\_subplotspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L345-L349)
matplotlib matplotlib.pyplot.axhline matplotlib.pyplot.axhline
=========================
matplotlib.pyplot.axhline(*y=0*, *xmin=0*, *xmax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2315-L2317)
Add a horizontal line across the Axes.
Parameters:
**y**float, default: 0
y position in data coordinates of the horizontal line.
**xmin**float, default: 0
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
**xmax**float, default: 1
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
Returns:
[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Other Parameters:
**\*\*kwargs**
Valid keyword arguments are [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties, with the exception of 'transform':
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`hlines`](matplotlib.pyplot.hlines#matplotlib.pyplot.hlines "matplotlib.pyplot.hlines")
Add horizontal lines in data coordinates.
[`axhspan`](matplotlib.pyplot.axhspan#matplotlib.pyplot.axhspan "matplotlib.pyplot.axhspan")
Add a horizontal span (rectangle) across the axis.
[`axline`](matplotlib.pyplot.axline#matplotlib.pyplot.axline "matplotlib.pyplot.axline")
Add a line with an arbitrary slope.
#### Examples
* draw a thick red hline at 'y' = 0 that spans the xrange:
```
>>> axhline(linewidth=4, color='r')
```
* draw a default hline at 'y' = 1 that spans the xrange:
```
>>> axhline(y=1)
```
* draw a default hline at 'y' = .5 that spans the middle half of the xrange:
```
>>> axhline(y=.5, xmin=0.25, xmax=0.75)
```
Examples using `matplotlib.pyplot.axhline`
------------------------------------------
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
matplotlib matplotlib.axes.Axes.stem matplotlib.axes.Axes.stem
=========================
Axes.stem(*\*args*, *linefmt=None*, *markerfmt=None*, *basefmt=None*, *bottom=0*, *label=None*, *use\_line\_collection=<deprecated parameter>*, *orientation='vertical'*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L2843-L3034)
Create a stem plot.
A stem plot draws lines perpendicular to a baseline at each location *locs* from the baseline to *heads*, and places a marker there. For vertical stem plots (the default), the *locs* are *x* positions, and the *heads* are *y* values. For horizontal stem plots, the *locs* are *y* positions, and the *heads* are *x* values.
Call signature:
```
stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None)
```
The *locs*-positions are optional. The formats may be provided either as positional or as keyword-arguments. Passing *markerfmt* and *basefmt* positionally is deprecated since Matplotlib 3.5.
Parameters:
**locs**array-like, default: (0, 1, ..., len(heads) - 1)
For vertical stem plots, the x-positions of the stems. For horizontal stem plots, the y-positions of the stems.
**heads**array-like
For vertical stem plots, the y-values of the stem heads. For horizontal stem plots, the x-values of the stem heads.
**linefmt**str, optional
A string defining the color and/or linestyle of the vertical lines:
| Character | Line Style |
| --- | --- |
| `'-'` | solid line |
| `'--'` | dashed line |
| `'-.'` | dash-dot line |
| `':'` | dotted line |
Default: 'C0-', i.e. solid line with the first color of the color cycle.
Note: Markers specified through this parameter (e.g. 'x') will be silently ignored (unless using `use_line_collection=False`). Instead, markers should be specified using *markerfmt*.
**markerfmt**str, optional
A string defining the color and/or shape of the markers at the stem heads. If the marker is not given, use the marker 'o', i.e. filled circles. If the color is not given, use the color from *linefmt*.
**basefmt**str, default: 'C3-' ('C2-' in classic mode)
A format string defining the properties of the baseline.
**orientation**str, default: 'vertical'
If 'vertical', will produce a plot with stems oriented vertically, otherwise the stems will be oriented horizontally.
**bottom**float, default: 0
The y/x-position of the baseline (depending on orientation).
**label**str, default: None
The label to use for the stems in legends.
**use\_line\_collection**bool, default: True
*Deprecated since 3.6*
If `True`, store and plot the stem lines as a [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instead of individual lines, which significantly increases performance. If `False`, defaults to the old behavior of using a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") objects.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
Returns:
[`StemContainer`](../container_api#matplotlib.container.StemContainer "matplotlib.container.StemContainer")
The container may be treated like a tuple (*markerline*, *stemlines*, *baseline*)
#### Notes
See also
The MATLAB function [stem](https://www.mathworks.com/help/matlab/ref/stem.html) which inspired this method.
Examples using `matplotlib.axes.Axes.stem`
------------------------------------------
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
[stem(x, y)](https://matplotlib.org/stable/plot_types/basic/stem.html#sphx-glr-plot-types-basic-stem-py)
stem(x, y)
matplotlib matplotlib.axes.Axes.in_axes matplotlib.axes.Axes.in\_axes
=============================
Axes.in\_axes(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2606-L2610)
Return whether the given event (in display coords) is in the Axes.
matplotlib matplotlib.axes.Axes.barh matplotlib.axes.Axes.barh
=========================
Axes.barh(*y*, *width*, *height=0.8*, *left=None*, *\**, *align='center'*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L2502-L2617)
Make a horizontal bar plot.
The bars are positioned at *y* with the given *align*ment. Their dimensions are given by *width* and *height*. The horizontal baseline is *left* (default 0).
Many parameters can take either a single value applying to all bars or a sequence of values, one for each bar.
Parameters:
**y**float or array-like
The y coordinates of the bars. See also *align* for the alignment of the bars to the coordinates.
**width**float or array-like
The width(s) of the bars.
**height**float or array-like, default: 0.8
The heights of the bars.
**left**float or array-like, default: 0
The x coordinates of the left side(s) of the bars.
**align**{'center', 'edge'}, default: 'center'
Alignment of the base to the *y* coordinates\*:
* 'center': Center the bars on the *y* positions.
* 'edge': Align the bottom edges of the bars with the *y* positions.
To align the bars on the top edge pass a negative *height* and `align='edge'`.
Returns:
[`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer")
Container with all the bars and optionally errorbars.
Other Parameters:
**color**color or list of color, optional
The colors of the bar faces.
**edgecolor**color or list of color, optional
The colors of the bar edges.
**linewidth**float or array-like, optional
Width of the bar edge(s). If 0, don't draw edges.
**tick\_label**str or list of str, optional
The tick labels of the bars. Default: None (Use default numeric labels.)
**label**str or list of str, optional
A single label is attached to the resulting [`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer") as a label for the whole dataset. If a list is provided, it must be the same length as *y* and labels the individual bars. Repeated labels are not de-duplicated and will cause repeated label entries, so this is best used when bars also differ in style (e.g., by passing a list to *color*.)
**xerr, yerr**float or array-like of shape(N,) or shape(2, N), optional
If not *None*, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data:
* scalar: symmetric +/- values for all bars
* shape(N,): symmetric +/- values for each bar
* shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.
* *None*: No errorbar. (default)
See [Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html) for an example on the usage of *xerr* and *yerr*.
**ecolor**color or list of color, default: 'black'
The line color of the errorbars.
**capsize**float, default: `[rcParams["errorbar.capsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=errorbar.capsize#matplotlibrc-sample)` (default: `0.0`)
The length of the error bar caps in points.
**error\_kw**dict, optional
Dictionary of keyword arguments to be passed to the [`errorbar`](matplotlib.axes.axes.errorbar#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar") method. Values of *ecolor* or *capsize* defined here take precedence over the independent keyword arguments.
**log**bool, default: False
If `True`, set the x-axis to be log scale.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_angle "matplotlib.patches.Rectangle.set_angle") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_bounds "matplotlib.patches.Rectangle.set_bounds") | (left, bottom, width, height) |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_height "matplotlib.patches.Rectangle.set_height") | unknown |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_width "matplotlib.patches.Rectangle.set_width") | unknown |
| [`x`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_x "matplotlib.patches.Rectangle.set_x") | unknown |
| [`xy`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_xy "matplotlib.patches.Rectangle.set_xy") | (float, float) |
| [`y`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_y "matplotlib.patches.Rectangle.set_y") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`bar`](matplotlib.axes.axes.bar#matplotlib.axes.Axes.bar "matplotlib.axes.Axes.bar")
Plot a vertical bar plot.
#### Notes
Stacked bars can be achieved by passing individual *left* values per bar. See [Discrete distribution as horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/horizontal_barchart_distribution.html).
Examples using `matplotlib.axes.Axes.barh`
------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Producing multiple histograms side by side](https://matplotlib.org/stable/gallery/statistics/multiple_histograms_side_by_side.html#sphx-glr-gallery-statistics-multiple-histograms-side-by-side-py)
Producing multiple histograms side by side
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
| programming_docs |
matplotlib matplotlib.axes.Axes.get_anchor matplotlib.axes.Axes.get\_anchor
================================
Axes.get\_anchor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1816-L1827)
Get the anchor location.
See also
[`matplotlib.axes.Axes.set_anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor")
for a description of the anchor.
[`matplotlib.axes.Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect")
for a description of aspect handling.
matplotlib matplotlib.axes.Axes.format_cursor_data matplotlib.axes.Axes.format\_cursor\_data
=========================================
Axes.format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](matplotlib.axes.axes.get_cursor_data#matplotlib.axes.Axes.get_cursor_data "matplotlib.axes.Axes.get_cursor_data")
matplotlib mpl_toolkits.mplot3d.proj3d.transform mpl\_toolkits.mplot3d.proj3d.transform
======================================
mpl\_toolkits.mplot3d.proj3d.transform(*xs*, *ys*, *zs*, *M*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L154-L159)
Transform the points by the projection matrix
matplotlib mpl_toolkits.axisartist.axisline_style.AxislineStyle mpl\_toolkits.axisartist.axisline\_style.AxislineStyle
======================================================
*class*mpl\_toolkits.axisartist.axisline\_style.AxislineStyle(*stylename*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L74-L145)
Bases: `_Style`
A container class which defines style classes for AxisArtists.
An instance of any axisline style class is an callable object, whose call signature is
```
__call__(self, axis_artist, path, transform)
```
When called, this should return an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") with the following methods:
```
def set_path(self, path):
# set the path for axisline.
def set_line_mutation_scale(self, scale):
# set the scale
def draw(self, renderer):
# draw
```
Return the instance of the subclass with the given style name.
*class*FilledArrow(*size=1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L142-L143)
Bases: [`SimpleArrow`](#mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow "mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow")
Parameters:
**size**float
Size of the arrow as a fraction of the ticklabel size.
ArrowAxisClass[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L69-L71)
alias of `FilledArrow`
*class*SimpleArrow(*size=1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L115-L138)
Bases: `_Base`
A simple arrow.
Parameters:
**size**float
Size of the arrow as a fraction of the ticklabel size.
ArrowAxisClass[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L11-L67)
alias of `SimpleArrow`
new\_line(*axis\_artist*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axisline_style.py#L133-L138)
matplotlib matplotlib.axes.Axes.loglog matplotlib.axes.Axes.loglog
===========================
Axes.loglog(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L1753-L1804)
Make a plot with log scaling on both the x and y axis.
Call signatures:
```
loglog([x], y, [fmt], data=None, **kwargs)
loglog([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
```
This is just a thin wrapper around [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") which additionally changes both the x-axis and the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well.
The additional parameters *base*, *subs* and *nonpositive* control the x/y-axis properties. They are just forwarded to [`Axes.set_xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") and [`Axes.set_yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale"). To use different properties on the x-axis and the y-axis, use e.g. `ax.set_xscale("log", base=10); ax.set_yscale("log", base=2)`.
Parameters:
**base**float, default: 10
Base of the logarithm.
**subs**sequence, optional
The location of the minor ticks. If *None*, reasonable locations are automatically chosen depending on the number of decades in the plot. See [`Axes.set_xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale")/[`Axes.set_yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") for details.
**nonpositive**{'mask', 'clip'}, default: 'mask'
Non-positive values can be masked as invalid, or clipped to a very small positive number.
**\*\*kwargs**
All parameters supported by [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Objects representing the plotted data.
Examples using `matplotlib.axes.Axes.loglog`
--------------------------------------------
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
matplotlib mpl_toolkits.axisartist.clip_path.clip_line_to_rect mpl\_toolkits.axisartist.clip\_path.clip\_line\_to\_rect
========================================================
mpl\_toolkits.axisartist.clip\_path.clip\_line\_to\_rect(*xline*, *yline*, *bbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/clip_path.py#L83-L121)
matplotlib mpl_toolkits.axisartist.grid_helper_curvelinear mpl\_toolkits.axisartist.grid\_helper\_curvelinear
==================================================
An experimental support for curvilinear grid.
Classes
-------
| | |
| --- | --- |
| [`FixedAxisArtistHelper`](mpl_toolkits.axisartist.grid_helper_curvelinear.fixedaxisartisthelper#mpl_toolkits.axisartist.grid_helper_curvelinear.FixedAxisArtistHelper "mpl_toolkits.axisartist.grid_helper_curvelinear.FixedAxisArtistHelper")(grid\_helper, side[, ...]) | Helper class for a fixed axis. |
| [`FloatingAxisArtistHelper`](mpl_toolkits.axisartist.grid_helper_curvelinear.floatingaxisartisthelper#mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper "mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper")(grid\_helper, ...[, ...]) | nth\_coord = along which coordinate value varies. |
| [`GridHelperCurveLinear`](mpl_toolkits.axisartist.grid_helper_curvelinear.gridhelpercurvelinear#mpl_toolkits.axisartist.grid_helper_curvelinear.GridHelperCurveLinear "mpl_toolkits.axisartist.grid_helper_curvelinear.GridHelperCurveLinear")(aux\_trans[, ...]) | aux\_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate. |
matplotlib matplotlib.artist.Artist.set_gid matplotlib.artist.Artist.set\_gid
=================================
Artist.set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
Examples using `matplotlib.artist.Artist.set_gid`
-------------------------------------------------
[SVG Filter Pie](https://matplotlib.org/stable/gallery/misc/svg_filter_pie.html#sphx-glr-gallery-misc-svg-filter-pie-py)
SVG Filter Pie
matplotlib matplotlib.axes.Axes.set_position matplotlib.axes.Axes.set\_position
==================================
Axes.set\_position(*pos*, *which='both'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1063-L1089)
Set the Axes position.
Axes have two position attributes. The 'original' position is the position allocated for the Axes. The 'active' position is the position the Axes is actually drawn at. These positions are usually the same unless a fixed aspect is set to the Axes. See [`Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") for details.
Parameters:
**pos**[left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The new position of the Axes in [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**which**{'both', 'active', 'original'}, default: 'both'
Determines which position variables to change.
See also
[`matplotlib.transforms.Bbox.from_bounds`](../transformations#matplotlib.transforms.Bbox.from_bounds "matplotlib.transforms.Bbox.from_bounds")
[`matplotlib.transforms.Bbox.from_extents`](../transformations#matplotlib.transforms.Bbox.from_extents "matplotlib.transforms.Bbox.from_extents")
Examples using `matplotlib.axes.Axes.set_position`
--------------------------------------------------
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
matplotlib mpl_toolkits.axisartist.grid_finder mpl\_toolkits.axisartist.grid\_finder
=====================================
Classes
-------
| | |
| --- | --- |
| [`DictFormatter`](mpl_toolkits.axisartist.grid_finder.dictformatter#mpl_toolkits.axisartist.grid_finder.DictFormatter "mpl_toolkits.axisartist.grid_finder.DictFormatter")(format\_dict[, formatter]) | format\_dict : dictionary for format strings to be used. |
| [`ExtremeFinderSimple`](mpl_toolkits.axisartist.grid_finder.extremefindersimple#mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple "mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple")(nx, ny) | A helper class to figure out the range of grid lines that need to be drawn. |
| [`FixedLocator`](mpl_toolkits.axisartist.grid_finder.fixedlocator#mpl_toolkits.axisartist.grid_finder.FixedLocator "mpl_toolkits.axisartist.grid_finder.FixedLocator")(locs) | |
| [`FormatterPrettyPrint`](mpl_toolkits.axisartist.grid_finder.formatterprettyprint#mpl_toolkits.axisartist.grid_finder.FormatterPrettyPrint "mpl_toolkits.axisartist.grid_finder.FormatterPrettyPrint")([useMathText]) | |
| [`GridFinder`](mpl_toolkits.axisartist.grid_finder.gridfinder#mpl_toolkits.axisartist.grid_finder.GridFinder "mpl_toolkits.axisartist.grid_finder.GridFinder")(transform[, extreme\_finder, ...]) | transform : transform from the image coordinate (which will be the transData of the axes to the world coordinate. |
| [`MaxNLocator`](mpl_toolkits.axisartist.grid_finder.maxnlocator#mpl_toolkits.axisartist.grid_finder.MaxNLocator "mpl_toolkits.axisartist.grid_finder.MaxNLocator")([nbins, steps, trim, integer, ...]) | Parameters:
|
matplotlib matplotlib.axes.Axes.yaxis_inverted matplotlib.axes.Axes.yaxis\_inverted
====================================
Axes.yaxis\_inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return whether the yaxis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.
matplotlib matplotlib.pyplot.thetagrids matplotlib.pyplot.thetagrids
============================
matplotlib.pyplot.thetagrids(*angles=None*, *labels=None*, *fmt=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1951-L2016)
Get or set the theta gridlines on the current polar plot.
Call signatures:
```
lines, labels = thetagrids()
lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs)
```
When called with no arguments, [`thetagrids`](#matplotlib.pyplot.thetagrids "matplotlib.pyplot.thetagrids") simply returns the tuple (*lines*, *labels*). When called with arguments, the labels will appear at the specified angles.
Parameters:
**angles**tuple with floats, degrees
The angles of the theta gridlines.
**labels**tuple with strings or None
The labels to use at each radial gridline. The [`projections.polar.ThetaFormatter`](../projections_api#matplotlib.projections.polar.ThetaFormatter "matplotlib.projections.polar.ThetaFormatter") will be used if None.
**fmt**str or None
Format string used in [`matplotlib.ticker.FormatStrFormatter`](../ticker_api#matplotlib.ticker.FormatStrFormatter "matplotlib.ticker.FormatStrFormatter"). For example '%f'. Note that the angle in radians will be used.
Returns:
**lines**list of [`lines.Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The theta gridlines.
**labels**list of [`text.Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The tick labels.
Other Parameters:
**\*\*kwargs**
*kwargs* are optional [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels.
See also
[`pyplot.rgrids`](matplotlib.pyplot.rgrids#matplotlib.pyplot.rgrids "matplotlib.pyplot.rgrids")
[`projections.polar.PolarAxes.set_thetagrids`](../projections_api#matplotlib.projections.polar.PolarAxes.set_thetagrids "matplotlib.projections.polar.PolarAxes.set_thetagrids")
[`Axis.get_gridlines`](matplotlib.axis.axis.get_gridlines#matplotlib.axis.Axis.get_gridlines "matplotlib.axis.Axis.get_gridlines")
[`Axis.get_ticklabels`](matplotlib.axis.axis.get_ticklabels#matplotlib.axis.Axis.get_ticklabels "matplotlib.axis.Axis.get_ticklabels")
#### Examples
```
# set the locations of the angular gridlines
lines, labels = thetagrids(range(45, 360, 90))
# set the locations and labels of the angular gridlines
lines, labels = thetagrids(range(45, 360, 90), ('NE', 'NW', 'SW', 'SE'))
```
matplotlib mpl_toolkits.mplot3d.art3d.Poly3DCollection mpl\_toolkits.mplot3d.art3d.Poly3DCollection
============================================
*class*mpl\_toolkits.mplot3d.art3d.Poly3DCollection(*verts*, *\*args*, *zsort='average'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L664-L884)
Bases: [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A collection of 3D polygons.
Note
**Filling of 3D polygons**
There is no simple definition of the enclosed surface of a 3D polygon unless the polygon is planar.
In practice, Matplotlib fills the 2D projection of the polygon. This gives a correct filling appearance only for planar polygons. For all other polygons, you'll find orientations in which the edges of the polygon intersect in the projection. This will lead to an incorrect visualization of the 3D area.
If you need filled areas, it is recommended to create them via [`plot_trisurf`](mpl_toolkits.mplot3d.axes3d.axes3d#mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf "mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf"), which creates a triangulation and thus generates consistent surfaces.
Parameters:
**verts**list of (N, 3) array-like
Each element describes a polygon as a sequence of `N_i` points `(x, y, z)`.
**zsort**{'average', 'min', 'max'}, default: 'average'
The calculation method for the z-order. See [`set_zsort`](#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort "mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort") for details.
**\*args, \*\*kwargs**
All other parameters are forwarded to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection").
#### Notes
Note that this class does a bit of magic with the \_facecolors and \_edgecolors properties.
do\_3d\_projection()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L776-L843)
Perform the 3D projection for this object.
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L878-L884)
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L870-L876)
get\_vector(*segments3d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L733-L743)
Optimize points for projection.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *sort\_zpos=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *verts\_and\_codes=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*, *zsort=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | unknown |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | unknown |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`sort_zpos`](#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_sort_zpos "mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_sort_zpos") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts "mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts") | unknown |
| [`verts_and_codes`](#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts_and_codes "mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| [`zsort`](#mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort "mpl_toolkits.mplot3d.art3d.Poly3DCollection.set_zsort") | {'average', 'min', 'max'} |
set\_3d\_properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L760-L769)
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L855-L868)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_edgecolor(*colors*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L850-L853)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_facecolor(*colors*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L845-L848)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_sort\_zpos(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L771-L774)
Set the position to use for z-sorting.
set\_verts(*verts*, *closed=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L745-L750)
Set 3D vertices.
set\_verts\_and\_codes(*verts*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L752-L758)
Set 3D vertices with path codes.
set\_zsort(*zsort*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L719-L731)
Set the calculation method for the z-order.
Parameters:
**zsort**{'average', 'min', 'max'}
The function applied on the z-coordinates of the vertices in the viewer's coordinate system, to determine the z-order.
Examples using `mpl_toolkits.mplot3d.art3d.Poly3DCollection`
------------------------------------------------------------
[Custom hillshading in a 3D surface plot](https://matplotlib.org/stable/gallery/mplot3d/custom_shaded_3d_surface.html#sphx-glr-gallery-mplot3d-custom-shaded-3d-surface-py)
Custom hillshading in a 3D surface plot
[2D and 3D Axes in same Figure](https://matplotlib.org/stable/gallery/mplot3d/mixed_subplots.html#sphx-glr-gallery-mplot3d-mixed-subplots-py)
2D and 3D \*Axes\* in same \*Figure\*
[Generate polygons to fill under 3D line graph](https://matplotlib.org/stable/gallery/mplot3d/polys3d.html#sphx-glr-gallery-mplot3d-polys3d-py)
Generate polygons to fill under 3D line graph
[3D plots as subplots](https://matplotlib.org/stable/gallery/mplot3d/subplot3d.html#sphx-glr-gallery-mplot3d-subplot3d-py)
3D plots as subplots
[3D surface (colormap)](https://matplotlib.org/stable/gallery/mplot3d/surface3d.html#sphx-glr-gallery-mplot3d-surface3d-py)
3D surface (colormap)
[3D surface (checkerboard)](https://matplotlib.org/stable/gallery/mplot3d/surface3d_3.html#sphx-glr-gallery-mplot3d-surface3d-3-py)
3D surface (checkerboard)
| programming_docs |
matplotlib matplotlib.patches.Polygon matplotlib.patches.Polygon
==========================
*class*matplotlib.patches.Polygon(*xy*, *\**, *closed=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1068-L1163)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A general polygon patch.
*xy* is a numpy array with shape Nx2.
If *closed* is *True*, the polygon will be closed so the starting and ending points are the same.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_closed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1099-L1101)
Return whether the polygon is closed.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1095-L1097)
Get the [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") of the polygon.
get\_xy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1118-L1127)
Get the vertices of the path.
Returns:
(N, 2) numpy array
The coordinates of the vertices.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *closed=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xy=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_closed(*closed*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1103-L1116)
Set whether the polygon is closed.
Parameters:
**closed**bool
True if the polygon is closed
set\_xy(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1129-L1160)
Set the vertices of the polygon.
Parameters:
**xy**(N, 2) array-like
The coordinates of the vertices.
#### Notes
Unlike [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path"), we do not ignore the last input vertex. If the polygon is meant to be closed, and the last point of the polygon is not equal to the first, we assume that the user has not explicitly passed a `CLOSEPOLY` vertex, and add it ourselves.
*property*xy
The vertices of the path as (N, 2) numpy array.
Examples using `matplotlib.patches.Polygon`
-------------------------------------------
[Controlling view limits using margins and sticky\_edges](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_margins.html#sphx-glr-gallery-subplots-axes-and-figures-axes-margins-py)
Controlling view limits using margins and sticky\_edges
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
[Hatch demo](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_demo.html#sphx-glr-gallery-shapes-and-collections-hatch-demo-py)
Hatch demo
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Trifinder Event Demo](https://matplotlib.org/stable/gallery/event_handling/trifinder_event_demo.html#sphx-glr-gallery-event-handling-trifinder-event-demo-py)
Trifinder Event Demo
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
matplotlib mpl_toolkits.axisartist.axislines.AxisArtistHelper mpl\_toolkits.axisartist.axislines.AxisArtistHelper
===================================================
*class*mpl\_toolkits.axisartist.axislines.AxisArtistHelper[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L53-L192)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
AxisArtistHelper should define following method with given APIs. Note that the first axes argument will be axes attribute of the caller artist.:
```
# LINE (spinal line?)
def get_line(self, axes):
# path : Path
return path
def get_line_transform(self, axes):
# ...
# trans : transform
return trans
# LABEL
def get_label_pos(self, axes):
# x, y : position
return (x, y), trans
def get_label_offset_transform(self,
axes,
pad_points, fontprops, renderer,
bboxes,
):
# va : vertical alignment
# ha : horizontal alignment
# a : angle
return trans, va, ha, a
# TICK
def get_tick_transform(self, axes):
return trans
def get_tick_iterators(self, axes):
# iter : iterable object that yields (c, angle, l) where
# c, angle, l is position, tick angle, and label
return iter_major, iter_minor
```
*class*Fixed(*loc*, *nth\_coord=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L111-L178)
Bases: `_Base`
Helper class for a fixed (in the axes coordinate) axis.
nth\_coord = along which coordinate value varies in 2D, nth\_coord = 0 -> x axis, nth\_coord = 1 -> y axis
get\_axislabel\_pos\_angle(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L163-L172)
Return the label reference position in transAxes.
get\_label\_transform() returns a transform of (transAxes+offset)
get\_axislabel\_transform(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L160-L161)
get\_line(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L152-L153)
get\_line\_transform(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L155-L156)
get\_nth\_coord()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L147-L148)
get\_tick\_transform(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L176-L178)
*class*Floating(*nth\_coord*, *value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L180-L192)
Bases: `_Base`
get\_line(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L190-L192)
get\_nth\_coord()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L187-L188)
matplotlib matplotlib.quiver.Barbs matplotlib.quiver.Barbs
=======================
*class*matplotlib.quiver.Barbs(*ax*, *\*args*, *pivot='tip'*, *length=7*, *barbcolor=None*, *flagcolor=None*, *sizes=None*, *fill\_empty=False*, *barb\_increments=None*, *rounding=True*, *flip\_barb=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L879-L1193)
Bases: [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
Specialized PolyCollection for barbs.
The only API method is [`set_UVC()`](#matplotlib.quiver.Barbs.set_UVC "matplotlib.quiver.Barbs.set_UVC"), which can be used to change the size, orientation, and color of the arrows. Locations are changed using the [`set_offsets()`](#matplotlib.quiver.Barbs.set_offsets "matplotlib.quiver.Barbs.set_offsets") collection method. Possibly this method will be useful in animations.
There is one internal function `_find_tails()` which finds exactly what should be put on the barb given the vector magnitude. From there `_make_barbs()` is used to find the vertices of the polygon to represent the barb based on this information.
The constructor takes one required argument, an Axes instance, followed by the args and kwargs described by the following pyplot interface documentation:
Plot a 2D field of barbs.
Call signature:
```
barbs([X, Y], U, V, [C], **kwargs)
```
Where *X*, *Y* define the barb locations, *U*, *V* define the barb directions, and *C* optionally sets the color.
All arguments may be 1D or 2D. *U*, *V*, *C* may be masked arrays, but masked *X*, *Y* are not supported at present.
Barbs are traditionally used in meteorology as a way to plot the speed and direction of wind observations, but can technically be used to plot any two dimensional vector quantity. As opposed to arrows, which give vector magnitude by the length of the arrow, the barbs give more quantitative information about the vector magnitude by putting slanted lines or a triangle for various increments in magnitude, as show schematically below:
```
: /\ \
: / \ \
: / \ \ \
: / \ \ \
: ------------------------------
```
The largest increment is given by a triangle (or "flag"). After those come full lines (barbs). The smallest increment is a half line. There is only, of course, ever at most 1 half line. If the magnitude is small and only needs a single half-line and no full lines or triangles, the half-line is offset from the end of the barb so that it can be easily distinguished from barbs with a single full line. The magnitude for the barb shown above would nominally be 65, using the standard increments of 50, 10, and 5.
See also <https://en.wikipedia.org/wiki/Wind_barb>.
Parameters:
**X, Y**1D or 2D array-like, optional
The x and y coordinates of the barb locations. See *pivot* for how the barbs are drawn to the x, y positions.
If not given, they will be generated as a uniform integer meshgrid based on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D using `X, Y = np.meshgrid(X, Y)`. In this case `len(X)` and `len(Y)` must match the column and row dimensions of *U* and *V*.
**U, V**1D or 2D array-like
The x and y components of the barb shaft.
**C**1D or 2D array-like, optional
Numeric data that defines the barb colors by colormapping via *norm* and *cmap*.
This does not support explicit colors. If you want to set colors directly, use *barbcolor* instead.
**length**float, default: 7
Length of the barb in points; the other parts of the barb are scaled against this.
**pivot**{'tip', 'middle'} or float, default: 'tip'
The part of the arrow that is anchored to the *X*, *Y* grid. The barb rotates about this point. This can also be a number, which shifts the start of the barb that many points away from grid point.
**barbcolor**color or color sequence
The color of all parts of the barb except for the flags. This parameter is analogous to the *edgecolor* parameter for polygons, which can be used instead. However this parameter will override facecolor.
**flagcolor**color or color sequence
The color of any flags on the barb. This parameter is analogous to the *facecolor* parameter for polygons, which can be used instead. However, this parameter will override facecolor. If this is not set (and *C* has not either) then *flagcolor* will be set to match *barbcolor* so that the barb has a uniform color. If *C* has been set, *flagcolor* has no effect.
**sizes**dict, optional
A dictionary of coefficients specifying the ratio of a given feature to the length of the barb. Only those values one wishes to override need to be included. These features include:
* 'spacing' - space between features (flags, full/half barbs)
* 'height' - height (distance from shaft to top) of a flag or full barb
* 'width' - width of a flag, twice the width of a full barb
* 'emptybarb' - radius of the circle used for low magnitudes
**fill\_empty**bool, default: False
Whether the empty barbs (circles) that are drawn should be filled with the flag color. If they are not filled, the center is transparent.
**rounding**bool, default: True
Whether the vector magnitude should be rounded when allocating barb components. If True, the magnitude is rounded to the nearest multiple of the half-barb increment. If False, the magnitude is simply truncated to the next lowest multiple.
**barb\_increments**dict, optional
A dictionary of increments specifying values to associate with different parts of the barb. Only those values one wishes to override need to be included.
* 'half' - half barbs (Default is 5)
* 'full' - full barbs (Default is 10)
* 'flag' - flags (default is 50)
**flip\_barb**bool or array-like of bool, default: False
Whether the lines and flags should point opposite to normal. Normal behavior is for the barbs and lines to point right (comes from wind barbs having these features point towards low pressure in the Northern Hemisphere).
A single value is applied to all barbs. Individual barbs can be flipped by passing a bool array of the same size as *U* and *V*.
Returns:
**barbs**[`Barbs`](#matplotlib.quiver.Barbs "matplotlib.quiver.Barbs")
Other Parameters:
**data**indexable object, optional
DATA\_PARAMETER\_PLACEHOLDER
**\*\*kwargs**
The barbs can further be customized using [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") keyword arguments:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
barbs\_doc*='\nPlot a 2D field of barbs.\n\nCall signature::\n\n barbs([X, Y], U, V, [C], \*\*kwargs)\n\nWhere \*X\*, \*Y\* define the barb locations, \*U\*, \*V\* define the barb\ndirections, and \*C\* optionally sets the color.\n\nAll arguments may be 1D or 2D. \*U\*, \*V\*, \*C\* may be masked arrays, but masked\n\*X\*, \*Y\* are not supported at present.\n\nBarbs are traditionally used in meteorology as a way to plot the speed\nand direction of wind observations, but can technically be used to\nplot any two dimensional vector quantity. As opposed to arrows, which\ngive vector magnitude by the length of the arrow, the barbs give more\nquantitative information about the vector magnitude by putting slanted\nlines or a triangle for various increments in magnitude, as show\nschematically below::\n\n : /\\ \\\n : / \\ \\\n : / \\ \\ \\\n : / \\ \\ \\\n : ------------------------------\n\nThe largest increment is given by a triangle (or "flag"). After those\ncome full lines (barbs). The smallest increment is a half line. There\nis only, of course, ever at most 1 half line. If the magnitude is\nsmall and only needs a single half-line and no full lines or\ntriangles, the half-line is offset from the end of the barb so that it\ncan be easily distinguished from barbs with a single full line. The\nmagnitude for the barb shown above would nominally be 65, using the\nstandard increments of 50, 10, and 5.\n\nSee also https://en.wikipedia.org/wiki/Wind\_barb.\n\nParameters\n----------\nX, Y : 1D or 2D array-like, optional\n The x and y coordinates of the barb locations. See \*pivot\* for how the\n barbs are drawn to the x, y positions.\n\n If not given, they will be generated as a uniform integer meshgrid based\n on the dimensions of \*U\* and \*V\*.\n\n If \*X\* and \*Y\* are 1D but \*U\*, \*V\* are 2D, \*X\*, \*Y\* are expanded to 2D\n using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``\n must match the column and row dimensions of \*U\* and \*V\*.\n\nU, V : 1D or 2D array-like\n The x and y components of the barb shaft.\n\nC : 1D or 2D array-like, optional\n Numeric data that defines the barb colors by colormapping via \*norm\* and\n \*cmap\*.\n\n This does not support explicit colors. If you want to set colors directly,\n use \*barbcolor\* instead.\n\nlength : float, default: 7\n Length of the barb in points; the other parts of the barb\n are scaled against this.\n\npivot : {\'tip\', \'middle\'} or float, default: \'tip\'\n The part of the arrow that is anchored to the \*X\*, \*Y\* grid. The barb\n rotates about this point. This can also be a number, which shifts the\n start of the barb that many points away from grid point.\n\nbarbcolor : color or color sequence\n The color of all parts of the barb except for the flags. This parameter\n is analogous to the \*edgecolor\* parameter for polygons, which can be used\n instead. However this parameter will override facecolor.\n\nflagcolor : color or color sequence\n The color of any flags on the barb. This parameter is analogous to the\n \*facecolor\* parameter for polygons, which can be used instead. However,\n this parameter will override facecolor. If this is not set (and \*C\* has\n not either) then \*flagcolor\* will be set to match \*barbcolor\* so that the\n barb has a uniform color. If \*C\* has been set, \*flagcolor\* has no effect.\n\nsizes : dict, optional\n A dictionary of coefficients specifying the ratio of a given\n feature to the length of the barb. Only those values one wishes to\n override need to be included. These features include:\n\n - \'spacing\' - space between features (flags, full/half barbs)\n - \'height\' - height (distance from shaft to top) of a flag or full barb\n - \'width\' - width of a flag, twice the width of a full barb\n - \'emptybarb\' - radius of the circle used for low magnitudes\n\nfill\_empty : bool, default: False\n Whether the empty barbs (circles) that are drawn should be filled with\n the flag color. If they are not filled, the center is transparent.\n\nrounding : bool, default: True\n Whether the vector magnitude should be rounded when allocating barb\n components. If True, the magnitude is rounded to the nearest multiple\n of the half-barb increment. If False, the magnitude is simply truncated\n to the next lowest multiple.\n\nbarb\_increments : dict, optional\n A dictionary of increments specifying values to associate with\n different parts of the barb. Only those values one wishes to\n override need to be included.\n\n - \'half\' - half barbs (Default is 5)\n - \'full\' - full barbs (Default is 10)\n - \'flag\' - flags (default is 50)\n\nflip\_barb : bool or array-like of bool, default: False\n Whether the lines and flags should point opposite to normal.\n Normal behavior is for the barbs and lines to point right (comes from wind\n barbs having these features point towards low pressure in the Northern\n Hemisphere).\n\n A single value is applied to all barbs. Individual barbs can be flipped by\n passing a bool array of the same size as \*U\* and \*V\*.\n\nReturns\n-------\nbarbs : `~matplotlib.quiver.Barbs`\n\nOther Parameters\n----------------\ndata : indexable object, optional\n DATA\_PARAMETER\_PLACEHOLDER\n\n\*\*kwargs\n The barbs can further be customized using `.PolyCollection` keyword\n arguments:\n\n \n .. table::\n :class: property-table\n\n ================================================================================================= ==============================================================================================================================================================\n Property Description \n ================================================================================================= ==============================================================================================================================================================\n :meth:`agg\_filter <matplotlib.artist.Artist.set\_agg\_filter>` a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image\n :meth:`alpha <matplotlib.collections.Collection.set\_alpha>` array-like or scalar or None \n :meth:`animated <matplotlib.artist.Artist.set\_animated>` bool \n :meth:`antialiased <matplotlib.collections.Collection.set\_antialiased>` or aa or antialiaseds bool or list of bools \n :meth:`array <matplotlib.cm.ScalarMappable.set\_array>` array-like or None \n :meth:`capstyle <matplotlib.collections.Collection.set\_capstyle>` `.CapStyle` or {\'butt\', \'projecting\', \'round\'} \n :meth:`clim <matplotlib.cm.ScalarMappable.set\_clim>` (vmin: float, vmax: float) \n :meth:`clip\_box <matplotlib.artist.Artist.set\_clip\_box>` `.Bbox` \n :meth:`clip\_on <matplotlib.artist.Artist.set\_clip\_on>` bool \n :meth:`clip\_path <matplotlib.artist.Artist.set\_clip\_path>` Patch or (Path, Transform) or None \n :meth:`cmap <matplotlib.cm.ScalarMappable.set\_cmap>` `.Colormap` or str or None \n :meth:`color <matplotlib.collections.Collection.set\_color>` color or list of rgba tuples \n :meth:`edgecolor <matplotlib.collections.Collection.set\_edgecolor>` or ec or edgecolors color or list of colors or \'face\' \n :meth:`facecolor <matplotlib.collections.Collection.set\_facecolor>` or facecolors or fc color or list of colors \n :meth:`figure <matplotlib.artist.Artist.set\_figure>` `.Figure` \n :meth:`gid <matplotlib.artist.Artist.set\_gid>` str \n :meth:`hatch <matplotlib.collections.Collection.set\_hatch>` {\'/\', \'\\\\\', \'|\', \'-\', \'+\', \'x\', \'o\', \'O\', \'.\', \'\*\'} \n :meth:`in\_layout <matplotlib.artist.Artist.set\_in\_layout>` bool \n :meth:`joinstyle <matplotlib.collections.Collection.set\_joinstyle>` `.JoinStyle` or {\'miter\', \'round\', \'bevel\'} \n :meth:`label <matplotlib.artist.Artist.set\_label>` object \n :meth:`linestyle <matplotlib.collections.Collection.set\_linestyle>` or dashes or linestyles or ls str or tuple or list thereof \n :meth:`linewidth <matplotlib.collections.Collection.set\_linewidth>` or linewidths or lw float or list of floats \n :meth:`mouseover <matplotlib.artist.Artist.set\_mouseover>` bool \n :meth:`norm <matplotlib.cm.ScalarMappable.set\_norm>` `.Normalize` or str or None \n :meth:`offset\_transform <matplotlib.collections.Collection.set\_offset\_transform>` or transOffset unknown \n :meth:`offsets <matplotlib.collections.Collection.set\_offsets>` (N, 2) or (2,) array-like \n :meth:`path\_effects <matplotlib.artist.Artist.set\_path\_effects>` `.AbstractPathEffect` \n :meth:`paths <matplotlib.collections.PolyCollection.set\_verts>` list of array-like \n :meth:`picker <matplotlib.artist.Artist.set\_picker>` None or bool or float or callable \n :meth:`pickradius <matplotlib.collections.Collection.set\_pickradius>` unknown \n :meth:`rasterized <matplotlib.artist.Artist.set\_rasterized>` bool \n :meth:`sizes <matplotlib.collections.\_CollectionWithSizes.set\_sizes>` ndarray or None \n :meth:`sketch\_params <matplotlib.artist.Artist.set\_sketch\_params>` (scale: float, length: float, randomness: float) \n :meth:`snap <matplotlib.artist.Artist.set\_snap>` bool or None \n :meth:`transform <matplotlib.artist.Artist.set\_transform>` `.Transform` \n :meth:`url <matplotlib.artist.Artist.set\_url>` str \n :meth:`urls <matplotlib.collections.Collection.set\_urls>` list of str or None \n :meth:`verts <matplotlib.collections.PolyCollection.set\_verts>` list of array-like \n :meth:`verts\_and\_codes <matplotlib.collections.PolyCollection.set\_verts\_and\_codes>` unknown \n :meth:`visible <matplotlib.artist.Artist.set\_visible>` bool \n :meth:`zorder <matplotlib.artist.Artist.set\_zorder>` float \n ================================================================================================= ==============================================================================================================================================================\n\n'*
set(*\**, *UVC=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *verts\_and\_codes=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`UVC`](#matplotlib.quiver.Barbs.set_UVC "matplotlib.quiver.Barbs.set_UVC") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.quiver.Barbs.set_offsets "matplotlib.quiver.Barbs.set_offsets") | sequence of pairs of floats |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_UVC(*U*, *V*, *C=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L1129-L1173)
set\_offsets(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L1175-L1191)
Set the offsets for the barb polygons. This saves the offsets passed in and masks them as appropriate for the existing U/V data.
Parameters:
**xy**sequence of pairs of floats
| programming_docs |
matplotlib matplotlib.pyplot.xcorr matplotlib.pyplot.xcorr
=======================
matplotlib.pyplot.xcorr(*x*, *y*, *normed=True*, *detrend=<function detrend\_none>*, *usevlines=True*, *maxlags=10*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2981-L2988)
Plot the cross correlation between *x* and *y*.
The correlation with lag k is defined as \(\sum\_n x[n+k] \cdot y^\*[n]\), where \(y^\*\) is the complex conjugate of \(y\).
Parameters:
**x, y**array-like of length n
**detrend**callable, default: [`mlab.detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none") (no detrending)
A detrending function applied to *x* and *y*. It must have the signature
```
detrend(x: np.ndarray) -> np.ndarray
```
**normed**bool, default: True
If `True`, input vectors are normalised to unit length.
**usevlines**bool, default: True
Determines the plot style.
If `True`, vertical lines are plotted from 0 to the xcorr value using [`Axes.vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines"). Additionally, a horizontal line is plotted at y=0 using [`Axes.axhline`](matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline").
If `False`, markers are plotted at the xcorr values using [`Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
**maxlags**int, default: 10
Number of lags to show. If None, will return all `2 * len(x) - 1` lags.
Returns:
**lags**array (length `2*maxlags+1`)
The lag vector.
**c**array (length `2*maxlags+1`)
The auto correlation vector.
**line**[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") or [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") added to the Axes of the correlation:
* [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") if *usevlines* is True.
* [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") if *usevlines* is False.
**b**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") or None
Horizontal line at 0 if *usevlines* is True None *usevlines* is False.
Other Parameters:
**linestyle**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") property, optional
The linestyle for plotting the data points. Only used if *usevlines* is `False`.
**marker**str, default: 'o'
The marker for plotting the data points. Only used if *usevlines* is `False`.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*
**\*\*kwargs**
Additional parameters are passed to [`Axes.vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines") and [`Axes.axhline`](matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline") if *usevlines* is `True`; otherwise they are passed to [`Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
#### Notes
The cross correlation is performed with [`numpy.correlate`](https://numpy.org/doc/stable/reference/generated/numpy.correlate.html#numpy.correlate "(in NumPy v1.23)") with `mode = "full"`.
matplotlib matplotlib.pyplot.set_cmap matplotlib.pyplot.set\_cmap
===========================
matplotlib.pyplot.set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2085-L2106)
Set the default colormap, and applies it to the current image if any.
Parameters:
**cmap**[`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str
A colormap instance or the name of a registered colormap.
See also
[`colormaps`](../pyplot_summary#matplotlib.pyplot.colormaps "matplotlib.pyplot.colormaps")
[`matplotlib.cm.register_cmap`](../cm_api#matplotlib.cm.register_cmap "matplotlib.cm.register_cmap")
[`matplotlib.cm.get_cmap`](../cm_api#matplotlib.cm.get_cmap "matplotlib.cm.get_cmap")
matplotlib matplotlib.pyplot.tight_layout matplotlib.pyplot.tight\_layout
===============================
matplotlib.pyplot.tight\_layout(*\**, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2263-L2265)
Adjust the padding between and around subplots.
To exclude an artist on the Axes from the bounding box calculation that determines the subplot parameters (i.e. legend, or annotation), set `a.set_in_layout(False)` for that artist.
Parameters:
**pad**float, default: 1.08
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
**h\_pad, w\_pad**float, default: *pad*
Padding (height/width) between edges of adjacent subplots, as a fraction of the font size.
**rect**tuple (left, bottom, right, top), default: (0, 0, 1, 1)
A rectangle in normalized figure coordinates into which the whole subplots area (including labels) will fit.
See also
[`Figure.set_layout_engine`](../figure_api#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine")
[`pyplot.tight_layout`](#matplotlib.pyplot.tight_layout "matplotlib.pyplot.tight_layout")
Examples using `matplotlib.pyplot.tight_layout`
-----------------------------------------------
[Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html#sphx-glr-gallery-lines-bars-and-markers-linestyles-py)
Linestyles
[Marker examples](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_star_poly.html#sphx-glr-gallery-lines-bars-and-markers-scatter-star-poly-py)
Marker examples
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html#sphx-glr-gallery-images-contours-and-fields-interpolation-methods-py)
Interpolations for imshow
[Streamplot](https://matplotlib.org/stable/gallery/images_contours_and_fields/plot_streamplot.html#sphx-glr-gallery-images-contours-and-fields-plot-streamplot-py)
Streamplot
[Resizing axes with tight layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_tight_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-tight-layout-py)
Resizing axes with tight layout
[Labeling ticks using engineering notation](https://matplotlib.org/stable/gallery/text_labels_and_annotations/engineering_formatter.html#sphx-glr-gallery-text-labels-and-annotations-engineering-formatter-py)
Labeling ticks using engineering notation
[Figure legend demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/figlegend_demo.html#sphx-glr-gallery-text-labels-and-annotations-figlegend-demo-py)
Figure legend demo
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[3D wireframe plots in one direction](https://matplotlib.org/stable/gallery/mplot3d/wire3d_zero_stride.html#sphx-glr-gallery-mplot3d-wire3d-zero-stride-py)
3D wireframe plots in one direction
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Tick locators](https://matplotlib.org/stable/gallery/ticks/tick-locators.html#sphx-glr-gallery-ticks-tick-locators-py)
Tick locators
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib mpl_toolkits.axes_grid1.axes_size.Fixed mpl\_toolkits.axes\_grid1.axes\_size.Fixed
==========================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.Fixed(*fixed\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L52-L64)
Bases: `_Base`
Simple fixed size with absolute part = *fixed\_size* and relative part = 0.
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L61-L64)
Examples using `mpl_toolkits.axes_grid1.axes_size.Fixed`
--------------------------------------------------------
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Axes with a fixed physical size](https://matplotlib.org/stable/gallery/axes_grid1/demo_fixed_size_axes.html#sphx-glr-gallery-axes-grid1-demo-fixed-size-axes-py)
Axes with a fixed physical size
[Simple Axes Divider 1](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider1.html#sphx-glr-gallery-axes-grid1-simple-axes-divider1-py)
Simple Axes Divider 1
[Simple Axes Divider 3](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-gallery-axes-grid1-simple-axes-divider3-py)
Simple Axes Divider 3
matplotlib matplotlib.axis.XAxis.set_label_position matplotlib.axis.XAxis.set\_label\_position
==========================================
XAxis.set\_label\_position(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2228-L2240)
Set the label position (top or bottom)
Parameters:
**position**{'top', 'bottom'}
Examples using `matplotlib.axis.XAxis.set_label_position`
---------------------------------------------------------
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
matplotlib matplotlib.pyplot.broken_barh matplotlib.pyplot.broken\_barh
==============================
matplotlib.pyplot.broken\_barh(*xranges*, *yrange*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2414-L2418)
Plot a horizontal sequence of rectangles.
A rectangle is drawn for each element of *xranges*. All rectangles have the same vertical position and size defined by *yrange*.
This is a convenience function for instantiating a [`BrokenBarHCollection`](../collections_api#matplotlib.collections.BrokenBarHCollection "matplotlib.collections.BrokenBarHCollection"), adding it to the Axes and autoscaling the view.
Parameters:
**xranges**sequence of tuples (*xmin*, *xwidth*)
The x-positions and extends of the rectangles. For each tuple (*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* + *xwidth*.
**yrange**(*ymin*, *yheight*)
The y-position and extend for all the rectangles.
Returns:
[`BrokenBarHCollection`](../collections_api#matplotlib.collections.BrokenBarHCollection "matplotlib.collections.BrokenBarHCollection")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`BrokenBarHCollection`](../collections_api#matplotlib.collections.BrokenBarHCollection "matplotlib.collections.BrokenBarHCollection") properties
Each *kwarg* can be either a single argument applying to all rectangles, e.g.:
```
facecolors='black'
```
or a sequence of arguments over which is cycled, e.g.:
```
facecolors=('black', 'blue')
```
would create interleaving black and blue rectangles.
Supported keywords:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib matplotlib.colors.to_rgba_array matplotlib.colors.to\_rgba\_array
=================================
matplotlib.colors.to\_rgba\_array(*c*, *alpha=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L399-L491)
Convert *c* to a (n, 4) array of RGBA colors.
Parameters:
**c**Matplotlib color or array of colors
If *c* is a masked array, an ndarray is returned with a (0, 0, 0, 0) row for each masked value or row in *c*.
**alpha**float or sequence of floats, optional
If *alpha* is given, force the alpha value of the returned RGBA tuple to *alpha*.
If None, the alpha value from *c* is used. If *c* does not have an alpha channel, then alpha defaults to 1.
*alpha* is ignored for the color value `"none"` (case-insensitive), which always maps to `(0, 0, 0, 0)`.
If *alpha* is a sequence and *c* is a single color, *c* will be repeated to match the length of *alpha*.
Returns:
array
(n, 4) array of RGBA colors, where each channel (red, green, blue, alpha) can assume values between 0 and 1.
Examples using `matplotlib.colors.to_rgba_array`
------------------------------------------------
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
| programming_docs |
matplotlib mpl_toolkits.mplot3d.proj3d.view_transformation mpl\_toolkits.mplot3d.proj3d.view\_transformation
=================================================
mpl\_toolkits.mplot3d.proj3d.view\_transformation(*E*, *R*, *V*, *roll*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L75-L94)
matplotlib matplotlib.pyplot.pcolor matplotlib.pyplot.pcolor
========================
matplotlib.pyplot.pcolor(*\*args*, *shading=None*, *alpha=None*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2671-L2680)
Create a pseudocolor plot with a non-regular rectangular grid.
Call signature:
```
pcolor([X, Y,] C, **kwargs)
```
*X* and *Y* can be used to specify the corners of the quadrilaterals.
Hint
`pcolor()` can be very slow for large arrays. In most cases you should use the similar but much faster [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") instead. See [Differences between pcolor() and pcolormesh()](matplotlib.pyplot.pcolormesh#differences-pcolor-pcolormesh) for a discussion of the differences.
Parameters:
**C**2D array-like
The color-mapped values. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**X, Y**array-like, optional
The coordinates of the corners of quadrilaterals of a pcolormesh:
```
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
+-----+
| |
+-----+
(X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
```
Note that the column index corresponds to the x-coordinate, and the row index corresponds to y. For details, see the [Notes](matplotlib.pyplot.pcolormesh#axes-pcolormesh-grid-orientation) section below.
If `shading='flat'` the dimensions of *X* and *Y* should be one greater than those of *C*, and the quadrilateral is colored due to the value at `C[i, j]`. If *X*, *Y* and *C* have equal dimensions, a warning will be raised and the last row and column of *C* will be ignored.
If `shading='nearest'`, the dimensions of *X* and *Y* should be the same as those of *C* (if not, a ValueError will be raised). The color `C[i, j]` will be centered on `(X[i, j], Y[i, j])`.
If *X* and/or *Y* are 1-D arrays or column vectors they will be expanded as needed into the appropriate 2D arrays, making a rectangular grid.
**shading**{'flat', 'nearest', 'auto'}, default: `[rcParams["pcolor.shading"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=pcolor.shading#matplotlibrc-sample)` (default: `'auto'`)
The fill style for the quadrilateral. Possible values:
* 'flat': A solid color is used for each quad. The color of the quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by `C[i, j]`. The dimensions of *X* and *Y* should be one greater than those of *C*; if they are the same as *C*, then a deprecation warning is raised, and the last row and column of *C* are dropped.
* 'nearest': Each grid point will have a color centered on it, extending halfway between the adjacent grid centers. The dimensions of *X* and *Y* must be the same as *C*.
* 'auto': Choose 'flat' if dimensions of *X* and *Y* are one larger than *C*. Choose 'nearest' if dimensions are the same.
See [pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html) for more description.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
**edgecolors**{'none', None, 'face', color, color sequence}, optional
The color of the edges. Defaults to 'none'. Possible values:
* 'none' or '': No edge.
* *None*: `[rcParams["patch.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.edgecolor#matplotlibrc-sample)` (default: `'black'`) will be used. Note that currently `[rcParams["patch.force\_edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.force_edgecolor#matplotlibrc-sample)` (default: `False`) has to be True for this to work.
* 'face': Use the adjacent face color.
* A color or sequence of colors will set the edge color.
The singular form *edgecolor* works as an alias.
**alpha**float, default: None
The alpha blending value of the face color, between 0 (transparent) and 1 (opaque). Note: The edgecolor is currently not affected by this.
**snap**bool, default: False
Whether to snap the mesh to pixel boundaries.
Returns:
[`matplotlib.collections.Collection`](../collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection")
Other Parameters:
**antialiaseds**bool, default: False
The default *antialiaseds* is False if the default *edgecolors*="none" is used. This eliminates artificial lines at patch boundaries, and works regardless of the value of alpha. If *edgecolors* is not "none", then the default *antialiaseds* is taken from `[rcParams["patch.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.antialiased#matplotlibrc-sample)` (default: `True`). Stroking the edges may be preferred if *alpha* is 1, but will cause artifacts otherwise.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Additionally, the following arguments are allowed. They are passed along to the [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") constructor:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`pcolormesh`](matplotlib.pyplot.pcolormesh#matplotlib.pyplot.pcolormesh "matplotlib.pyplot.pcolormesh")
for an explanation of the differences between pcolor and pcolormesh.
[`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow")
If *X* and *Y* are each equidistant, [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") can be a faster alternative.
#### Notes
**Masked arrays**
*X*, *Y* and *C* may be masked arrays. If either `C[i, j]`, or one of the vertices surrounding `C[i, j]` (*X* or *Y* at `[i, j], [i+1, j], [i, j+1], [i+1, j+1]`) is masked, nothing is plotted.
**Grid orientation**
The grid orientation follows the standard matrix convention: An array *C* with shape (nrows, ncolumns) is plotted with the column number as *X* and the row number as *Y*.
matplotlib matplotlib.patches.Rectangle matplotlib.patches.Rectangle
============================
*class*matplotlib.patches.Rectangle(*xy*, *width*, *height*, *\**, *angle=0.0*, *rotation\_point='xy'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L663-L879)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A rectangle defined via an anchor point *xy* and its *width* and *height*.
The rectangle extends from `xy[0]` to `xy[0] + width` in x-direction and from `xy[1]` to `xy[1] + height` in y-direction.
```
: +------------------+
: | |
: height |
: | |
: (xy)---- width -----+
```
One may picture *xy* as the bottom left corner, but which corner *xy* is actually depends on the direction of the axis and the sign of *width* and *height*; e.g. *xy* would be the bottom right corner if the x-axis was inverted or if *width* was negative.
Parameters:
**xy**(float, float)
The anchor point.
**width**float
Rectangle width.
**height**float
Rectangle height.
**angle**float, default: 0
Rotation in degrees anti-clockwise about the rotation point.
**rotation\_point**{'xy', 'center', (number, number)}, default: 'xy'
If `'xy'`, rotate around the anchor point. If `'center'` rotate around the center. If 2-tuple of number, rotate around this coordinate.
Other Parameters:
**\*\*kwargs**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_angle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L809-L811)
Get the rotation angle in degrees.
get\_bbox()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L874-L877)
Return the [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
get\_center()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L797-L799)
Return the centre of the rectangle.
get\_corners()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L789-L795)
Return the corners of the rectangle, moving anti-clockwise from (x0, y0).
get\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L805-L807)
Return the height of the rectangle.
get\_patch\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L740-L759)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L728-L730)
Return the vertices of the rectangle.
get\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L801-L803)
Return the width of the rectangle.
get\_x()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L777-L779)
Return the left coordinate of the rectangle.
get\_xy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L785-L787)
Return the left and bottom coords of the rectangle as a tuple.
get\_y()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L781-L783)
Return the bottom coordinate of the rectangle.
*property*rotation\_point
The rotation point of the patch.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *bounds=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *x=<UNSET>*, *xy=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](#matplotlib.patches.Rectangle.set_angle "matplotlib.patches.Rectangle.set_angle") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](#matplotlib.patches.Rectangle.set_bounds "matplotlib.patches.Rectangle.set_bounds") | (left, bottom, width, height) |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](#matplotlib.patches.Rectangle.set_height "matplotlib.patches.Rectangle.set_height") | unknown |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.patches.Rectangle.set_width "matplotlib.patches.Rectangle.set_width") | unknown |
| [`x`](#matplotlib.patches.Rectangle.set_x "matplotlib.patches.Rectangle.set_x") | unknown |
| [`xy`](#matplotlib.patches.Rectangle.set_xy "matplotlib.patches.Rectangle.set_xy") | (float, float) |
| [`y`](#matplotlib.patches.Rectangle.set_y "matplotlib.patches.Rectangle.set_y") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_angle(*angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L823-L830)
Set the rotation angle in degrees.
The rotation is performed anti-clockwise around *xy*.
set\_bounds(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L853-L872)
Set the bounds of the rectangle as *left*, *bottom*, *width*, *height*.
The values may be passed as separate parameters or as a tuple:
```
set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
```
set\_height(*h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L848-L851)
Set the height of the rectangle.
set\_width(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L843-L846)
Set the width of the rectangle.
set\_x(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L813-L816)
Set the left coordinate of the rectangle.
set\_xy(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L832-L841)
Set the left and bottom coordinates of the rectangle.
Parameters:
**xy**(float, float)
set\_y(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L818-L821)
Set the bottom coordinate of the rectangle.
*property*xy
Return the left and bottom coords of the rectangle as a tuple.
Examples using `matplotlib.patches.Rectangle`
---------------------------------------------
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Text Rotation Mode](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_rotation_mode.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-rotation-mode-py)
Text Rotation Mode
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Fig Axes Customize Simple](https://matplotlib.org/stable/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py)
Fig Axes Customize Simple
[Text Layout](https://matplotlib.org/stable/gallery/pyplots/text_layout.html#sphx-glr-gallery-pyplots-text-layout-py)
Text Layout
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html#sphx-glr-gallery-shapes-and-collections-hatch-style-reference-py)
Hatch style reference
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Viewlims](https://matplotlib.org/stable/gallery/event_handling/viewlims.html#sphx-glr-gallery-event-handling-viewlims-py)
Viewlims
[Changing colors of lines intersecting a box](https://matplotlib.org/stable/gallery/misc/bbox_intersect.html#sphx-glr-gallery-misc-bbox-intersect-py)
Changing colors of lines intersecting a box
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
[Hinton diagrams](https://matplotlib.org/stable/gallery/specialty_plots/hinton_demo.html#sphx-glr-gallery-specialty-plots-hinton-demo-py)
Hinton diagrams
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Menu](https://matplotlib.org/stable/gallery/widgets/menu.html#sphx-glr-gallery-widgets-menu-py)
Menu
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Text properties and layout](https://matplotlib.org/stable/tutorials/text/text_props.html#sphx-glr-tutorials-text-text-props-py)
Text properties and layout
| programming_docs |
matplotlib mpl_toolkits.axisartist.clip_path mpl\_toolkits.axisartist.clip\_path
===================================
Functions
---------
| | |
| --- | --- |
| [`atan2`](mpl_toolkits.axisartist.clip_path.atan2#mpl_toolkits.axisartist.clip_path.atan2 "mpl_toolkits.axisartist.clip_path.atan2")(dy, dx) | |
| [`clip`](mpl_toolkits.axisartist.clip_path.clip#mpl_toolkits.axisartist.clip_path.clip "mpl_toolkits.axisartist.clip_path.clip")(xlines, ylines, x0[, clip, xdir, ydir]) | |
| [`clip_line_to_rect`](mpl_toolkits.axisartist.clip_path.clip_line_to_rect#mpl_toolkits.axisartist.clip_path.clip_line_to_rect "mpl_toolkits.axisartist.clip_path.clip_line_to_rect")(xline, yline, bbox) | |
matplotlib matplotlib.pyplot.clf matplotlib.pyplot.clf
=====================
matplotlib.pyplot.clf()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L919-L921)
Clear the current figure.
matplotlib matplotlib.axes.Axes.specgram matplotlib.axes.Axes.specgram
=============================
Axes.specgram(*x*, *NFFT=None*, *Fs=None*, *Fc=None*, *detrend=None*, *window=None*, *noverlap=None*, *cmap=None*, *xextent=None*, *pad\_to=None*, *sides=None*, *scale\_by\_freq=None*, *mode=None*, *scale=None*, *vmin=None*, *vmax=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7557-L7712)
Plot a spectrogram.
Compute and plot a spectrogram of data in *x*. Data are split into *NFFT* length segments and the spectrum of each section is computed. The windowing function *window* is applied to each segment, and the amount of overlap of each segment is specified with *noverlap*. The spectrogram is plotted as a colormap (using imshow).
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. This can be different from *NFFT*, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to *NFFT*
**NFFT**int, default: 256
The number of data points used in each block for the FFT. A power 2 is most efficient. This should *NOT* be used to get zero padding, or the scaling of the result will be incorrect; use *pad\_to* for this instead.
**detrend**{'none', 'mean', 'linear'} or callable, default: 'none'
The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter is a vector, in Matplotlib it is a function. The [`mlab`](../mlab_api#module-matplotlib.mlab "matplotlib.mlab") module defines [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"), [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"), and [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear"), but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls [`detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none"). 'mean' calls [`detrend_mean`](../mlab_api#matplotlib.mlab.detrend_mean "matplotlib.mlab.detrend_mean"). 'linear' calls [`detrend_linear`](../mlab_api#matplotlib.mlab.detrend_linear "matplotlib.mlab.detrend_linear").
**scale\_by\_freq**bool, default: True
Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of 1/Hz. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
**mode**{'default', 'psd', 'magnitude', 'angle', 'phase'}
What sort of spectrum to use. Default is 'psd', which takes the power spectral density. 'magnitude' returns the magnitude spectrum. 'angle' returns the phase spectrum without unwrapping. 'phase' returns the phase spectrum with unwrapping.
**noverlap**int, default: 128
The number of points of overlap between blocks.
**scale**{'default', 'linear', 'dB'}
The scaling of the values in the *spec*. 'linear' is no scaling. 'dB' returns the values in dB scale. When *mode* is 'psd', this is dB power (10 \* log10). Otherwise this is dB amplitude (20 \* log10). 'default' is 'dB' if *mode* is 'psd' or 'magnitude' and 'linear' otherwise. This must be 'linear' if *mode* is 'angle' or 'phase'.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
**cmap**[`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
**xextent***None* or (xmin, xmax)
The image extent along the x-axis. The default sets *xmin* to the left border of the first bin (*spectrum* column) and *xmax* to the right border of the last bin. Note that for *noverlap>0* the width of the bins is smaller than those of the segments.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Additional keyword arguments are passed on to [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") which makes the specgram image. The origin keyword argument is not supported.
Returns:
**spectrum**2D array
Columns are the periodograms of successive segments.
**freqs**1-D array
The frequencies corresponding to the rows in *spectrum*.
**t**1-D array
The times corresponding to midpoints of segments (i.e., the columns in *spectrum*).
**im**[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
The image created by imshow containing the spectrogram.
See also
[`psd`](matplotlib.axes.axes.psd#matplotlib.axes.Axes.psd "matplotlib.axes.Axes.psd")
Differs in the default overlap; in returning the mean of the segment periodograms; in not returning times; and in generating a line plot instead of colormap.
[`magnitude_spectrum`](matplotlib.axes.axes.magnitude_spectrum#matplotlib.axes.Axes.magnitude_spectrum "matplotlib.axes.Axes.magnitude_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'magnitude'. Plots a line instead of a colormap.
[`angle_spectrum`](matplotlib.axes.axes.angle_spectrum#matplotlib.axes.Axes.angle_spectrum "matplotlib.axes.Axes.angle_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'angle'. Plots a line instead of a colormap.
[`phase_spectrum`](matplotlib.axes.axes.phase_spectrum#matplotlib.axes.Axes.phase_spectrum "matplotlib.axes.Axes.phase_spectrum")
A single spectrum, similar to having a single segment when *mode* is 'phase'. Plots a line instead of a colormap.
#### Notes
The parameters *detrend* and *scale\_by\_freq* do only apply when *mode* is set to 'psd'.
Examples using `matplotlib.axes.Axes.specgram`
----------------------------------------------
[Spectrogram Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/specgram_demo.html#sphx-glr-gallery-images-contours-and-fields-specgram-demo-py)
Spectrogram Demo
matplotlib matplotlib.pyplot.axes matplotlib.pyplot.axes
======================
matplotlib.pyplot.axes(*arg=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L958-L1053)
Add an Axes to the current figure and make it the current Axes.
Call signatures:
```
plt.axes()
plt.axes(rect, projection=None, polar=False, **kwargs)
plt.axes(ax)
```
Parameters:
**arg**None or 4-tuple
The exact behavior of this function depends on the type:
* *None*: A new full window Axes is added using `subplot(**kwargs)`.
* 4-tuple of floats *rect* = `[left, bottom, width, height]`. A new Axes is added with dimensions *rect* in normalized (0, 1) units using [`add_axes`](../figure_api#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes") on the current figure.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). *str* is the name of a custom projection, see [`projections`](../projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**sharex, sharey**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](../axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared Axes.
**label**str
A label for the returned Axes.
Returns:
[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), or a subclass of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The returned axes class depends on the projection used. It is [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](../projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes class. The keyword arguments for the rectilinear Axes class [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used, see the actual Axes class.
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_axes`](../figure_api#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes")
[`pyplot.subplot`](matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`Figure.add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`Figure.subplots`](../figure_api#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Notes
If the figure already has an Axes with key (*args*, *kwargs*) then it will simply make that axes current and return it. This behavior is deprecated. Meanwhile, if you do not want this behavior (i.e., you want to force the creation of a new axes), you must use a unique set of args and kwargs. The Axes *label* attribute has been exposed for this purpose: if you want two Axes that are otherwise identical to be added to the figure, make sure you give them unique labels.
#### Examples
```
# Creating a new full window Axes
plt.axes()
# Creating a new Axes with specified dimensions and a grey background
plt.axes((left, bottom, width, height), facecolor='grey')
```
Examples using `matplotlib.pyplot.axes`
---------------------------------------
[Subplots spacings and margins](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_adjust.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-adjust-py)
Subplots spacings and margins
[Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html#sphx-glr-gallery-event-handling-lasso-demo-py)
Lasso Demo
| programming_docs |
matplotlib matplotlib.axes.Axes.contourf matplotlib.axes.Axes.contourf
=============================
Axes.contourf(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L6370-L6384)
Plot filled contours.
Call signature:
```
contourf([X, Y,] Z, [levels], **kwargs)
```
[`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") and [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions.
Parameters:
**X, Y**array-like, optional
The coordinates of the values in *Z*.
*X* and *Y* must both be 2D with the same shape as *Z* (e.g. created via [`numpy.meshgrid`](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html#numpy.meshgrid "(in NumPy v1.23)")), or they must both be 1-D such that `len(X) == N` is the number of columns in *Z* and `len(Y) == M` is the number of rows in *Z*.
*X* and *Y* must both be ordered monotonically.
If not given, they are assumed to be integer indices, i.e. `X = range(N)`, `Y = range(M)`.
**Z**(M, N) array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet")
Other Parameters:
**corner\_mask**bool, default: `[rcParams["contour.corner\_mask"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.corner_mask#matplotlibrc-sample)` (default: `True`)
Enable/disable corner masking, which only has an effect if *Z* is a masked array. If `False`, any quad touching a masked point is masked out. If `True`, only the triangular corners of quads nearest those points are always masked out, other triangular corners comprising three unmasked points are contoured as usual.
**colors**color string or sequence of colors, optional
The colors of the levels, i.e. the lines for [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") and the areas for [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf").
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it's repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `contourf`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call `QuadContourSet.changed()` is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`QuadContourSet`](../contour_api#matplotlib.contour.QuadContourSet "matplotlib.contour.QuadContourSet") because it internally calls `QuadContourSet.changed()`.
Example:
```
x = np.arange(1, 10)
y = x.reshape(-1, 1)
h = x * y
cs = plt.contourf(h, levels=[10, 30, 50],
colors=['#808080', '#A0A0A0', '#C0C0C0'], extend='both')
cs.cmap.set_over('red')
cs.cmap.set_under('blue')
cs.changed()
```
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**nchunk**int >= 0, optional
If 0, no subdivision of the domain. Specify a positive integer to divide the domain into subdomains of *nchunk* by *nchunk* quads. Chunking reduces the maximum length of polygons generated by the contouring algorithm which reduces the rendering workload passed on to the backend and also requires slightly less RAM. It can however introduce rendering artifacts at chunk boundaries depending on the backend, the *antialiased* flag and value of *alpha*.
**linewidths**float or array-like, default: `[rcParams["contour.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.linewidth#matplotlibrc-sample)` (default: `None`)
*Only applies to* [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
The line width of the contour lines.
If a number, all levels will be plotted with this linewidth.
If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified.
If None, this falls back to `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`).
**linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
*Only applies to* [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
If *linestyles* is *None*, the default is 'solid' unless the lines are monochrome. In that case, negative contours will instead take their linestyle from the *negative\_linestyles* argument.
*linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
**negative\_linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
*Only applies to* [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
If *linestyles* is *None* and the lines are monochrome, this argument specifies the line style for negative contours.
If *negative\_linestyles* is *None*, the default is taken from `[rcParams["contour.negative\_linestyles"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.negative_linestyles#matplotlibrc-sample)`.
*negative\_linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
**hatches**list[str], optional
*Only applies to* [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf").
A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
**algorithm**{'mpl2005', 'mpl2014', 'serial', 'threaded'}, optional
Which contouring algorithm to use to calculate the contour lines and polygons. The algorithms are implemented in [ContourPy](https://github.com/contourpy/contourpy), consult the [ContourPy documentation](https://contourpy.readthedocs.io) for further information.
The default is taken from `[rcParams["contour.algorithm"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.algorithm#matplotlibrc-sample)` (default: `'mpl2014'`).
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
#### Notes
1. [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
2. [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") fills intervals that are closed at the top; that is, for boundaries *z1* and *z2*, the filled region is:
```
z1 < Z <= z2
```
except for the lowest interval, which is closed on both sides (i.e. it includes the lowest value).
3. [`contour`](matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") and [`contourf`](#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf") use a [marching squares](https://en.wikipedia.org/wiki/Marching_squares) algorithm to compute contour locations. More information can be found in [ContourPy documentation](https://contourpy.readthedocs.io).
Examples using `matplotlib.axes.Axes.contourf`
----------------------------------------------
[Contour Corner Mask](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_corner_mask.html#sphx-glr-gallery-images-contours-and-fields-contour-corner-mask-py)
Contour Corner Mask
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Contourf Hatching](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_hatching.html#sphx-glr-gallery-images-contours-and-fields-contourf-hatching-py)
Contourf Hatching
[Contourf and log color scale](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_log.html#sphx-glr-gallery-images-contours-and-fields-contourf-log-py)
Contourf and log color scale
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[pcolormesh](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-levels-py)
pcolormesh
[3D box surface plot](https://matplotlib.org/stable/gallery/mplot3d/box3d.html#sphx-glr-gallery-mplot3d-box3d-py)
3D box surface plot
[Filled contours](https://matplotlib.org/stable/gallery/mplot3d/contourf3d.html#sphx-glr-gallery-mplot3d-contourf3d-py)
Filled contours
[Projecting filled contour onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contourf3d_2.html#sphx-glr-gallery-mplot3d-contourf3d-2-py)
Projecting filled contour onto a graph
[contourf(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/contourf.html#sphx-glr-plot-types-arrays-contourf-py)
contourf(X, Y, Z)
matplotlib matplotlib.pyplot.draw matplotlib.pyplot.draw
======================
matplotlib.pyplot.draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L924-L936)
Redraw the current figure.
This is used to update a figure that has been altered, but not automatically re-drawn. If interactive mode is on (via [`ion()`](matplotlib.pyplot.ion#matplotlib.pyplot.ion "matplotlib.pyplot.ion")), this should be only rarely needed, but there may be ways to modify the state of a figure without marking it as "stale". Please report these cases as bugs.
This is equivalent to calling `fig.canvas.draw_idle()`, where `fig` is the current figure.
Examples using `matplotlib.pyplot.draw`
---------------------------------------
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
[Rotating a 3D plot](https://matplotlib.org/stable/gallery/mplot3d/rotate_axes3d_sgskip.html#sphx-glr-gallery-mplot3d-rotate-axes3d-sgskip-py)
Rotating a 3D plot
[Buttons](https://matplotlib.org/stable/gallery/widgets/buttons.html#sphx-glr-gallery-widgets-buttons-py)
Buttons
[Check Buttons](https://matplotlib.org/stable/gallery/widgets/check_buttons.html#sphx-glr-gallery-widgets-check-buttons-py)
Check Buttons
[Radio Buttons](https://matplotlib.org/stable/gallery/widgets/radio_buttons.html#sphx-glr-gallery-widgets-radio-buttons-py)
Radio Buttons
[Textbox](https://matplotlib.org/stable/gallery/widgets/textbox.html#sphx-glr-gallery-widgets-textbox-py)
Textbox
matplotlib matplotlib.axis.Axis.get_ticklocs matplotlib.axis.Axis.get\_ticklocs
==================================
Axis.get\_ticklocs(*\**, *minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1436-L1453)
Return this Axis' tick locations in data coordinates.
The locations are not clipped to the current axis limits and hence may contain locations that are not visible in the output.
Parameters:
**minor**bool, default: False
True to return the minor tick directions, False to return the major tick directions.
Returns:
numpy array of tick locations
Examples using `matplotlib.axis.Axis.get_ticklocs`
--------------------------------------------------
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
matplotlib mpl_toolkits.axes_grid1.inset_locator.BboxConnector mpl\_toolkits.axes\_grid1.inset\_locator.BboxConnector
======================================================
*class*mpl\_toolkits.axes\_grid1.inset\_locator.BboxConnector(*bbox1*, *bbox2*, *loc1*, *loc2=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L166-L242)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
Connect two bboxes with a straight line.
Parameters:
**bbox1, bbox2**[`matplotlib.transforms.Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
Bounding boxes to connect.
**loc1, loc2**{1, 2, 3, 4}
Corner of *bbox1* and *bbox2* to draw the line. Valid values are:
```
'upper right' : 1,
'upper left' : 2,
'lower left' : 3,
'lower right' : 4
```
*loc2* is optional and defaults to *loc1*.
**\*\*kwargs**
Patch properties for the line drawn. Valid arguments include:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*static*connect\_bbox(*bbox1*, *bbox2*, *loc1*, *loc2=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L183-L198)
Construct a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") connecting corner *loc1* of *bbox1* to corner *loc2* of *bbox2*, where parameters behave as documented as for the [`BboxConnector`](#mpl_toolkits.axes_grid1.inset_locator.BboxConnector "mpl_toolkits.axes_grid1.inset_locator.BboxConnector") constructor.
*static*get\_bbox\_edge\_pos(*bbox*, *loc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L167-L181)
Return the `(x, y)` coordinates of corner *loc* of *bbox*; parameters behave as documented for the [`BboxConnector`](#mpl_toolkits.axes_grid1.inset_locator.BboxConnector "mpl_toolkits.axes_grid1.inset_locator.BboxConnector") constructor.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L239-L242)
Return the path of this patch.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.inset_locator.BboxConnector`
--------------------------------------------------------------------
[Axes Zoom Effect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_zoom_effect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-zoom-effect-py)
Axes Zoom Effect
| programming_docs |
matplotlib matplotlib.animation.ImageMagickBase matplotlib.animation.ImageMagickBase
====================================
*class*matplotlib.animation.ImageMagickBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L602-L656)
Mixin class for ImageMagick output.
This is a base class for the concrete [`ImageMagickWriter`](matplotlib.animation.imagemagickwriter#matplotlib.animation.ImageMagickWriter "matplotlib.animation.ImageMagickWriter") and [`ImageMagickFileWriter`](matplotlib.animation.imagemagickfilewriter#matplotlib.animation.ImageMagickFileWriter "matplotlib.animation.ImageMagickFileWriter") classes, which define an `input_names` attribute (or property) specifying the input names passed to ImageMagick.
\_\_init\_\_(*\*args*, *\*\*kwargs*)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.ImageMagickBase.__init__ "matplotlib.animation.ImageMagickBase.__init__")(\*args, \*\*kwargs) | |
| [`bin_path`](#matplotlib.animation.ImageMagickBase.bin_path "matplotlib.animation.ImageMagickBase.bin_path")() | |
| [`isAvailable`](#matplotlib.animation.ImageMagickBase.isAvailable "matplotlib.animation.ImageMagickBase.isAvailable")() | |
#### Attributes
| | |
| --- | --- |
| [`delay`](#matplotlib.animation.ImageMagickBase.delay "matplotlib.animation.ImageMagickBase.delay") | |
| [`output_args`](#matplotlib.animation.ImageMagickBase.output_args "matplotlib.animation.ImageMagickBase.output_args") | |
*classmethod*bin\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L642-L647)
*property*delay[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*classmethod*isAvailable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L649-L656)
*property*output\_args[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
matplotlib matplotlib.axes.Axes.get_cursor_data matplotlib.axes.Axes.get\_cursor\_data
======================================
Axes.get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](matplotlib.axes.axes.format_cursor_data#matplotlib.axes.Axes.format_cursor_data "matplotlib.axes.Axes.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](../backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](matplotlib.axes.axes.format_cursor_data#matplotlib.axes.Axes.format_cursor_data "matplotlib.axes.Axes.format_cursor_data")
matplotlib matplotlib.axis.YAxis.get_ticks_position matplotlib.axis.YAxis.get\_ticks\_position
==========================================
YAxis.get\_ticks\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2645-L2651)
Return the ticks position ("left", "right", "default", or "unknown").
matplotlib matplotlib.pyplot.bar matplotlib.pyplot.bar
=====================
matplotlib.pyplot.bar(*x*, *height*, *width=0.8*, *bottom=None*, *\**, *align='center'*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2351-L2357)
Make a bar plot.
The bars are positioned at *x* with the given *align*ment. Their dimensions are given by *height* and *width*. The vertical baseline is *bottom* (default 0).
Many parameters can take either a single value applying to all bars or a sequence of values, one for each bar.
Parameters:
**x**float or array-like
The x coordinates of the bars. See also *align* for the alignment of the bars to the coordinates.
**height**float or array-like
The height(s) of the bars.
**width**float or array-like, default: 0.8
The width(s) of the bars.
**bottom**float or array-like, default: 0
The y coordinate(s) of the bottom side(s) of the bars.
**align**{'center', 'edge'}, default: 'center'
Alignment of the bars to the *x* coordinates:
* 'center': Center the base on the *x* positions.
* 'edge': Align the left edges of the bars with the *x* positions.
To align the bars on the right edge pass a negative *width* and `align='edge'`.
Returns:
[`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer")
Container with all the bars and optionally errorbars.
Other Parameters:
**color**color or list of color, optional
The colors of the bar faces.
**edgecolor**color or list of color, optional
The colors of the bar edges.
**linewidth**float or array-like, optional
Width of the bar edge(s). If 0, don't draw edges.
**tick\_label**str or list of str, optional
The tick labels of the bars. Default: None (Use default numeric labels.)
**label**str or list of str, optional
A single label is attached to the resulting [`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer") as a label for the whole dataset. If a list is provided, it must be the same length as *x* and labels the individual bars. Repeated labels are not de-duplicated and will cause repeated label entries, so this is best used when bars also differ in style (e.g., by passing a list to *color*.)
**xerr, yerr**float or array-like of shape(N,) or shape(2, N), optional
If not *None*, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data:
* scalar: symmetric +/- values for all bars
* shape(N,): symmetric +/- values for each bar
* shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.
* *None*: No errorbar. (Default)
See [Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html) for an example on the usage of *xerr* and *yerr*.
**ecolor**color or list of color, default: 'black'
The line color of the errorbars.
**capsize**float, default: `[rcParams["errorbar.capsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=errorbar.capsize#matplotlibrc-sample)` (default: `0.0`)
The length of the error bar caps in points.
**error\_kw**dict, optional
Dictionary of keyword arguments to be passed to the [`errorbar`](matplotlib.axes.axes.errorbar#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar") method. Values of *ecolor* or *capsize* defined here take precedence over the independent keyword arguments.
**log**bool, default: False
If *True*, set the y-axis to be log scale.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_angle "matplotlib.patches.Rectangle.set_angle") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_bounds "matplotlib.patches.Rectangle.set_bounds") | (left, bottom, width, height) |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_height "matplotlib.patches.Rectangle.set_height") | unknown |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_width "matplotlib.patches.Rectangle.set_width") | unknown |
| [`x`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_x "matplotlib.patches.Rectangle.set_x") | unknown |
| [`xy`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_xy "matplotlib.patches.Rectangle.set_xy") | (float, float) |
| [`y`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_y "matplotlib.patches.Rectangle.set_y") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`barh`](matplotlib.pyplot.barh#matplotlib.pyplot.barh "matplotlib.pyplot.barh")
Plot a horizontal bar plot.
#### Notes
Stacked bars can be achieved by passing individual *bottom* values per bar. See [Stacked bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html).
Examples using `matplotlib.pyplot.bar`
--------------------------------------
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
matplotlib matplotlib.axes.Axes.invert_xaxis matplotlib.axes.Axes.invert\_xaxis
==================================
Axes.invert\_xaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3514-L3524)
Invert the x-axis.
See also
[`xaxis_inverted`](matplotlib.axes.axes.xaxis_inverted#matplotlib.axes.Axes.xaxis_inverted "matplotlib.axes.Axes.xaxis_inverted")
[`get_xlim`](matplotlib.axes.axes.get_xlim#matplotlib.axes.Axes.get_xlim "matplotlib.axes.Axes.get_xlim"), [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim")
[`get_xbound`](matplotlib.axes.axes.get_xbound#matplotlib.axes.Axes.get_xbound "matplotlib.axes.Axes.get_xbound"), [`set_xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound")
matplotlib matplotlib.axes.Axes.invert_yaxis matplotlib.axes.Axes.invert\_yaxis
==================================
Axes.invert\_yaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3763-L3773)
Invert the y-axis.
See also
[`yaxis_inverted`](matplotlib.axes.axes.yaxis_inverted#matplotlib.axes.Axes.yaxis_inverted "matplotlib.axes.Axes.yaxis_inverted")
[`get_ylim`](matplotlib.axes.axes.get_ylim#matplotlib.axes.Axes.get_ylim "matplotlib.axes.Axes.get_ylim"), [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim")
[`get_ybound`](matplotlib.axes.axes.get_ybound#matplotlib.axes.Axes.get_ybound "matplotlib.axes.Axes.get_ybound"), [`set_ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound")
Examples using `matplotlib.axes.Axes.invert_yaxis`
--------------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Marker reference](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html#sphx-glr-gallery-lines-bars-and-markers-marker-reference-py)
Marker reference
matplotlib matplotlib.axes.Axes.get_aspect matplotlib.axes.Axes.get\_aspect
================================
Axes.get\_aspect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1623-L1629)
Return the aspect ratio of the axes scaling.
This is either "auto" or a float giving the ratio of y/x-scale.
matplotlib matplotlib.axis.Axis.axis_date matplotlib.axis.Axis.axis\_date
===============================
Axis.axis\_date(*tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2075-L2090)
Set up axis ticks and labels to treat data along this Axis as dates.
Parameters:
**tz**str or [`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
The timezone used to create date labels.
matplotlib matplotlib.axis.Axis.get_units matplotlib.axis.Axis.get\_units
===============================
Axis.get\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1701-L1703)
Return the units for axis.
matplotlib matplotlib.axis.Axis.set_major_locator matplotlib.axis.Axis.set\_major\_locator
========================================
Axis.set\_major\_locator(*locator*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1792-L1806)
Set the locator of the major ticker.
Parameters:
**locator**[`Locator`](../ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Examples using `matplotlib.axis.Axis.set_major_locator`
-------------------------------------------------------
[Hatch-filled histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/filled_step.html#sphx-glr-gallery-lines-bars-and-markers-filled-step-py)
Hatch-filled histograms
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[3D surface (colormap)](https://matplotlib.org/stable/gallery/mplot3d/surface3d.html#sphx-glr-gallery-mplot3d-surface3d-py)
3D surface (colormap)
[3D surface (checkerboard)](https://matplotlib.org/stable/gallery/mplot3d/surface3d_3.html#sphx-glr-gallery-mplot3d-surface3d-3-py)
3D surface (checkerboard)
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html#sphx-glr-gallery-ticks-date-concise-formatter-py)
Formatting date ticks using ConciseDateFormatter
[Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html#sphx-glr-gallery-ticks-date-demo-convert-py)
Date Demo Convert
[Placing date ticks using recurrence rules](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html#sphx-glr-gallery-ticks-date-demo-rrule-py)
Placing date ticks using recurrence rules
[Custom tick formatter for time series](https://matplotlib.org/stable/gallery/ticks/date_index_formatter.html#sphx-glr-gallery-ticks-date-index-formatter-py)
Custom tick formatter for time series
[Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html#sphx-glr-gallery-ticks-major-minor-demo-py)
Major and minor ticks
[Setting tick labels from a list of values](https://matplotlib.org/stable/gallery/ticks/tick_labels_from_values.html#sphx-glr-gallery-ticks-tick-labels-from-values-py)
Setting tick labels from a list of values
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
| programming_docs |
matplotlib matplotlib.colors.LinearSegmentedColormap matplotlib.colors.LinearSegmentedColormap
=========================================
*class*matplotlib.colors.LinearSegmentedColormap(*name*, *segmentdata*, *N=256*, *gamma=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L944-L1104)
Bases: [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")
Colormap objects based on lookup tables using linear segments.
The lookup table is generated using linear interpolation for each primary color, with the 0-1 domain divided into any number of segments.
Create colormap from linear mapping segments
segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of *x*, *y0*, *y1* tuples, forming rows in a table. Entries for alpha are optional.
Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use:
```
cdict = {'red': [(0.0, 0.0, 0.0),
(0.5, 1.0, 1.0),
(1.0, 1.0, 1.0)],
'green': [(0.0, 0.0, 0.0),
(0.25, 0.0, 0.0),
(0.75, 1.0, 1.0),
(1.0, 1.0, 1.0)],
'blue': [(0.0, 0.0, 0.0),
(0.5, 0.0, 0.0),
(1.0, 1.0, 1.0)]}
```
Each row in the table for a given color is a sequence of *x*, *y0*, *y1* tuples. In each sequence, *x* must increase monotonically from 0 to 1. For any input value *z* falling between *x[i]* and *x[i+1]*, the output value of a given color will be linearly interpolated between *y1[i]* and *y0[i+1]*:
```
row i: x y0 y1
/
/
row i+1: x y0 y1
```
Hence y0 in the first row and y1 in the last row are never used.
See also
[`LinearSegmentedColormap.from_list`](#matplotlib.colors.LinearSegmentedColormap.from_list "matplotlib.colors.LinearSegmentedColormap.from_list")
Static method; factory function for generating a smoothly-varying LinearSegmentedColormap.
*static*from\_list(*name*, *colors*, *N=256*, *gamma=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1022-L1059)
Create a [`LinearSegmentedColormap`](#matplotlib.colors.LinearSegmentedColormap "matplotlib.colors.LinearSegmentedColormap") from a list of colors.
Parameters:
**name**str
The name of the colormap.
**colors**array-like of colors or array-like of (value, color)
If only colors are given, they are equidistantly mapped from the range \([0, 1]\); i.e. 0 maps to `colors[0]` and 1 maps to `colors[-1]`. If (value, color) pairs are given, the mapping is from *value* to *color*. This can be used to divide the range unevenly.
**N**int
The number of rgb quantization levels.
**gamma**float
resampled(*lutsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1061-L1068)
Return a new colormap with *lutsize* entries.
reversed(*name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1075-L1104)
Return a reversed instance of the Colormap.
Parameters:
**name**str, optional
The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "\_r".
Returns:
LinearSegmentedColormap
The reversed colormap.
set\_gamma(*gamma*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1017-L1020)
Set a new gamma value and regenerate colormap.
Examples using `matplotlib.colors.LinearSegmentedColormap`
----------------------------------------------------------
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Scatter plots with a legend](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#sphx-glr-gallery-lines-bars-and-markers-scatter-with-legend-py)
Scatter plots with a legend
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
[Contour Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_image.html#sphx-glr-gallery-images-contours-and-fields-contour-image-py)
Contour Image
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Contourf and log color scale](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_log.html#sphx-glr-gallery-images-contours-and-fields-contourf-log-py)
Contourf and log color scale
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
[Layer Images](https://matplotlib.org/stable/gallery/images_contours_and_fields/layer_images.html#sphx-glr-gallery-images-contours-and-fields-layer-images-py)
Layer Images
[pcolormesh](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-levels-py)
pcolormesh
[Shading example](https://matplotlib.org/stable/gallery/images_contours_and_fields/shading_example.html#sphx-glr-gallery-images-contours-and-fields-shading-example-py)
Shading example
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Creating a colormap from a list of colors](https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-gallery-color-custom-cmap-py)
Creating a colormap from a list of colors
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Demo CurveLinear Grid2](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid2.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid2-py)
Demo CurveLinear Grid2
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[Manual Contour](https://matplotlib.org/stable/gallery/misc/contour_manual.html#sphx-glr-gallery-misc-contour-manual-py)
Manual Contour
[AGG filter](https://matplotlib.org/stable/gallery/misc/demo_agg_filter.html#sphx-glr-gallery-misc-demo-agg-filter-py)
AGG filter
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Demonstrates plotting contour (level) curves in 3D](https://matplotlib.org/stable/gallery/mplot3d/contour3d.html#sphx-glr-gallery-mplot3d-contour3d-py)
Demonstrates plotting contour (level) curves in 3D
[Demonstrates plotting contour (level) curves in 3D using the extend3d option](https://matplotlib.org/stable/gallery/mplot3d/contour3d_2.html#sphx-glr-gallery-mplot3d-contour3d-2-py)
Demonstrates plotting contour (level) curves in 3D using the extend3d option
[Projecting contour profiles onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html#sphx-glr-gallery-mplot3d-contour3d-3-py)
Projecting contour profiles onto a graph
[Filled contours](https://matplotlib.org/stable/gallery/mplot3d/contourf3d.html#sphx-glr-gallery-mplot3d-contourf3d-py)
Filled contours
[Projecting filled contour onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contourf3d_2.html#sphx-glr-gallery-mplot3d-contourf3d-2-py)
Projecting filled contour onto a graph
[Custom hillshading in a 3D surface plot](https://matplotlib.org/stable/gallery/mplot3d/custom_shaded_3d_surface.html#sphx-glr-gallery-mplot3d-custom-shaded-3d-surface-py)
Custom hillshading in a 3D surface plot
[3D plots as subplots](https://matplotlib.org/stable/gallery/mplot3d/subplot3d.html#sphx-glr-gallery-mplot3d-subplot3d-py)
3D plots as subplots
[3D surface (colormap)](https://matplotlib.org/stable/gallery/mplot3d/surface3d.html#sphx-glr-gallery-mplot3d-surface3d-py)
3D surface (colormap)
[3D surface with polar coordinates](https://matplotlib.org/stable/gallery/mplot3d/surface3d_radial.html#sphx-glr-gallery-mplot3d-surface3d-radial-py)
3D surface with polar coordinates
[Triangular 3D contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontour3d.html#sphx-glr-gallery-mplot3d-tricontour3d-py)
Triangular 3D contour plot
[Triangular 3D filled contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontourf3d.html#sphx-glr-gallery-mplot3d-tricontourf3d-py)
Triangular 3D filled contour plot
[More triangular 3D surfaces](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d_2.html#sphx-glr-gallery-mplot3d-trisurf3d-2-py)
More triangular 3D surfaces
[Hillshading](https://matplotlib.org/stable/gallery/specialty_plots/advanced_hillshading.html#sphx-glr-gallery-specialty-plots-advanced-hillshading-py)
Hillshading
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Topographic hillshading](https://matplotlib.org/stable/gallery/specialty_plots/topographic_hillshading.html#sphx-glr-gallery-specialty-plots-topographic-hillshading-py)
Topographic hillshading
[Dropped spines](https://matplotlib.org/stable/gallery/spines/spines_dropped.html#sphx-glr-gallery-spines-spines-dropped-py)
Dropped spines
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py)
Creating Colormaps in Matplotlib
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
matplotlib matplotlib.axes.Axes.axis matplotlib.axes.Axes.axis
=========================
Axes.axis(*\*args*, *emit=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2022-L2148)
Convenience method to get or set some axis properties.
Call signatures:
```
xmin, xmax, ymin, ymax = axis()
xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax])
xmin, xmax, ymin, ymax = axis(option)
xmin, xmax, ymin, ymax = axis(**kwargs)
```
Parameters:
**xmin, xmax, ymin, ymax**float, optional
The axis limits to be set. This can also be achieved using
```
ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax))
```
**option**bool or str
If a bool, turns axis lines and labels on or off. If a string, possible values are:
| Value | Description |
| --- | --- |
| 'on' | Turn on axis lines and labels. Same as `True`. |
| 'off' | Turn off axis lines and labels. Same as `False`. |
| 'equal' | Set equal scaling (i.e., make circles circular) by changing axis limits. This is the same as `ax.set_aspect('equal', adjustable='datalim')`. Explicit data limits may not be respected in this case. |
| 'scaled' | Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box. This is the same as `ax.set_aspect('equal', adjustable='box', anchor='C')`. Additionally, further autoscaling will be disabled. |
| 'tight' | Set limits just large enough to show all data, then disable further autoscaling. |
| 'auto' | Automatic scaling (fill plot box with data). |
| 'image' | 'scaled' with axis limits equal to data limits. |
| 'square' | Square plot; similar to 'scaled', but initially forcing `xmax-xmin == ymax-ymin`. |
**emit**bool, default: True
Whether observers are notified of the axis limit change. This option is passed on to [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") and [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim").
Returns:
**xmin, xmax, ymin, ymax**float
The axis limits.
See also
[`matplotlib.axes.Axes.set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim")
[`matplotlib.axes.Axes.set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim")
Examples using `matplotlib.axes.Axes.axis`
------------------------------------------
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Basic pie chart](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_features.html#sphx-glr-gallery-pie-and-polar-charts-pie-features-py)
Basic pie chart
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html#sphx-glr-gallery-shapes-and-collections-hatch-style-reference-py)
Hatch style reference
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Parasite Simple2](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-gallery-axes-grid1-parasite-simple2-py)
Parasite Simple2
[Simple Axisline4](https://matplotlib.org/stable/gallery/axes_grid1/simple_axisline4.html#sphx-glr-gallery-axes-grid1-simple-axisline4-py)
Simple Axisline4
[Axis Direction](https://matplotlib.org/stable/gallery/axisartist/axis_direction.html#sphx-glr-gallery-axisartist-axis-direction-py)
Axis Direction
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Axis line styles](https://matplotlib.org/stable/gallery/axisartist/demo_axisline_style.html#sphx-glr-gallery-axisartist-demo-axisline-style-py)
Axis line styles
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Ticklabel alignment](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_alignment.html#sphx-glr-gallery-axisartist-demo-ticklabel-alignment-py)
Ticklabel alignment
[Ticklabel direction](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_direction.html#sphx-glr-gallery-axisartist-demo-ticklabel-direction-py)
Ticklabel direction
[Simple Axis Direction01](https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction01.html#sphx-glr-gallery-axisartist-simple-axis-direction01-py)
Simple Axis Direction01
[Simple Axis Direction03](https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction03.html#sphx-glr-gallery-axisartist-simple-axis-direction03-py)
Simple Axis Direction03
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
[Custom spines with axisartist](https://matplotlib.org/stable/gallery/axisartist/simple_axisartist1.html#sphx-glr-gallery-axisartist-simple-axisartist1-py)
Custom spines with axisartist
[Simple Axisline](https://matplotlib.org/stable/gallery/axisartist/simple_axisline.html#sphx-glr-gallery-axisartist-simple-axisline-py)
Simple Axisline
[Simple Axisline3](https://matplotlib.org/stable/gallery/axisartist/simple_axisline3.html#sphx-glr-gallery-axisartist-simple-axisline3-py)
Simple Axisline3
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[MRI](https://matplotlib.org/stable/gallery/specialty_plots/mri_demo.html#sphx-glr-gallery-specialty-plots-mri-demo-py)
===
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
matplotlib mpl_toolkits.axisartist.floating_axes.FloatingAxes mpl\_toolkits.axisartist.floating\_axes.FloatingAxes
====================================================
mpl\_toolkits.axisartist.floating\_axes.FloatingAxes[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py)
alias of `FloatingAxesHostAxes`
matplotlib matplotlib.pyplot.eventplot matplotlib.pyplot.eventplot
===========================
matplotlib.pyplot.eventplot(*positions*, *orientation='horizontal'*, *lineoffsets=1*, *linelengths=1*, *linewidths=None*, *colors=None*, *linestyles='solid'*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2489-L2498)
Plot identical parallel lines at the given positions.
This type of plot is commonly used in neuroscience for representing neural events, where it is usually called a spike raster, dot raster, or raster plot.
However, it is useful in any situation where you wish to show the timing or position of multiple sets of discrete events, such as the arrival times of people to a business on each day of the month or the date of hurricanes each year of the last century.
Parameters:
**positions**array-like or list of array-like
A 1D array-like defines the positions of one sequence of events.
Multiple groups of events may be passed as a list of array-likes. Each group can be styled independently by passing lists of values to *lineoffsets*, *linelengths*, *linewidths*, *colors* and *linestyles*.
Note that *positions* can be a 2D array, but in practice different event groups usually have different counts so that one will use a list of different-length arrays rather than a 2D array.
**orientation**{'horizontal', 'vertical'}, default: 'horizontal'
The direction of the event sequence:
* 'horizontal': the events are arranged horizontally. The indicator lines are vertical.
* 'vertical': the events are arranged vertically. The indicator lines are horizontal.
**lineoffsets**float or array-like, default: 1
The offset of the center of the lines from the origin, in the direction orthogonal to *orientation*.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linelengths**float or array-like, default: 1
The total height of the lines (i.e. the lines stretches from `lineoffset - linelength/2` to `lineoffset + linelength/2`).
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linewidths**float or array-like, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The line width(s) of the event lines, in points.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**colors**color or list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
The color(s) of the event lines.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linestyles**str or tuple or list of such values, default: 'solid'
Default is 'solid'. Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink in points.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*positions*, *lineoffsets*, *linelengths*, *linewidths*, *colors*, *linestyles*
**\*\*kwargs**
Other keyword arguments are line collection properties. See [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") for a list of the valid properties.
Returns:
list of [`EventCollection`](../collections_api#matplotlib.collections.EventCollection "matplotlib.collections.EventCollection")
The [`EventCollection`](../collections_api#matplotlib.collections.EventCollection "matplotlib.collections.EventCollection") that were added.
#### Notes
For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only a single value is given, that value is applied to all lines. If an array-like is given, it must have the same length as *positions*, and each value will be applied to the corresponding row of the array.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.py), [png](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.png))
| programming_docs |
matplotlib matplotlib.pyplot.get_current_fig_manager matplotlib.pyplot.get\_current\_fig\_manager
============================================
matplotlib.pyplot.get\_current\_fig\_manager()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L850-L864)
Return the figure manager of the current figure.
The figure manager is a container for the actual backend-depended window that displays the figure on screen.
If no current figure exists, a new one is created, and its figure manager is returned.
Returns:
[`FigureManagerBase`](../backend_bases_api#matplotlib.backend_bases.FigureManagerBase "matplotlib.backend_bases.FigureManagerBase") or backend-dependent subclass thereof
matplotlib matplotlib.pyplot.isinteractive matplotlib.pyplot.isinteractive
===============================
matplotlib.pyplot.isinteractive()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L412-L439)
Return whether plots are updated after every plotting command.
The interactive mode is mainly useful if you build plots from the command line and want to see the effect of each command while you are building the figure.
In interactive mode:
* newly created figures will be shown immediately;
* figures will automatically redraw on change;
* [`pyplot.show`](matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show") will not block by default.
In non-interactive mode:
* newly created figures and changes to figures will not be reflected until explicitly asked to be;
* [`pyplot.show`](matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show") will block by default.
See also
[`ion`](matplotlib.pyplot.ion#matplotlib.pyplot.ion "matplotlib.pyplot.ion")
Enable interactive mode.
[`ioff`](matplotlib.pyplot.ioff#matplotlib.pyplot.ioff "matplotlib.pyplot.ioff")
Disable interactive mode.
[`show`](matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show")
Show all figures (and maybe block).
[`pause`](matplotlib.pyplot.pause#matplotlib.pyplot.pause "matplotlib.pyplot.pause")
Show all figures, and block for a time.
matplotlib matplotlib.axes.Axes.set_navigate matplotlib.axes.Axes.set\_navigate
==================================
Axes.set\_navigate(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4011-L4019)
Set whether the Axes responds to navigation toolbar commands.
Parameters:
**b**bool
matplotlib matplotlib.pyplot.switch_backend matplotlib.pyplot.switch\_backend
=================================
matplotlib.pyplot.switch\_backend(*newbackend*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L210-L329)
Close all open figures and set the Matplotlib backend.
The argument is case-insensitive. Switching to an interactive backend is possible only if no event loop for another interactive backend has started. Switching to and from non-interactive backends is always possible.
Parameters:
**newbackend**str
The name of the backend to use.
matplotlib matplotlib.pyplot.bar_label matplotlib.pyplot.bar\_label
============================
matplotlib.pyplot.bar\_label(*container*, *labels=None*, *\**, *fmt='%g'*, *label\_type='edge'*, *padding=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2379-L2385)
Label a bar plot.
Adds labels to bars in the given [`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer"). You may need to adjust the axis limits to fit the labels.
Parameters:
**container**[`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer")
Container with all the bars and optionally errorbars, likely returned from [`bar`](matplotlib.pyplot.bar#matplotlib.pyplot.bar "matplotlib.pyplot.bar") or [`barh`](matplotlib.pyplot.barh#matplotlib.pyplot.barh "matplotlib.pyplot.barh").
**labels**array-like, optional
A list of label texts, that should be displayed. If not given, the label texts will be the data values formatted with *fmt*.
**fmt**str, default: '%g'
A format string for the label.
**label\_type**{'edge', 'center'}, default: 'edge'
The label type. Possible values:
* 'edge': label placed at the end-point of the bar segment, and the value displayed will be the position of that end-point.
* 'center': label placed in the center of the bar segment, and the value displayed will be the length of that segment. (useful for stacked bars, i.e., [Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html))
**padding**float, default: 0
Distance of label from the end of the bar, in points.
**\*\*kwargs**
Any remaining keyword arguments are passed through to [`Axes.annotate`](matplotlib.axes.axes.annotate#matplotlib.axes.Axes.annotate "matplotlib.axes.Axes.annotate"). The alignment parameters ( *horizontalalignment* / *ha*, *verticalalignment* / *va*) are not supported because the labels are automatically aligned to the bars.
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
A list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instances for the labels.
matplotlib matplotlib.axes.Axes.set_box_aspect matplotlib.axes.Axes.set\_box\_aspect
=====================================
Axes.set\_box\_aspect(*aspect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1779-L1814)
Set the Axes box aspect, i.e. the ratio of height to width.
This defines the aspect of the Axes in figure space and is not to be confused with the data aspect (see [`set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect")).
Parameters:
**aspect**float or None
Changes the physical dimensions of the Axes, such that the ratio of the Axes height to the Axes width in physical units is equal to *aspect*. Defining a box aspect will change the *adjustable* property to 'datalim' (see [`set_adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable")).
*None* will disable a fixed box aspect so that height and width of the Axes are chosen independently.
See also
[`matplotlib.axes.Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect")
for a description of aspect handling.
Examples using `matplotlib.axes.Axes.set_box_aspect`
----------------------------------------------------
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[3D box surface plot](https://matplotlib.org/stable/gallery/mplot3d/box3d.html#sphx-glr-gallery-mplot3d-box3d-py)
3D box surface plot
matplotlib matplotlib.axes.Axes.hist2d matplotlib.axes.Axes.hist2d
===========================
Axes.hist2d(*x*, *y*, *bins=10*, *range=None*, *density=False*, *weights=None*, *cmin=None*, *cmax=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L6949-L7054)
Make a 2D histogram plot.
Parameters:
**x, y**array-like, shape (n, )
Input values
**bins**None or int or [int, int] or array-like or [array, array]
The bin specification:
* If int, the number of bins for the two dimensions (nx=ny=bins).
* If `[int, int]`, the number of bins in each dimension (nx, ny = bins).
* If array-like, the bin edges for the two dimensions (x\_edges=y\_edges=bins).
* If `[array, array]`, the bin edges in each dimension (x\_edges, y\_edges = bins).
The default value is 10.
**range**array-like shape(2, 2), optional
The leftmost and rightmost edges of the bins along each dimension (if not specified explicitly in the bins parameters): `[[xmin,
xmax], [ymin, ymax]]`. All values outside of this range will be considered outliers and not tallied in the histogram.
**density**bool, default: False
Normalize histogram. See the documentation for the *density* parameter of [`hist`](matplotlib.axes.axes.hist#matplotlib.axes.Axes.hist "matplotlib.axes.Axes.hist") for more details.
**weights**array-like, shape (n, ), optional
An array of values w\_i weighing each sample (x\_i, y\_i).
**cmin, cmax**float, default: None
All bins that has count less than *cmin* or more than *cmax* will not be displayed (set to NaN before passing to imshow) and these count values in the return value count histogram will also be set to nan upon return.
Returns:
**h**2D array
The bi-dimensional histogram of samples x and y. Values in x are histogrammed along the first dimension and values in y are histogrammed along the second dimension.
**xedges**1D array
The bin edges along the x axis.
**yedges**1D array
The bin edges along the y axis.
**image**[`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh")
Other Parameters:
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
**alpha**`0 <= scalar <= 1` or `None`, optional
The alpha blending value.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *weights*
**\*\*kwargs**
Additional parameters are passed along to the [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") method and [`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh") constructor.
See also
[`hist`](matplotlib.axes.axes.hist#matplotlib.axes.Axes.hist "matplotlib.axes.Axes.hist")
1D histogram plotting
[`hexbin`](matplotlib.axes.axes.hexbin#matplotlib.axes.Axes.hexbin "matplotlib.axes.Axes.hexbin")
2D histogram with hexagonal bins
#### Notes
* Currently `hist2d` calculates its own axis limits, and any limits previously set are ignored.
* Rendering the histogram with a logarithmic color scale is accomplished by passing a [`colors.LogNorm`](matplotlib.colors.lognorm#matplotlib.colors.LogNorm "matplotlib.colors.LogNorm") instance to the *norm* keyword argument. Likewise, power-law normalization (similar in effect to gamma correction) can be accomplished with [`colors.PowerNorm`](matplotlib.colors.powernorm#matplotlib.colors.PowerNorm "matplotlib.colors.PowerNorm").
Examples using `matplotlib.axes.Axes.hist2d`
--------------------------------------------
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Exploring normalizations](https://matplotlib.org/stable/gallery/scales/power_norm.html#sphx-glr-gallery-scales-power-norm-py)
Exploring normalizations
[hist2d(x, y)](https://matplotlib.org/stable/plot_types/stats/hist2d.html#sphx-glr-plot-types-stats-hist2d-py)
hist2d(x, y)
matplotlib matplotlib.axis.YAxis.set_offset_position matplotlib.axis.YAxis.set\_offset\_position
===========================================
YAxis.set\_offset\_position(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2551-L2562)
Parameters:
**position**{'left', 'right'}
matplotlib matplotlib.patches.FancyArrowPatch matplotlib.patches.FancyArrowPatch
==================================
*class*matplotlib.patches.FancyArrowPatch(*posA=None*, *posB=None*, *\**, *path=None*, *arrowstyle='simple'*, *connectionstyle='arc3'*, *patchA=None*, *patchB=None*, *shrinkA=2*, *shrinkB=2*, *mutation\_scale=1*, *mutation\_aspect=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4122-L4462)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A fancy arrow patch. It draws an arrow using the [`ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle").
The head and tail positions are fixed at the specified start and end points of the arrow, but the size and shape (in display coordinates) of the arrow does not change when the axis is moved or zoomed.
There are two ways for defining an arrow:
* If *posA* and *posB* are given, a path connecting two points is created according to *connectionstyle*. The path will be clipped with *patchA* and *patchB* and further shrunken by *shrinkA* and *shrinkB*. An arrow is drawn along this resulting path using the *arrowstyle* parameter.
* Alternatively if *path* is provided, an arrow is drawn along this path and *patchA*, *patchB*, *shrinkA*, and *shrinkB* are ignored.
Parameters:
**posA, posB**(float, float), default: None
(x, y) coordinates of arrow tail and arrow head respectively.
**path**[`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path"), default: None
If provided, an arrow is drawn along this path and *patchA*, *patchB*, *shrinkA*, and *shrinkB* are ignored.
**arrowstyle**str or [`ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle"), default: 'simple'
The [`ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") with which the fancy arrow is drawn. If a string, it should be one of the available arrowstyle names, with optional comma-separated attributes. The optional attributes are meant to be scaled with the *mutation\_scale*. The following arrow styles are available:
| Class | Name | Attrs |
| --- | --- | --- |
| Curve | `-` | None |
| CurveA | `<-` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveB | `->` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveAB | `<->` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledA | `<|-` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledB | `-|>` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| CurveFilledAB | `<|-|>` | head\_length=0.4, head\_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None |
| BracketA | `]-` | widthA=1.0, lengthA=0.2, angleA=0 |
| BracketB | `-[` | widthB=1.0, lengthB=0.2, angleB=0 |
| BracketAB | `]-[` | widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0 |
| BarAB | `|-|` | widthA=1.0, angleA=0, widthB=1.0, angleB=0 |
| BracketCurve | `]->` | widthA=1.0, lengthA=0.2, angleA=None |
| CurveBracket | `<-[` | widthB=1.0, lengthB=0.2, angleB=None |
| Simple | `simple` | head\_length=0.5, head\_width=0.5, tail\_width=0.2 |
| Fancy | `fancy` | head\_length=0.4, head\_width=0.4, tail\_width=0.4 |
| Wedge | `wedge` | tail\_width=0.3, shrink\_factor=0.5 |
**connectionstyle**str or [`ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") or None, optional, default: 'arc3'
The [`ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") with which *posA* and *posB* are connected. If a string, it should be one of the available connectionstyle names, with optional comma-separated attributes. The following connection styles are available:
| Class | Name | Attrs |
| --- | --- | --- |
| Arc3 | `arc3` | rad=0.0 |
| Angle3 | `angle3` | angleA=90, angleB=0 |
| Angle | `angle` | angleA=90, angleB=0, rad=0.0 |
| Arc | `arc` | angleA=0, angleB=0, armA=None, armB=None, rad=0.0 |
| Bar | `bar` | armA=0.0, armB=0.0, fraction=0.3, angle=None |
**patchA, patchB**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch"), default: None
Head and tail patches, respectively.
**shrinkA, shrinkB**float, default: 2
Shrinking factor of the tail and head of the arrow respectively.
**mutation\_scale**float, default: 1
Value with which attributes of *arrowstyle* (e.g., *head\_length*) will be scaled.
**mutation\_aspect**None or float, default: None
The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it.
Other Parameters:
**\*\*kwargs**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties, optional
Here is a list of available [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
In contrast to other patches, the default `capstyle` and `joinstyle` for [`FancyArrowPatch`](#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") are set to `"round"`.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4443-L4462)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_arrowstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4364-L4366)
Return the arrowstyle object.
get\_connectionstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4321-L4323)
Return the [`ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") used.
get\_mutation\_aspect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4400-L4403)
Return the aspect ratio of the bbox mutation.
get\_mutation\_scale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4379-L4387)
Return the mutation scale.
Returns:
scalar
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4405-L4412)
Return the path of the arrow in the data coordinates.
*property*get\_path\_in\_displaycoord[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *arrowstyle=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *connectionstyle=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *mutation\_aspect=<UNSET>*, *mutation\_scale=<UNSET>*, *patchA=<UNSET>*, *patchB=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *positions=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`arrowstyle`](#matplotlib.patches.FancyArrowPatch.set_arrowstyle "matplotlib.patches.FancyArrowPatch.set_arrowstyle") | str or [`matplotlib.patches.ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`connectionstyle`](#matplotlib.patches.FancyArrowPatch.set_connectionstyle "matplotlib.patches.FancyArrowPatch.set_connectionstyle") | [ 'arc3' | 'angle3' | 'angle' | 'arc' | 'bar' ] |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`mutation_aspect`](#matplotlib.patches.FancyArrowPatch.set_mutation_aspect "matplotlib.patches.FancyArrowPatch.set_mutation_aspect") | float |
| [`mutation_scale`](#matplotlib.patches.FancyArrowPatch.set_mutation_scale "matplotlib.patches.FancyArrowPatch.set_mutation_scale") | float |
| [`patchA`](#matplotlib.patches.FancyArrowPatch.set_patchA "matplotlib.patches.FancyArrowPatch.set_patchA") | [`patches.Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") |
| [`patchB`](#matplotlib.patches.FancyArrowPatch.set_patchB "matplotlib.patches.FancyArrowPatch.set_patchB") | [`patches.Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`positions`](#matplotlib.patches.FancyArrowPatch.set_positions "matplotlib.patches.FancyArrowPatch.set_positions") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_arrowstyle(*arrowstyle=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4325-L4362)
Set the arrow style, possibly with further attributes.
Attributes from the previous arrow style are not reused.
Without argument (or with `arrowstyle=None`), the available box styles are returned as a human-readable string.
Parameters:
**arrowstyle**str or [`matplotlib.patches.ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle")
The style of the arrow: either a [`ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") instance, or a string, which is the style name and optionally comma separated attributes (e.g. "Fancy,head\_length=0.2"). Such a string is used to construct a [`ArrowStyle`](matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") object, as documented in that class.
The following arrow styles are available:
%(ArrowStyle:table\_and\_accepts)s
**\*\*kwargs**
Additional attributes for the arrow style. See the table above for supported parameters.
#### Examples
```
set_arrowstyle("Fancy,head_length=0.2")
set_arrowstyle("fancy", head_length=0.2)
```
set\_connectionstyle(*connectionstyle=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4281-L4319)
Set the connection style, possibly with further attributes.
Attributes from the previous connection style are not reused.
Without argument (or with `connectionstyle=None`), the available box styles are returned as a human-readable string.
Parameters:
**connectionstyle**str or [`matplotlib.patches.ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle")
The style of the connection: either a [`ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") instance, or a string, which is the style name and optionally comma separated attributes (e.g. "Arc,armA=30,rad=10"). Such a string is used to construct a [`ConnectionStyle`](matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") object, as documented in that class.
The following connection styles are available:
| Class | Name | Attrs |
| --- | --- | --- |
| Arc3 | `arc3` | rad=0.0 |
| Angle3 | `angle3` | angleA=90, angleB=0 |
| Angle | `angle` | angleA=90, angleB=0, rad=0.0 |
| Arc | `arc` | angleA=0, angleB=0, armA=None, armB=None, rad=0.0 |
| Bar | `bar` | armA=0.0, armB=0.0, fraction=0.3, angle=None |
**\*\*kwargs**
Additional attributes for the connection style. See the table above for supported parameters.
#### Examples
```
set_connectionstyle("Arc,armA=30,rad=10")
set_connectionstyle("arc", armA=30, rad=10)
```
set\_mutation\_aspect(*aspect*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4389-L4398)
Set the aspect ratio of the bbox mutation.
Parameters:
**aspect**float
set\_mutation\_scale(*scale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4368-L4377)
Set the mutation scale.
Parameters:
**scale**float
set\_patchA(*patchA*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4259-L4268)
Set the tail patch.
Parameters:
**patchA**[`patches.Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
set\_patchB(*patchB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4270-L4279)
Set the head patch.
Parameters:
**patchB**[`patches.Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
set\_positions(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4243-L4257)
Set the begin and end positions of the connecting path.
Parameters:
**posA, posB**None, tuple
(x, y) coordinates of arrow tail and arrow head respectively. If [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)") use current value.
Examples using `matplotlib.patches.FancyArrowPatch`
---------------------------------------------------
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
| programming_docs |
matplotlib matplotlib.axes.Axes.clabel matplotlib.axes.Axes.clabel
===========================
Axes.clabel(*CS*, *levels=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L6386-L6404)
Label a contour plot.
Adds labels to line contours in given [`ContourSet`](../contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet").
Parameters:
**CS**[`ContourSet`](../contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet") instance
Line contours to label.
**levels**array-like, optional
A list of level values, that should be labeled. The list must be a subset of `CS.levels`. If not given, all levels are labeled.
**\*\*kwargs**
All other parameters are documented in [`clabel`](../contour_api#matplotlib.contour.ContourLabeler.clabel "matplotlib.contour.ContourLabeler.clabel").
Examples using `matplotlib.axes.Axes.clabel`
--------------------------------------------
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
[Contour Label Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_label_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-label-demo-py)
Contour Label Demo
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
matplotlib matplotlib.animation.FFMpegBase matplotlib.animation.FFMpegBase
===============================
*class*matplotlib.animation.FFMpegBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L504-L541)
Mixin class for FFMpeg output.
This is a base class for the concrete [`FFMpegWriter`](matplotlib.animation.ffmpegwriter#matplotlib.animation.FFMpegWriter "matplotlib.animation.FFMpegWriter") and [`FFMpegFileWriter`](matplotlib.animation.ffmpegfilewriter#matplotlib.animation.FFMpegFileWriter "matplotlib.animation.FFMpegFileWriter") classes.
\_\_init\_\_(*\*args*, *\*\*kwargs*)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.FFMpegBase.__init__ "matplotlib.animation.FFMpegBase.__init__")(\*args, \*\*kwargs) | |
#### Attributes
| | |
| --- | --- |
| [`output_args`](#matplotlib.animation.FFMpegBase.output_args "matplotlib.animation.FFMpegBase.output_args") | |
*property*output\_args
matplotlib matplotlib.axis.Axis.set_minor_formatter matplotlib.axis.Axis.set\_minor\_formatter
==========================================
Axis.set\_minor\_formatter(*formatter*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1752-L1764)
Set the formatter of the minor ticker.
In addition to a [`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") instance, this also accepts a `str` or function. See [`Axis.set_major_formatter`](matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") for more information.
Parameters:
**formatter**[`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), `str`, or function
Examples using `matplotlib.axis.Axis.set_minor_formatter`
---------------------------------------------------------
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
matplotlib matplotlib.axes.Axes.can_pan matplotlib.axes.Axes.can\_pan
=============================
Axes.can\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3999-L4003)
Return whether this Axes supports any pan/zoom button functionality.
matplotlib matplotlib.axis.Axis.set_label_coords matplotlib.axis.Axis.set\_label\_coords
=======================================
Axis.set\_label\_coords(*x*, *y*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L744-L762)
Set the coordinates of the label.
By default, the x coordinate of the y label and the y coordinate of the x label are determined by the tick label bounding boxes, but this can lead to poor alignment of multiple labels if there are multiple axes.
You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system: (0, 0) is bottom left, (0.5, 0.5) is center, etc.
matplotlib matplotlib.axis.Axis.remove_overlapping_locs matplotlib.axis.Axis.remove\_overlapping\_locs
==============================================
*property*Axis.remove\_overlapping\_locs
If minor ticker locations that overlap with major ticker locations should be trimmed.
matplotlib matplotlib.pyplot.axhspan matplotlib.pyplot.axhspan
=========================
matplotlib.pyplot.axhspan(*ymin*, *ymax*, *xmin=0*, *xmax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2321-L2323)
Add a horizontal span (rectangle) across the Axes.
The rectangle spans from *ymin* to *ymax* vertically, and, by default, the whole x-axis horizontally. The x-span can be set using *xmin* (default: 0) and *xmax* (default: 1) which are in axis units; e.g. `xmin = 0.5` always refers to the middle of the x-axis regardless of the limits set by [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim").
Parameters:
**ymin**float
Lower y-coordinate of the span, in data units.
**ymax**float
Upper y-coordinate of the span, in data units.
**xmin**float, default: 0
Lower x-coordinate of the span, in x-axis (0-1) units.
**xmax**float, default: 1
Upper x-coordinate of the span, in x-axis (0-1) units.
Returns:
[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`axvspan`](matplotlib.pyplot.axvspan#matplotlib.pyplot.axvspan "matplotlib.pyplot.axvspan")
Add a vertical span across the Axes.
matplotlib matplotlib.axes.Axes.set_prop_cycle matplotlib.axes.Axes.set\_prop\_cycle
=====================================
Axes.set\_prop\_cycle(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1549-L1621)
Set the property cycle of the Axes.
The property cycle controls the style properties such as color, marker and linestyle of future plot commands. The style properties of data already added to the Axes are not modified.
Call signatures:
```
set_prop_cycle(cycler)
set_prop_cycle(label=values[, label2=values2[, ...]])
set_prop_cycle(label, values)
```
Form 1 sets given [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") object.
Form 2 creates a [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") which cycles over one or more properties simultaneously and set it as the property cycle of the Axes. If multiple properties are given, their value lists must have the same length. This is just a shortcut for explicitly creating a cycler and passing it to the function, i.e. it's short for `set_prop_cycle(cycler(label=values label2=values2, ...))`.
Form 3 creates a [`Cycler`](https://matplotlib.org/cycler/generated/cycler.Cycler.html#cycler.Cycler "(in cycler v0.11.0)") for a single property and set it as the property cycle of the Axes. This form exists for compatibility with the original [`cycler.cycler`](https://matplotlib.org/cycler/generated/cycler.cycler.html#cycler.cycler "(in cycler v0.11.0)") interface. Its use is discouraged in favor of the kwarg form, i.e. `set_prop_cycle(label=values)`.
Parameters:
**cycler**Cycler
Set the given Cycler. *None* resets to the cycle defined by the current style.
**label**str
The property key. Must be a valid [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") property. For example, 'color' or 'linestyle'. Aliases are allowed, such as 'c' for 'color' and 'lw' for 'linewidth'.
**values**iterable
Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid.
See also
[`matplotlib.rcsetup.cycler`](../rcsetup_api#matplotlib.rcsetup.cycler "matplotlib.rcsetup.cycler")
Convenience function for creating validated cyclers for properties.
[`cycler.cycler`](https://matplotlib.org/cycler/generated/cycler.cycler.html#cycler.cycler "(in cycler v0.11.0)")
The original function for creating unvalidated cyclers.
#### Examples
Setting the property cycle for a single property:
```
>>> ax.set_prop_cycle(color=['red', 'green', 'blue'])
```
Setting the property cycle for simultaneously cycling over multiple properties (e.g. red circle, green plus, blue cross):
```
>>> ax.set_prop_cycle(color=['red', 'green', 'blue'],
... marker=['o', '+', 'x'])
```
Examples using `matplotlib.axes.Axes.set_prop_cycle`
----------------------------------------------------
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Styling with cycler](https://matplotlib.org/stable/tutorials/intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py)
Styling with cycler
matplotlib matplotlib.pyplot.twiny matplotlib.pyplot.twiny
=======================
matplotlib.pyplot.twiny(*ax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1621-L1634)
Make and return a second axes that shares the *y*-axis. The new axes will overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be on the top.
#### Examples
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html)
matplotlib matplotlib.axes.Axes.get_autoscaley_on matplotlib.axes.Axes.get\_autoscaley\_on
========================================
Axes.get\_autoscaley\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return whether the yaxis is autoscaled.
matplotlib mpl_toolkits.axes_grid1.axes_rgb mpl\_toolkits.axes\_grid1.axes\_rgb
===================================
Classes
-------
| | |
| --- | --- |
| [`RGBAxes`](mpl_toolkits.axes_grid1.axes_rgb.rgbaxes#mpl_toolkits.axes_grid1.axes_rgb.RGBAxes "mpl_toolkits.axes_grid1.axes_rgb.RGBAxes")(\*args[, pad]) | 4-panel imshow (RGB, R, G, B). |
Functions
---------
| | |
| --- | --- |
| [`make_rgb_axes`](mpl_toolkits.axes_grid1.axes_rgb.make_rgb_axes#mpl_toolkits.axes_grid1.axes_rgb.make_rgb_axes "mpl_toolkits.axes_grid1.axes_rgb.make_rgb_axes")(ax[, pad, axes\_class]) | Parameters:
|
matplotlib matplotlib.pyplot.subplots_adjust matplotlib.pyplot.subplots\_adjust
==================================
matplotlib.pyplot.subplots\_adjust(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2247-L2253)
Adjust the subplot layout parameters.
Unset parameters are left unmodified; initial values are given by `[rcParams["figure.subplot.[name]"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.%5Bname%5D#matplotlibrc-sample)`.
Parameters:
**left**float, optional
The position of the left edge of the subplots, as a fraction of the figure width.
**right**float, optional
The position of the right edge of the subplots, as a fraction of the figure width.
**bottom**float, optional
The position of the bottom edge of the subplots, as a fraction of the figure height.
**top**float, optional
The position of the top edge of the subplots, as a fraction of the figure height.
**wspace**float, optional
The width of the padding between subplots, as a fraction of the average Axes width.
**hspace**float, optional
The height of the padding between subplots, as a fraction of the average Axes height.
Examples using `matplotlib.pyplot.subplots_adjust`
--------------------------------------------------
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Subplots spacings and margins](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_adjust.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-adjust-py)
Subplots spacings and margins
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Rotating custom tick labels](https://matplotlib.org/stable/gallery/ticks/ticklabels_rotation.html#sphx-glr-gallery-ticks-ticklabels-rotation-py)
Rotating custom tick labels
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.axes_grid.CbarAxes mpl\_toolkits.axes\_grid1.axes\_grid.CbarAxes
=============================================
*class*mpl\_toolkits.axes\_grid1.axes\_grid.CbarAxes(*\*args*, *orientation*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L44-L46)
Bases: [`CbarAxesBase`](mpl_toolkits.axes_grid1.axes_grid.cbaraxesbase#mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase "mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase"), [`Axes`](mpl_toolkits.axes_grid1.mpl_axes.axes#mpl_toolkits.axes_grid1.mpl_axes.Axes "mpl_toolkits.axes_grid1.mpl_axes.Axes")
[*Deprecated*]
#### Notes
Deprecated since version 3.5:
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](../axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib matplotlib.axes.Axes.bxp matplotlib.axes.Axes.bxp
========================
Axes.bxp(*bxpstats*, *positions=None*, *widths=None*, *vert=True*, *patch\_artist=False*, *shownotches=False*, *showmeans=False*, *showcaps=True*, *showbox=True*, *showfliers=True*, *boxprops=None*, *whiskerprops=None*, *flierprops=None*, *medianprops=None*, *capprops=None*, *meanprops=None*, *meanline=False*, *manage\_ticks=True*, *zorder=None*, *capwidths=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L3950-L4236)
Drawing function for box and whisker plots.
Make a box and whisker plot for each column of *x* or each vector in sequence *x*. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers.
Parameters:
**bxpstats**list of dicts
A list of dictionaries containing stats for each boxplot. Required keys are:
* `med`: Median (scalar).
* `q1`, `q3`: First & third quartiles (scalars).
* `whislo`, `whishi`: Lower & upper whisker positions (scalars).
Optional keys are:
* `mean`: Mean (scalar). Needed if `showmeans=True`.
* `fliers`: Data beyond the whiskers (array-like). Needed if `showfliers=True`.
* `cilo`, `cihi`: Lower & upper confidence intervals about the median. Needed if `shownotches=True`.
* `label`: Name of the dataset (str). If available, this will be used a tick label for the boxplot
**positions**array-like, default: [1, 2, ..., n]
The positions of the boxes. The ticks and limits are automatically set to match the positions.
**widths**float or array-like, default: None
The widths of the boxes. The default is `clip(0.15*(distance between extreme positions), 0.15, 0.5)`.
**capwidths**float or array-like, default: None
Either a scalar or a vector and sets the width of each cap. The default is `0.5*(with of the box)`, see *widths*.
**vert**bool, default: True
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") (default), makes the boxes vertical. If [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)"), makes horizontal boxes.
**patch\_artist**bool, default: False
If [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)") produces boxes with the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") artist. If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") produces boxes with the [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") artist.
**shownotches, showmeans, showcaps, showbox, showfliers**bool
Whether to draw the CI notches, the mean value (both default to False), the caps, the box, and the fliers (all three default to True).
**boxprops, whiskerprops, capprops, flierprops, medianprops, meanprops**dict, optional
Artist properties for the boxes, whiskers, caps, fliers, medians, and means.
**meanline**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") (and *showmeans* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)")), will try to render the mean as a line spanning the full width of the box according to *meanprops*. Not recommended if *shownotches* is also True. Otherwise, means will be shown as points.
**manage\_ticks**bool, default: True
If True, the tick locations and labels will be adjusted to match the boxplot positions.
**zorder**float, default: `Line2D.zorder = 2`
The zorder of the resulting boxplot.
Returns:
dict
A dictionary mapping each component of the boxplot to a list of the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances created. That dictionary has the following keys (assuming vertical boxplots):
* `boxes`: main bodies of the boxplot showing the quartiles, and the median's confidence intervals if enabled.
* `medians`: horizontal lines at the median of each box.
* `whiskers`: vertical lines up to the last non-outlier data.
* `caps`: horizontal lines at the ends of the whiskers.
* `fliers`: points representing data beyond the whiskers (fliers).
* `means`: points or lines representing the means.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/statistics/bxp.py), [png](https://matplotlib.org/stable/gallery/statistics/bxp_00_00.png))
([png](https://matplotlib.org/stable/gallery/statistics/bxp_01_00.png))
| programming_docs |
matplotlib matplotlib.axes.Axes.set_yscale matplotlib.axes.Axes.set\_yscale
================================
Axes.set\_yscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the yaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](../scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](../scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](../scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](../scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](../scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](../scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](../scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
Examples using `matplotlib.axes.Axes.set_yscale`
------------------------------------------------
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Artist customization in box plots](https://matplotlib.org/stable/gallery/statistics/boxplot.html#sphx-glr-gallery-statistics-boxplot-py)
Artist customization in box plots
[Boxplot drawer function](https://matplotlib.org/stable/gallery/statistics/bxp.html#sphx-glr-gallery-statistics-bxp-py)
Boxplot drawer function
[Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html#sphx-glr-gallery-statistics-errorbar-features-py)
Different ways of specifying error bars
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Log Bar](https://matplotlib.org/stable/gallery/scales/log_bar.html#sphx-glr-gallery-scales-log-bar-py)
Log Bar
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
matplotlib matplotlib.axes.Axes.axhline matplotlib.axes.Axes.axhline
============================
Axes.axhline(*y=0*, *xmin=0*, *xmax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L699-L765)
Add a horizontal line across the Axes.
Parameters:
**y**float, default: 0
y position in data coordinates of the horizontal line.
**xmin**float, default: 0
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
**xmax**float, default: 1
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
Returns:
[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Other Parameters:
**\*\*kwargs**
Valid keyword arguments are [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties, with the exception of 'transform':
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`hlines`](matplotlib.axes.axes.hlines#matplotlib.axes.Axes.hlines "matplotlib.axes.Axes.hlines")
Add horizontal lines in data coordinates.
[`axhspan`](matplotlib.axes.axes.axhspan#matplotlib.axes.Axes.axhspan "matplotlib.axes.Axes.axhspan")
Add a horizontal span (rectangle) across the axis.
[`axline`](matplotlib.axes.axes.axline#matplotlib.axes.Axes.axline "matplotlib.axes.Axes.axline")
Add a line with an arbitrary slope.
#### Examples
* draw a thick red hline at 'y' = 0 that spans the xrange:
```
>>> axhline(linewidth=4, color='r')
```
* draw a default hline at 'y' = 1 that spans the xrange:
```
>>> axhline(y=1)
```
* draw a default hline at 'y' = .5 that spans the middle half of the xrange:
```
>>> axhline(y=.5, xmin=0.25, xmax=0.75)
```
Examples using `matplotlib.axes.Axes.axhline`
---------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Filling the area between lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-demo-py)
Filling the area between lines
[Using span\_where](https://matplotlib.org/stable/gallery/lines_bars_and_markers/span_regions.html#sphx-glr-gallery-lines-bars-and-markers-span-regions-py)
Using span\_where
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Multiline](https://matplotlib.org/stable/gallery/text_labels_and_annotations/multiline.html#sphx-glr-gallery-text-labels-and-annotations-multiline-py)
Multiline
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib matplotlib.animation.MovieWriterRegistry matplotlib.animation.MovieWriterRegistry
========================================
*class*matplotlib.animation.MovieWriterRegistry[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L95-L148)
Registry of available writer classes by human readable name.
\_\_init\_\_()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L98-L99)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.MovieWriterRegistry.__init__ "matplotlib.animation.MovieWriterRegistry.__init__")() | |
| [`is_available`](#matplotlib.animation.MovieWriterRegistry.is_available "matplotlib.animation.MovieWriterRegistry.is_available")(name) | Check if given writer is available by name. |
| [`list`](#matplotlib.animation.MovieWriterRegistry.list "matplotlib.animation.MovieWriterRegistry.list")() | Get a list of available MovieWriters. |
| [`register`](#matplotlib.animation.MovieWriterRegistry.register "matplotlib.animation.MovieWriterRegistry.register")(name) | Decorator for registering a class under a name. |
is\_available(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L116-L132)
Check if given writer is available by name.
Parameters:
**name**str
Returns:
bool
list()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L140-L142)
Get a list of available MovieWriters.
register(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L101-L114)
Decorator for registering a class under a name.
Example use:
```
@registry.register(name)
class Foo:
pass
```
matplotlib matplotlib.pyplot.xlim matplotlib.pyplot.xlim
======================
matplotlib.pyplot.xlim(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1680-L1714)
Get or set the x limits of the current axes.
Call signatures:
```
left, right = xlim() # return the current xlim
xlim((left, right)) # set the xlim to left, right
xlim(left, right) # set the xlim to left, right
```
If you do not specify args, you can pass *left* or *right* as kwargs, i.e.:
```
xlim(right=3) # adjust the right leaving left unchanged
xlim(left=1) # adjust the left leaving right unchanged
```
Setting limits turns autoscaling off for the x-axis.
Returns:
left, right
A tuple of the new x-axis limits.
#### Notes
Calling this function with no arguments (e.g. `xlim()`) is the pyplot equivalent of calling [`get_xlim`](matplotlib.axes.axes.get_xlim#matplotlib.axes.Axes.get_xlim "matplotlib.axes.Axes.get_xlim") on the current axes. Calling this function with arguments is the pyplot equivalent of calling [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") on the current axes. All arguments are passed though.
Examples using `matplotlib.pyplot.xlim`
---------------------------------------
[Shared Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/shared_axis_demo.html#sphx-glr-gallery-subplots-axes-and-figures-shared-axis-demo-py)
Shared Axis
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Frame grabbing](https://matplotlib.org/stable/gallery/animation/frame_grabbing_sgskip.html#sphx-glr-gallery-animation-frame-grabbing-sgskip-py)
Frame grabbing
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
matplotlib matplotlib.colors.to_rgb matplotlib.colors.to\_rgb
=========================
matplotlib.colors.to\_rgb(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L494-L496)
Convert *c* to an RGB color, silently dropping the alpha channel.
Examples using `matplotlib.colors.to_rgb`
-----------------------------------------
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
matplotlib matplotlib.axis.Axis.get_minpos matplotlib.axis.Axis.get\_minpos
================================
Axis.get\_minpos()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2150-L2151)
matplotlib mpl_toolkits.axes_grid1.axes_divider.Divider mpl\_toolkits.axes\_grid1.axes\_divider.Divider
===============================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.Divider(*fig*, *pos*, *horizontal*, *vertical*, *aspect=None*, *anchor='C'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L15-L288)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
An Axes positioning class.
The divider is initialized with lists of horizontal and vertical sizes ([`mpl_toolkits.axes_grid1.axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size")) based on which a given rectangular area will be divided.
The [`new_locator`](#mpl_toolkits.axes_grid1.axes_divider.Divider.new_locator "mpl_toolkits.axes_grid1.axes_divider.Divider.new_locator") method then creates a callable object that can be used as the *axes\_locator* of the axes.
Parameters:
**fig**Figure
**pos**tuple of 4 floats
Position of the rectangle that will be divided.
**horizontal**list of [`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size")
Sizes for horizontal division.
**vertical**list of [`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size")
Sizes for vertical division.
**aspect**bool
Whether overall rectangular area is reduced so that the relative part of the horizontal and vertical scales have the same scale.
**anchor**(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}
Placement of the reduced rectangle, when *aspect* is True.
add\_auto\_adjustable\_area(*use\_axes*, *pad=0.1*, *adjust\_dirs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L271-L288)
Add auto-adjustable padding around *use\_axes* to take their decorations (title, labels, ticks, ticklabels) into account during layout.
Parameters:
**use\_axes**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or list of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes whose decorations are taken into account.
**pad**float, optional
Additional padding in inches.
**adjust\_dirs**list of {"left", "right", "bottom", "top"}, optional
The sides where padding is added; defaults to all four sides.
append\_size(*position*, *size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L257-L269)
get\_anchor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L127-L129)
Return the anchor.
get\_aspect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L165-L167)
Return aspect.
get\_horizontal()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L140-L142)
Return horizontal sizes.
get\_horizontal\_sizes(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L58-L59)
get\_locator()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L172-L173)
get\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L103-L105)
Return the position of the rectangle.
get\_position\_runtime(*ax*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L175-L179)
get\_vertical()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L153-L155)
Return vertical sizes.
get\_vertical\_sizes(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L61-L62)
get\_vsize\_hsize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L64-L68)
[*Deprecated*]
#### Notes
Deprecated since version 3.5:
locate(*nx*, *ny*, *nx1=None*, *ny1=None*, *axes=None*, *renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L181-L236)
Parameters:
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
**ny, ny1**int
Same as *nx* and *nx1*, but for row positions.
**axes**
**renderer**
new\_locator(*nx*, *ny*, *nx1=None*, *ny1=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L238-L255)
Return a new [`AxesLocator`](mpl_toolkits.axes_grid1.axes_divider.axeslocator#mpl_toolkits.axes_grid1.axes_divider.AxesLocator "mpl_toolkits.axes_grid1.axes_divider.AxesLocator") for the specified cell.
Parameters:
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
**ny, ny1**int
Same as *nx* and *nx1*, but for row positions.
set\_anchor(*anchor*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L107-L125)
Parameters:
**anchor**(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}
Either an (*x*, *y*) pair of relative coordinates (0 is left or bottom, 1 is right or top), 'C' (center), or a cardinal direction ('SW', southwest, is bottom left, etc.).
See also
[`Axes.set_anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor")
set\_aspect(*aspect=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L157-L163)
Parameters:
**aspect**bool
set\_horizontal(*h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L131-L138)
Parameters:
**h**list of [`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size")
sizes for horizontal division
set\_locator(*\_locator*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L169-L170)
set\_position(*pos*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L92-L101)
Set the position of the rectangle.
Parameters:
**pos**tuple of 4 floats
position of the rectangle that will be divided
set\_vertical(*v*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L144-L151)
Parameters:
**v**list of [`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size")
sizes for vertical division
| programming_docs |
matplotlib matplotlib.artist.Artist.get_gid matplotlib.artist.Artist.get\_gid
=================================
Artist.get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
Examples using `matplotlib.artist.Artist.get_gid`
-------------------------------------------------
[SVG Filter Pie](https://matplotlib.org/stable/gallery/misc/svg_filter_pie.html#sphx-glr-gallery-misc-svg-filter-pie-py)
SVG Filter Pie
matplotlib matplotlib.axes.Axes.set_xbound matplotlib.axes.Axes.set\_xbound
================================
Axes.set\_xbound(*lower=None*, *upper=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3544-L3574)
Set the lower and upper numerical bounds of the x-axis.
This method will honor axis inversion regardless of parameter order. It will not change the autoscaling setting ([`get_autoscalex_on()`](matplotlib.axes.axes.get_autoscalex_on#matplotlib.axes.Axes.get_autoscalex_on "matplotlib.axes.Axes.get_autoscalex_on")).
Parameters:
**lower, upper**float or None
The lower and upper bounds. If *None*, the respective axis bound is not modified.
See also
[`get_xbound`](matplotlib.axes.axes.get_xbound#matplotlib.axes.Axes.get_xbound "matplotlib.axes.Axes.get_xbound")
[`get_xlim`](matplotlib.axes.axes.get_xlim#matplotlib.axes.Axes.get_xlim "matplotlib.axes.Axes.get_xlim"), [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim")
[`invert_xaxis`](matplotlib.axes.axes.invert_xaxis#matplotlib.axes.Axes.invert_xaxis "matplotlib.axes.Axes.invert_xaxis"), [`xaxis_inverted`](matplotlib.axes.axes.xaxis_inverted#matplotlib.axes.Axes.xaxis_inverted "matplotlib.axes.Axes.xaxis_inverted")
matplotlib matplotlib.pyplot.step matplotlib.pyplot.step
======================
matplotlib.pyplot.step(*x*, *y*, *\*args*, *where='pre'*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2854-L2858)
Make a step plot.
Call signatures:
```
step(x, y, [fmt], *, data=None, where='pre', **kwargs)
step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)
```
This is just a thin wrapper around [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") which changes some formatting options. Most of the concepts and parameters of plot can be used here as well.
Note
This method uses a standard plot with a step drawstyle: The *x* values are the reference positions and steps extend left/right/both directions depending on *where*.
For the common case where you know the values and edges of the steps, use [`stairs`](matplotlib.axes.axes.stairs#matplotlib.axes.Axes.stairs "matplotlib.axes.Axes.stairs") instead.
Parameters:
**x**array-like
1D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing.
**y**array-like
1D sequence of y levels.
**fmt**str, optional
A format string, e.g. 'g' for a green line. See [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") for a more detailed description.
Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument *linestyle* instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots.
**where**{'pre', 'post', 'mid'}, default: 'pre'
Define where the steps should be placed:
* 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval `(x[i-1], x[i]]` has the value `y[i]`.
* 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval `[x[i], x[i+1])` has the value `y[i]`.
* 'mid': Steps occur half-way between the *x* positions.
**data**indexable object, optional
An object with labelled data. If given, provide the label names to plot in *x* and *y*.
**\*\*kwargs**
Additional parameters are the same as those for [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot").
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Objects representing the plotted data.
Examples using `matplotlib.pyplot.step`
---------------------------------------
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py)
Step Demo
matplotlib matplotlib.axes.Axes.tripcolor matplotlib.axes.Axes.tripcolor
==============================
Axes.tripcolor(*\*args*, *alpha=1.0*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *shading='flat'*, *facecolors=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tripcolor.py#L9-L154)
Create a pseudocolor plot of an unstructured triangular grid.
Call signatures:
```
tripcolor(triangulation, C, *, ...)
tripcolor(x, y, C, *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters.
It is possible to pass the triangles positionally, i.e. `tripcolor(x, y, triangles, C, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly. In this case, it does not make sense to provide colors at the triangle faces via *C* or *facecolors* because there are multiple possible triangulations for a group of points and you don't know which triangles will be constructed.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation")
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**C**array-like
The color values, either for the points or for the triangles. Which one is automatically inferred from the length of *C*, i.e. does it match the number of points or the number of triangles. If there are the same number of points and triangles in the triangulation it is assumed that color values are defined at points; to force the use of color values at triangles use the keyword argument `facecolors=C` instead of just `C`. This parameter is position-only.
**facecolors**array-like, optional
Can be used alternatively to *C* to specify colors at the triangle faces. This parameter takes precedence over *C*.
**shading**{'flat', 'gouraud'}, default: 'flat'
If 'flat' and the color values *C* are defined at points, the color values used for each triangle are from the mean C of the triangle's three points. If *shading* is 'gouraud' then color values must be defined at points.
**other\_parameters**
All other parameters are the same as for [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor").
Examples using `matplotlib.axes.Axes.tripcolor`
-----------------------------------------------
[Tripcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tripcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-tripcolor-demo-py)
Tripcolor Demo
[tripcolor(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tripcolor.html#sphx-glr-plot-types-unstructured-tripcolor-py)
tripcolor(x, y, z)
matplotlib matplotlib.axes.Axes.get_adjustable matplotlib.axes.Axes.get\_adjustable
====================================
Axes.get\_adjustable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1701-L1713)
Return whether the Axes will adjust its physical dimension ('box') or its data limits ('datalim') to achieve the desired aspect ratio.
See also
[`matplotlib.axes.Axes.set_adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable")
Set how the Axes adjusts to achieve the required aspect ratio.
[`matplotlib.axes.Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect")
For a description of aspect handling.
matplotlib matplotlib.colors.AsinhNorm matplotlib.colors.AsinhNorm
===========================
*class*matplotlib.colors.AsinhNorm(*linear\_width=1*, *vmin=None*, *vmax=None*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1820-L1849)
Bases: [`AsinhNorm`](#matplotlib.colors.AsinhNorm "matplotlib.colors.AsinhNorm")
The inverse hyperbolic sine scale is approximately linear near the origin, but becomes logarithmic for larger positive or negative values. Unlike the [`SymLogNorm`](matplotlib.colors.symlognorm#matplotlib.colors.SymLogNorm "matplotlib.colors.SymLogNorm"), the transition between these linear and logarithmic regions is smooth, which may reduce the risk of visual artifacts.
Note
This API is provisional and may be revised in the future based on early user feedback.
Parameters:
**linear\_width**float, default: 1
The effective width of the linear region, beyond which the transformation becomes asymptotically logarithmic
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1676-L1695)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
autoscale(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1714-L1717)
Set *vmin*, *vmax* to min, max of *A*.
autoscale\_None(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1719-L1721)
If vmin or vmax are not set, use the min/max of *A* to set them.
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1697-L1712)
Examples using `matplotlib.colors.AsinhNorm`
--------------------------------------------
[Colormap Normalizations SymLogNorm](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations_symlognorm.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-symlognorm-py)
Colormap Normalizations SymLogNorm
matplotlib matplotlib.pyplot.cla matplotlib.pyplot.cla
=====================
matplotlib.pyplot.cla()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1073-L1076)
Clear the current axes.
matplotlib matplotlib.pyplot.xticks matplotlib.pyplot.xticks
========================
matplotlib.pyplot.xticks(*ticks=None*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1754-L1814)
Get or set the current tick locations and labels of the x-axis.
Pass no arguments to return the current values without modifying them.
Parameters:
**ticks**array-like, optional
The list of xtick locations. Passing an empty list removes all xticks.
**labels**array-like, optional
The labels to place at the given *ticks* locations. This argument can only be passed if *ticks* is passed as well.
**minor**bool, default: False
If `False`, get/set the major ticks/labels; if `True`, the minor ticks/labels.
**\*\*kwargs**
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties can be used to control the appearance of the labels.
Returns:
locs
The list of xtick locations.
labels
The list of xlabel [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") objects.
#### Notes
Calling this function with no arguments (e.g. `xticks()`) is the pyplot equivalent of calling [`get_xticks`](matplotlib.axes.axes.get_xticks#matplotlib.axes.Axes.get_xticks "matplotlib.axes.Axes.get_xticks") and [`get_xticklabels`](matplotlib.axes.axes.get_xticklabels#matplotlib.axes.Axes.get_xticklabels "matplotlib.axes.Axes.get_xticklabels") on the current axes. Calling this function with arguments is the pyplot equivalent of calling [`set_xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") and [`set_xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") on the current axes.
#### Examples
```
>>> locs, labels = xticks() # Get the current locations and labels.
>>> xticks(np.arange(0, 1, step=0.2)) # Set label locations.
>>> xticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
>>> xticks([0, 1, 2], ['January', 'February', 'March'],
... rotation=20) # Set text labels and properties.
>>> xticks([]) # Disable xticks.
```
Examples using `matplotlib.pyplot.xticks`
-----------------------------------------
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Rotating custom tick labels](https://matplotlib.org/stable/gallery/ticks/ticklabels_rotation.html#sphx-glr-gallery-ticks-ticklabels-rotation-py)
Rotating custom tick labels
matplotlib mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d mpl\_toolkits.mplot3d.art3d.pathpatch\_2d\_to\_3d
=================================================
mpl\_toolkits.mplot3d.art3d.pathpatch\_2d\_to\_3d(*pathpatch*, *z=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L387-L394)
Convert a PathPatch to a PathPatch3D object.
Examples using `mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d`
--------------------------------------------------------------
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
matplotlib matplotlib.pyplot.pause matplotlib.pyplot.pause
=======================
matplotlib.pyplot.pause(*interval*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L522-L547)
Run the GUI event loop for *interval* seconds.
If there is an active figure, it will be updated and displayed before the pause, and the GUI event loop (if any) will run during the pause.
This can be used for crude animation. For more complex animation use [`matplotlib.animation`](../animation_api#module-matplotlib.animation "matplotlib.animation").
If there is no active figure, sleep for *interval* seconds instead.
See also
[`matplotlib.animation`](../animation_api#module-matplotlib.animation "matplotlib.animation")
Proper animations
[`show`](matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show")
Show all figures and optional block until all figures are closed.
Examples using `matplotlib.pyplot.pause`
----------------------------------------
[pyplot animation](https://matplotlib.org/stable/gallery/animation/animation_demo.html#sphx-glr-gallery-animation-animation-demo-py)
pyplot animation
[Rotating a 3D plot](https://matplotlib.org/stable/gallery/mplot3d/rotate_axes3d_sgskip.html#sphx-glr-gallery-mplot3d-rotate-axes3d-sgskip-py)
Rotating a 3D plot
[Animating a 3D wireframe plot](https://matplotlib.org/stable/gallery/mplot3d/wire3d_animation_sgskip.html#sphx-glr-gallery-mplot3d-wire3d-animation-sgskip-py)
Animating a 3D wireframe plot
[Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html#sphx-glr-tutorials-advanced-blitting-py)
Faster rendering by using blitting
matplotlib mpl_toolkits.mplot3d.art3d.get_dir_vector mpl\_toolkits.mplot3d.art3d.get\_dir\_vector
============================================
mpl\_toolkits.mplot3d.art3d.get\_dir\_vector(*zdir*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L39-L70)
Return a direction vector.
Parameters:
**zdir**{'x', 'y', 'z', None, 3-tuple}
The direction. Possible values are:
* 'x': equivalent to (1, 0, 0)
* 'y': equivalent to (0, 1, 0)
* 'z': equivalent to (0, 0, 1)
* *None*: equivalent to (0, 0, 0)
* an iterable (x, y, z) is converted to a NumPy array, if not already
Returns:
**x, y, z**array-like
The direction vector.
matplotlib mpl_toolkits.axes_grid1.inset_locator.InsetPosition mpl\_toolkits.axes\_grid1.inset\_locator.InsetPosition
======================================================
*class*mpl\_toolkits.axes\_grid1.inset\_locator.InsetPosition(*parent*, *lbwh*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L16-L57)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
An object for positioning an inset axes.
This is created by specifying the normalized coordinates in the axes, instead of the figure.
Parameters:
**parent**[`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Axes to use for normalizing coordinates.
**lbwh**iterable of four floats
The left edge, bottom edge, width, and height of the inset axes, in units of the normalized coordinate of the *parent* axes.
See also
[`matplotlib.axes.Axes.set_axes_locator()`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator")
#### Examples
The following bounds the inset axes to a box with 20% of the parent axes's height and 40% of the width. The size of the axes specified ([0, 0, 1, 1]) ensures that the axes completely fills the bounding box:
```
>>> parent_axes = plt.gca()
>>> ax_ins = plt.axes([0, 0, 1, 1])
>>> ip = InsetPosition(ax, [0.5, 0.1, 0.4, 0.2])
>>> ax_ins.set_axes_locator(ip)
```
\_\_call\_\_(*ax*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L52-L57)
Call self as a function.
matplotlib matplotlib.pyplot.phase_spectrum matplotlib.pyplot.phase\_spectrum
=================================
matplotlib.pyplot.phase\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2698-L2704)
Plot the phase spectrum.
Compute the phase spectrum (unwrapped angle spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the phase spectrum in radians (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`magnitude_spectrum`](matplotlib.pyplot.magnitude_spectrum#matplotlib.pyplot.magnitude_spectrum "matplotlib.pyplot.magnitude_spectrum")
Plots the magnitudes of the corresponding frequencies.
[`angle_spectrum`](matplotlib.pyplot.angle_spectrum#matplotlib.pyplot.angle_spectrum "matplotlib.pyplot.angle_spectrum")
Plots the wrapped version of this function.
[`specgram`](matplotlib.pyplot.specgram#matplotlib.pyplot.specgram "matplotlib.pyplot.specgram")
Can plot the phase spectrum of segments within the signal in a colormap.
| programming_docs |
matplotlib matplotlib.patches.Circle matplotlib.patches.Circle
=========================
*class*matplotlib.patches.Circle(*xy*, *radius=5*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1856-L1895)
Bases: [`Ellipse`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse "matplotlib.patches.Ellipse")
A circle patch.
Create a true circle at center *xy* = (*x*, *y*) with given *radius*.
Unlike [`CirclePolygon`](matplotlib.patches.circlepolygon#matplotlib.patches.CirclePolygon "matplotlib.patches.CirclePolygon") which is a polygonal approximation, this uses Bezier splines and is much closer to a scale-free circle.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_radius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1891-L1893)
Return the radius of the circle.
*property*radius
Return the radius of the circle.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *center=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *radius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_angle "matplotlib.patches.Ellipse.set_angle") | float |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`center`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_center "matplotlib.patches.Ellipse.set_center") | (float, float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_height "matplotlib.patches.Ellipse.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`radius`](#matplotlib.patches.Circle.set_radius "matplotlib.patches.Circle.set_radius") | float |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](matplotlib.patches.ellipse#matplotlib.patches.Ellipse.set_width "matplotlib.patches.Ellipse.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_radius(*radius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1880-L1889)
Set the radius of the circle.
Parameters:
**radius**float
Examples using `matplotlib.patches.Circle`
------------------------------------------
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Grayscale style sheet](https://matplotlib.org/stable/gallery/style_sheets/grayscale.html#sphx-glr-gallery-style-sheets-grayscale-py)
Grayscale style sheet
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Simple Anchored Artists](https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-gallery-axes-grid1-simple-anchored-artists-py)
Simple Anchored Artists
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
matplotlib mpl_toolkits.mplot3d.proj3d.proj_points mpl\_toolkits.mplot3d.proj3d.proj\_points
=========================================
mpl\_toolkits.mplot3d.proj3d.proj\_points(*points*, *M*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L175-L176)
matplotlib mpl_toolkits.axisartist.axislines.GridHelperBase mpl\_toolkits.axisartist.axislines.GridHelperBase
=================================================
*class*mpl\_toolkits.axisartist.axislines.GridHelperBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L310-L356)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
get\_gridlines(*which*, *axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L326-L333)
Return list of grid lines as a list of paths (list of points).
*which* : "major" or "minor" *axis* : "both", "x" or "y"
new\_gridlines(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L335-L356)
[*Deprecated*] Create and return a new GridlineCollection instance.
*which* : "major" or "minor" *axis* : "both", "x" or "y"
#### Notes
Deprecated since version 3.6.
update\_lim(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axislines.py#L316-L321)
matplotlib mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator mpl\_toolkits.axes\_grid1.inset\_locator.AnchoredSizeLocator
============================================================
*class*mpl\_toolkits.axes\_grid1.inset\_locator.AnchoredSizeLocator(*bbox\_to\_anchor*, *x\_size*, *y\_size*, *loc*, *borderpad=0.5*, *bbox\_transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L87-L112)
Bases: [`AnchoredLocatorBase`](mpl_toolkits.axes_grid1.inset_locator.anchoredlocatorbase#mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase "mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase")
Parameters:
**loc**str
The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.4
Padding around the child as fraction of the fontsize.
**borderpad**float, default: 0.5
Padding between the offsetbox frame and the *bbox\_to\_anchor*.
**child**[`OffsetBox`](../offsetbox_api#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The box that will be anchored.
**prop**[`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
This is only used as a reference for paddings. If not given, `[rcParams["legend.fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fontsize#matplotlibrc-sample)` (default: `'medium'`) is used.
**frameon**bool
Whether to draw a frame around the box.
**bbox\_to\_anchor**[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
**bbox\_transform**None or [`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*).
**\*\*kwargs**
All other parameters are passed on to [`OffsetBox`](../offsetbox_api#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox").
#### Notes
See [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for a detailed description of the anchoring mechanism.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L98-L112)
Return the extent of the box as (width, height, x, y).
This is the extent of the child plus the padding.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| programming_docs |
matplotlib matplotlib.axis.XAxis.tick_top matplotlib.axis.XAxis.tick\_top
===============================
XAxis.tick\_top()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2369-L2379)
Move ticks and ticklabels (if present) to the top of the Axes.
Examples using `matplotlib.axis.XAxis.tick_top`
-----------------------------------------------
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
matplotlib matplotlib.axes.Axes.arrow matplotlib.axes.Axes.arrow
==========================
Axes.arrow(*x*, *y*, *dx*, *dy*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5011-L5048)
Add an arrow to the Axes.
This draws an arrow from `(x, y)` to `(x+dx, y+dy)`.
Parameters:
**x, y**float
The x and y coordinates of the arrow base.
**dx, dy**float
The length of the arrow along x and y direction.
**width**float, default: 0.001
Width of full arrow tail.
**length\_includes\_head**bool, default: False
True if head is to be counted in calculating the length.
**head\_width**float or None, default: 3\*width
Total width of the full arrow head.
**head\_length**float or None, default: 1.5\*head\_width
Length of arrow head.
**shape**{'full', 'left', 'right'}, default: 'full'
Draw the left-half, right-half, or full arrow.
**overhang**float, default: 0
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
**head\_starts\_at\_zero**bool, default: False
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
**\*\*kwargs**
[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`FancyArrow`](matplotlib.patches.fancyarrow#matplotlib.patches.FancyArrow "matplotlib.patches.FancyArrow")
The created [`FancyArrow`](matplotlib.patches.fancyarrow#matplotlib.patches.FancyArrow "matplotlib.patches.FancyArrow") object.
#### Notes
The resulting arrow is affected by the Axes aspect ratio and limits. This may produce an arrow whose head is not square with its stem. To create an arrow whose head is square with its stem, use [`annotate()`](matplotlib.axes.axes.annotate#matplotlib.axes.Axes.annotate "matplotlib.axes.Axes.annotate") for example:
```
>>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
... arrowprops=dict(arrowstyle="->"))
```
Examples using `matplotlib.axes.Axes.arrow`
-------------------------------------------
[Arrow Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/arrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-arrow-demo-py)
Arrow Demo
matplotlib matplotlib.axes.Axes.get_autoscale_on matplotlib.axes.Axes.get\_autoscale\_on
=======================================
Axes.get\_autoscale\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2617-L2620)
Return True if each axis is autoscaled, False otherwise.
matplotlib mpl_toolkits.axes_grid1.mpl_axes.SimpleAxisArtist mpl\_toolkits.axes\_grid1.mpl\_axes.SimpleAxisArtist
====================================================
*class*mpl\_toolkits.axes\_grid1.mpl\_axes.SimpleAxisArtist(*axis*, *axisnum*, *spine*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/mpl_axes.py#L59-L128)
Bases: [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
*property*label
*property*major\_ticklabels
*property*major\_ticks
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | unknown |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_label(*txt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/mpl_axes.py#L96-L97)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/mpl_axes.py#L90-L94)
Set the artist's visibility.
Parameters:
**b**bool
toggle(*all=None*, *ticks=None*, *ticklabels=None*, *label=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/mpl_axes.py#L99-L128)
matplotlib matplotlib.axes.Axes.stale matplotlib.axes.Axes.stale
==========================
*property*Axes.stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
matplotlib matplotlib.axes.Axes.add_container matplotlib.axes.Axes.add\_container
===================================
Axes.add\_container(*container*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2470-L2479)
Add a [`Container`](../container_api#matplotlib.container.Container "matplotlib.container.Container") to the Axes' containers; return the container.
matplotlib matplotlib.axes.Axes.yaxis_date matplotlib.axes.Axes.yaxis\_date
================================
Axes.yaxis\_date(*tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set up axis ticks and labels to treat data along the yaxis as dates.
Parameters:
**tz**str or [`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
The timezone used to create date labels.
matplotlib matplotlib.axis.Tick.update_position matplotlib.axis.Tick.update\_position
=====================================
Tick.update\_position(*loc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L403-L405)
Set the location of tick in data coords with scalar *loc*.
matplotlib matplotlib.pyplot.waitforbuttonpress matplotlib.pyplot.waitforbuttonpress
====================================
matplotlib.pyplot.waitforbuttonpress(*timeout=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2269-L2271)
Blocking call to interact with the figure.
Wait for user input and return True if a key was pressed, False if a mouse button was pressed and None if no input was given within *timeout* seconds. Negative values deactivate *timeout*.
Examples using `matplotlib.pyplot.waitforbuttonpress`
-----------------------------------------------------
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
matplotlib matplotlib.axis.Axis.set_label_position matplotlib.axis.Axis.set\_label\_position
=========================================
Axis.set\_label\_position(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2140-L2148)
Set the label position (top or bottom)
Parameters:
**position**{'top', 'bottom'}
Examples using `matplotlib.axis.Axis.set_label_position`
--------------------------------------------------------
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
matplotlib matplotlib.artist.Artist.set_in_layout matplotlib.artist.Artist.set\_in\_layout
========================================
Artist.set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](../figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
Examples using `matplotlib.artist.Artist.set_in_layout`
-------------------------------------------------------
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.pyplot.magnitude_spectrum matplotlib.pyplot.magnitude\_spectrum
=====================================
matplotlib.pyplot.magnitude\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *scale=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2642-L2649)
Plot the magnitude spectrum.
Compute the magnitude spectrum of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**scale**{'default', 'linear', 'dB'}
The scaling of the values in the *spec*. 'linear' is no scaling. 'dB' returns the values in dB scale, i.e., the dB amplitude (20 \* log10). 'default' is 'linear'.
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the magnitude spectrum before scaling (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`psd`](matplotlib.pyplot.psd#matplotlib.pyplot.psd "matplotlib.pyplot.psd")
Plots the power spectral density.
[`angle_spectrum`](matplotlib.pyplot.angle_spectrum#matplotlib.pyplot.angle_spectrum "matplotlib.pyplot.angle_spectrum")
Plots the angles of the corresponding frequencies.
[`phase_spectrum`](matplotlib.pyplot.phase_spectrum#matplotlib.pyplot.phase_spectrum "matplotlib.pyplot.phase_spectrum")
Plots the phase (unwrapped angle) of the corresponding frequencies.
[`specgram`](matplotlib.pyplot.specgram#matplotlib.pyplot.specgram "matplotlib.pyplot.specgram")
Can plot the magnitude spectrum of segments within the signal in a colormap.
| programming_docs |
matplotlib matplotlib.colors.PowerNorm matplotlib.colors.PowerNorm
===========================
*class*matplotlib.colors.PowerNorm(*gamma*, *vmin=None*, *vmax=None*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1852-L1900)
Bases: [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
Linearly map a given value to the 0-1 range and then apply a power-law normalization over that range.
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1861-L1888)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1890-L1900)
Examples using `matplotlib.colors.PowerNorm`
--------------------------------------------
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[Exploring normalizations](https://matplotlib.org/stable/gallery/scales/power_norm.html#sphx-glr-gallery-scales-power-norm-py)
Exploring normalizations
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
matplotlib matplotlib.axis.Axis.set_minor_locator matplotlib.axis.Axis.set\_minor\_locator
========================================
Axis.set\_minor\_locator(*locator*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1808-L1822)
Set the locator of the minor ticker.
Parameters:
**locator**[`Locator`](../ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Examples using `matplotlib.axis.Axis.set_minor_locator`
-------------------------------------------------------
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html#sphx-glr-gallery-ticks-date-demo-convert-py)
Date Demo Convert
[Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html#sphx-glr-gallery-ticks-major-minor-demo-py)
Major and minor ticks
matplotlib matplotlib.pyplot.violinplot matplotlib.pyplot.violinplot
============================
matplotlib.pyplot.violinplot(*dataset*, *positions=None*, *vert=True*, *widths=0.5*, *showmeans=False*, *showextrema=True*, *showmedians=False*, *quantiles=None*, *points=100*, *bw\_method=None*, *\**, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2956-L2966)
Make a violin plot.
Make a violin plot for each column of *dataset* or each vector in sequence *dataset*. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, the maximum, and user-specified quantiles.
Parameters:
**dataset**Array or a sequence of vectors.
The input data.
**positions**array-like, default: [1, 2, ..., n]
The positions of the violins. The ticks and limits are automatically set to match the positions.
**vert**bool, default: True.
If true, creates a vertical violin plot. Otherwise, creates a horizontal violin plot.
**widths**array-like, default: 0.5
Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space.
**showmeans**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), will toggle rendering of the means.
**showextrema**bool, default: True
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), will toggle rendering of the extrema.
**showmedians**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), will toggle rendering of the medians.
**quantiles**array-like, default: None
If not None, set a list of floats in interval [0, 1] for each violin, which stands for the quantiles that will be rendered for that violin.
**points**int, default: 100
Defines the number of points to evaluate each of the gaussian kernel density estimations at.
**bw\_method**str, scalar or callable, optional
The method used to calculate the estimator bandwidth. This can be 'scott', 'silverman', a scalar constant or a callable. If a scalar, this will be used directly as `kde.factor`. If a callable, it should take a [`matplotlib.mlab.GaussianKDE`](../mlab_api#matplotlib.mlab.GaussianKDE "matplotlib.mlab.GaussianKDE") instance as its only parameter and return a scalar. If None (default), 'scott' is used.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*dataset*
Returns:
dict
A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys:
* `bodies`: A list of the [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") instances containing the filled area of each violin.
* `cmeans`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the mean values of each of the violin's distribution.
* `cmins`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the bottom of each violin's distribution.
* `cmaxes`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the top of each violin's distribution.
* `cbars`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the centers of each violin's distribution.
* `cmedians`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the median values of each of the violin's distribution.
* `cquantiles`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance created to identify the quantile values of each of the violin's distribution.
matplotlib matplotlib.pyplot.ylabel matplotlib.pyplot.ylabel
========================
matplotlib.pyplot.ylabel(*ylabel*, *fontdict=None*, *labelpad=None*, *\**, *loc=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L3013-L3017)
Set the label for the y-axis.
Parameters:
**ylabel**str
The label text.
**labelpad**float, default: `[rcParams["axes.labelpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.labelpad#matplotlibrc-sample)` (default: `4.0`)
Spacing in points from the Axes bounding box including ticks and tick labels. If None, the previous value is left as is.
**loc**{'bottom', 'center', 'top'}, default: `[rcParams["yaxis.labellocation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=yaxis.labellocation#matplotlibrc-sample)` (default: `'center'`)
The label position. This is a high-level alternative for passing parameters *y* and *horizontalalignment*.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties control the appearance of the label.
See also
[`text`](matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text")
Documents the properties supported by [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
Examples using `matplotlib.pyplot.ylabel`
-----------------------------------------
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Simple](https://matplotlib.org/stable/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py)
Pyplot Simple
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Solarized Light stylesheet](https://matplotlib.org/stable/gallery/style_sheets/plot_solarizedlight2.html#sphx-glr-gallery-style-sheets-plot-solarizedlight2-py)
Solarized Light stylesheet
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib mpl_toolkits.axes_grid1.axes_divider.SubplotDivider mpl\_toolkits.axes\_grid1.axes\_divider.SubplotDivider
======================================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.SubplotDivider(*fig*, *\*args*, *horizontal=None*, *vertical=None*, *aspect=None*, *anchor='C'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L352-L391)
Bases: [`Divider`](mpl_toolkits.axes_grid1.axes_divider.divider#mpl_toolkits.axes_grid1.axes_divider.Divider "mpl_toolkits.axes_grid1.axes_divider.Divider")
The Divider class whose rectangle area is specified as a subplot geometry.
Parameters:
**fig**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**\*args**tuple (*nrows*, *ncols*, *index*) or int
The array of subplots in the figure has dimensions `(nrows,
ncols)`, and *index* is the index of the subplot being created. *index* starts at 1 in the upper left corner and increases to the right.
If *nrows*, *ncols*, and *index* are all single digit numbers, then *args* can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
get\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L380-L382)
Return the bounds of the subplot box.
get\_subplotspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L384-L386)
Get the SubplotSpec instance.
set\_subplotspec(*subplotspec*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L388-L391)
Set the SubplotSpec instance.
matplotlib matplotlib.artist.Artist.get_in_layout matplotlib.artist.Artist.get\_in\_layout
========================================
Artist.get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](../figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
matplotlib mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxesBase mpl\_toolkits.axes\_grid1.parasite\_axes.ParasiteAxesBase
=========================================================
*class*mpl\_toolkits.axes\_grid1.parasite\_axes.ParasiteAxesBase(*parent\_axes*, *aux\_transform=None*, *\**, *viewlim\_mode=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L10-L89)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
apply\_aspect(*position=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L85-L87)
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L20-L23)
get\_images\_artists()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L25-L38)
[*Deprecated*]
#### Notes
Deprecated since version 3.5:
get\_viewlim\_mode()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L69-L70)
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L40-L50)
set\_viewlim\_mode(*mode*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L65-L67)
Examples using `mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxesBase`
-----------------------------------------------------------------------
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
matplotlib matplotlib.axes.Axes.get_position matplotlib.axes.Axes.get\_position
==================================
Axes.get\_position(*original=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1039-L1061)
Return the position of the Axes within the figure as a [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**original**bool
If `True`, return the original position. Otherwise return the active position. For an explanation of the positions see [`set_position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position").
Returns:
[`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
Examples using `matplotlib.axes.Axes.get_position`
--------------------------------------------------
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
matplotlib matplotlib.artist.Artist.contains matplotlib.artist.Artist.contains
=================================
Artist.contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L457-L478)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](../backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
Examples using `matplotlib.artist.Artist.contains`
--------------------------------------------------
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
matplotlib mpl_toolkits.mplot3d.art3d.line_collection_2d_to_3d mpl\_toolkits.mplot3d.art3d.line\_collection\_2d\_to\_3d
========================================================
mpl\_toolkits.mplot3d.art3d.line\_collection\_2d\_to\_3d(*col*, *zs=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L316-L320)
Convert a LineCollection to a Line3DCollection object.
matplotlib matplotlib.axes.Axes.set_ymargin matplotlib.axes.Axes.set\_ymargin
=================================
Axes.set\_ymargin(*m*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2678-L2698)
Set padding of Y data limits prior to autoscaling.
*m* times the data interval will be added to each end of that interval before it is used in autoscaling. If *m* is negative, this will clip the data range instead of expanding it.
For example, if your data is in the range [0, 2], a margin of 0.1 will result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range of [0.2, 1.8].
Parameters:
**m**float greater than -0.5
matplotlib mpl_toolkits.axes_grid1.axes_size.Add mpl\_toolkits.axes\_grid1.axes\_size.Add
========================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.Add(*a*, *b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L29-L37)
Bases: `_Base`
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L34-L37)
matplotlib matplotlib.pyplot.ticklabel_format matplotlib.pyplot.ticklabel\_format
===================================
matplotlib.pyplot.ticklabel\_format(*\**, *axis='both'*, *style=''*, *scilimits=None*, *useOffset=None*, *useLocale=None*, *useMathText=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2911-L2918)
Configure the [`ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") used by default for linear Axes.
If a parameter is not set, the corresponding property of the formatter is left unchanged.
Parameters:
**axis**{'x', 'y', 'both'}, default: 'both'
The axis to configure. Only major ticks are affected.
**style**{'sci', 'scientific', 'plain'}
Whether to use scientific notation. The formatter default is to use scientific notation.
**scilimits**pair of ints (m, n)
Scientific notation is used only for numbers outside the range 10m to 10n (and only if the formatter is configured to use scientific notation at all). Use (0, 0) to include all numbers. Use (m, m) where m != 0 to fix the order of magnitude to 10m. The formatter default is `[rcParams["axes.formatter.limits"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.limits#matplotlibrc-sample)` (default: `[-5, 6]`).
**useOffset**bool or float
If True, the offset is calculated as needed. If False, no offset is used. If a numeric value, it sets the offset. The formatter default is `[rcParams["axes.formatter.useoffset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.useoffset#matplotlibrc-sample)` (default: `True`).
**useLocale**bool
Whether to format the number using the current locale or using the C (English) locale. This affects e.g. the decimal separator. The formatter default is `[rcParams["axes.formatter.use\_locale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_locale#matplotlibrc-sample)` (default: `False`).
**useMathText**bool
Render the offset and scientific notation in mathtext. The formatter default is `[rcParams["axes.formatter.use\_mathtext"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#matplotlibrc-sample)` (default: `False`).
Raises:
AttributeError
If the current formatter is not a [`ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter").
| programming_docs |
matplotlib matplotlib.axes.Axes.get_images matplotlib.axes.Axes.get\_images
================================
Axes.get\_images()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2154-L2156)
Return a list of [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")s contained by the Axes.
matplotlib matplotlib.axes.Axes.autoscale matplotlib.axes.Axes.autoscale
==============================
Axes.autoscale(*enable=True*, *axis='both'*, *tight=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2799-L2842)
Autoscale the axis view to the data (toggle).
Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or Axes.
Parameters:
**enable**bool or None, default: True
True turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged.
**axis**{'both', 'x', 'y'}, default: 'both'
The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three axes.)
**tight**bool or None, default: None
If True, first set the margins to zero. Then, this argument is forwarded to [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") (regardless of its value); see the description of its behavior there.
Examples using `matplotlib.axes.Axes.autoscale`
-----------------------------------------------
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Autoscaling](https://matplotlib.org/stable/tutorials/intermediate/autoscale.html#sphx-glr-tutorials-intermediate-autoscale-py)
Autoscaling
matplotlib mpl_toolkits.axisartist.clip_path.atan2 mpl\_toolkits.axisartist.clip\_path.atan2
=========================================
mpl\_toolkits.axisartist.clip\_path.atan2(*dy*, *dx*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/clip_path.py#L10-L15)
matplotlib matplotlib.axes.Axes.get_xmajorticklabels matplotlib.axes.Axes.get\_xmajorticklabels
==========================================
Axes.get\_xmajorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the xaxis' major tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
matplotlib matplotlib.axes.Axes.drag_pan matplotlib.axes.Axes.drag\_pan
==============================
Axes.drag\_pan(*button*, *key*, *x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4291-L4311)
Called when the mouse moves during a pan operation.
Parameters:
**button**[`MouseButton`](../backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
**key**str or None
The pressed key, if any.
**x, y**float
The mouse coordinates in display coords.
#### Notes
This is intended to be overridden by new projection types.
matplotlib matplotlib.pyplot.streamplot matplotlib.pyplot.streamplot
============================
matplotlib.pyplot.streamplot(*x*, *y*, *u*, *v*, *density=1*, *linewidth=None*, *color=None*, *cmap=None*, *norm=None*, *arrowsize=1*, *arrowstyle='-|>'*, *minlength=0.1*, *transform=None*, *zorder=None*, *start\_points=None*, *maxlength=4.0*, *integration\_direction='both'*, *broken\_streamlines=True*, *\**, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2862-L2879)
Draw streamlines of a vector flow.
Parameters:
**x, y**1D/2D arrays
Evenly spaced strictly increasing arrays to make a grid. If 2D, all rows of *x* must be equal and all columns of *y* must be equal; i.e., they must be as if generated by `np.meshgrid(x_1d, y_1d)`.
**u, v**2D arrays
*x* and *y*-velocities. The number of rows and columns must match the length of *y* and *x*, respectively.
**density**float or (float, float)
Controls the closeness of streamlines. When `density = 1`, the domain is divided into a 30x30 grid. *density* linearly scales this grid. Each cell in the grid can have, at most, one traversing streamline. For different densities in each direction, use a tuple (density\_x, density\_y).
**linewidth**float or 2D array
The width of the stream lines. With a 2D array the line width can be varied across the grid. The array must have the same shape as *u* and *v*.
**color**color or 2D array
The streamline color. If given an array, its values are converted to colors using *cmap* and *norm*. The array must have the same shape as *u* and *v*.
**cmap, norm**
Data normalization and colormapping parameters for *color*; only used if *color* is an array of floats. See [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") for a detailed description.
**arrowsize**float
Scaling factor for the arrow size.
**arrowstyle**str
Arrow style specification. See [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch").
**minlength**float
Minimum length of streamline in axes coordinates.
**start\_points**Nx2 array
Coordinates of starting points for the streamlines in data coordinates (the same coordinates as the *x* and *y* arrays).
**zorder**int
The zorder of the stream lines and arrows. Artists with lower zorder values are drawn first.
**maxlength**float
Maximum length of streamline in axes coordinates.
**integration\_direction**{'forward', 'backward', 'both'}, default: 'both'
Integrate the streamline in forward, backward or both directions.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *u*, *v*, *start\_points*
**broken\_streamlines**boolean, default: True
If False, forces streamlines to continue until they leave the plot domain. If True, they may be terminated if they come too close to another streamline.
Returns:
StreamplotSet
Container object with attributes
* `lines`: [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") of streamlines
* `arrows`: [`PatchCollection`](../collections_api#matplotlib.collections.PatchCollection "matplotlib.collections.PatchCollection") containing [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") objects representing the arrows half-way along stream lines.
This container will probably change in the future to allow changes to the colormap, alpha, etc. for both lines and arrows, but these changes should be backward compatible.
matplotlib matplotlib.axes.Axes.vlines matplotlib.axes.Axes.vlines
===========================
Axes.vlines(*x*, *ymin*, *ymax*, *colors=None*, *linestyles='solid'*, *label=''*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L1102-L1180)
Plot vertical lines at each *x* from *ymin* to *ymax*.
Parameters:
**x**float or array-like
x-indexes where to plot the lines.
**ymin, ymax**float or array-like
Respective beginning and end of each line. If scalars are provided, all lines will have the same length.
**colors**list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
**linestyles**{'solid', 'dashed', 'dashdot', 'dotted'}, optional
**label**str, default: ''
Returns:
[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *ymin*, *ymax*, *colors*
**\*\*kwargs**[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") properties.
See also
[`hlines`](matplotlib.axes.axes.hlines#matplotlib.axes.Axes.hlines "matplotlib.axes.Axes.hlines")
horizontal lines
[`axvline`](matplotlib.axes.axes.axvline#matplotlib.axes.Axes.axvline "matplotlib.axes.Axes.axvline")
vertical line across the Axes
Examples using `matplotlib.axes.Axes.vlines`
--------------------------------------------
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[hlines and vlines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/vline_hline_demo.html#sphx-glr-gallery-lines-bars-and-markers-vline-hline-demo-py)
hlines and vlines
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
matplotlib matplotlib.pyplot.getp matplotlib.pyplot.getp
======================
matplotlib.pyplot.getp(*obj*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L570-L572)
Return the value of an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s *property*, or print all of them.
Parameters:
**obj**[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The queried artist; e.g., a [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"), a [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text"), or an [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**property**str or None, default: None
If *property* is 'somename', this function returns `obj.get_somename()`.
If it's None (or unset), it *prints* all gettable properties from *obj*. Many properties have aliases for shorter typing, e.g. 'lw' is an alias for 'linewidth'. In the output, aliases and full property names will be listed as:
property or alias = value
e.g.:
linewidth or lw = 2
See also
[`setp`](matplotlib.pyplot.setp#matplotlib.pyplot.setp "matplotlib.pyplot.setp")
Examples using `matplotlib.pyplot.getp`
---------------------------------------
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
matplotlib matplotlib.artist.Artist.convert_xunits matplotlib.artist.Artist.convert\_xunits
========================================
Artist.convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
matplotlib matplotlib.pyplot.suptitle matplotlib.pyplot.suptitle
==========================
matplotlib.pyplot.suptitle(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2257-L2259)
Add a centered suptitle to the figure.
Parameters:
**t**str
The suptitle text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.98
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: top
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](../text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](../text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the suptitle.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Examples using `matplotlib.pyplot.suptitle`
-------------------------------------------
[Nested Gridspecs](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_nested.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-nested-py)
Nested Gridspecs
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
matplotlib matplotlib.axis.Axis.get_scale matplotlib.axis.Axis.get\_scale
===============================
Axis.get\_scale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L767-L769)
Return this Axis' scale (as a str).
matplotlib matplotlib.axes.Axes.set_axis_on matplotlib.axes.Axes.set\_axis\_on
==================================
Axes.set\_axis\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3445-L3452)
Turn the x- and y-axis on.
This affects the axis lines, ticks, ticklabels, grid and axis labels.
matplotlib mpl_toolkits.axisartist.axis_artist.LabelBase mpl\_toolkits.axisartist.axis\_artist.LabelBase
===============================================
*class*mpl\_toolkits.axisartist.axis\_artist.LabelBase(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L203-L272)
Bases: [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
A base class for AxisLabel and TickLabels. The position and angle of the text are calculated by to offset\_ref\_angle, text\_ref\_angle, and offset\_radius attributes.
Create a [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instance at *x*, *y* with string *text*.
The text is aligned relative to the anchor point (*x*, *y*) according to `horizontalalignment` (default: 'left') and `verticalalignment` (default: 'bottom'). See also [Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html).
While Text accepts the 'label' keyword argument, by default it is not added to the handles of a legend.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L236-L252)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L254-L272)
Return the [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
Parameters:
**renderer**Renderer, optional
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling [`get_window_extent`](#mpl_toolkits.axisartist.axis_artist.LabelBase.get_window_extent "mpl_toolkits.axisartist.axis_artist.LabelBase.get_window_extent") before the first draw. In practice, it is usually easier to trigger a draw first, e.g. by calling [`draw_without_rendering`](../figure_api#matplotlib.figure.Figure.draw_without_rendering "matplotlib.figure.Figure.draw_without_rendering") or `plt.show()`.
**dpi**float, optional
The dpi value for computing the bbox, defaults to `self.figure.dpi` (*not* the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *backgroundcolor=<UNSET>*, *bbox=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *fontfamily=<UNSET>*, *fontproperties=<UNSET>*, *fontsize=<UNSET>*, *fontstretch=<UNSET>*, *fontstyle=<UNSET>*, *fontvariant=<UNSET>*, *fontweight=<UNSET>*, *gid=<UNSET>*, *horizontalalignment=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linespacing=<UNSET>*, *math\_fontfamily=<UNSET>*, *mouseover=<UNSET>*, *multialignment=<UNSET>*, *parse\_math=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *rotation=<UNSET>*, *rotation\_mode=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *transform\_rotates\_text=<UNSET>*, *url=<UNSET>*, *usetex=<UNSET>*, *verticalalignment=<UNSET>*, *visible=<UNSET>*, *wrap=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| programming_docs |
matplotlib matplotlib.axes.Axes.get_yticks matplotlib.axes.Axes.get\_yticks
================================
Axes.get\_yticks(*\**, *minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the yaxis' tick locations in data coordinates.
The locations are not clipped to the current axis limits and hence may contain locations that are not visible in the output.
Parameters:
**minor**bool, default: False
True to return the minor tick directions, False to return the major tick directions.
Returns:
numpy array of tick locations
matplotlib matplotlib.axes.Axes.set_xlim matplotlib.axes.Axes.set\_xlim
==============================
Axes.set\_xlim(*left=None*, *right=None*, *\**, *emit=True*, *auto=False*, *xmin=None*, *xmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3615-L3692)
Set the x-axis view limits.
Parameters:
**left**float, optional
The left xlim in data coordinates. Passing *None* leaves the limit unchanged.
The left and right xlims may also be passed as the tuple (*left*, *right*) as the first positional argument (or as the *left* keyword argument).
**right**float, optional
The right xlim in data coordinates. Passing *None* leaves the limit unchanged.
**emit**bool, default: True
Whether to notify observers of limit change.
**auto**bool or None, default: False
Whether to turn on autoscaling of the x-axis. True turns on, False turns off, None leaves unchanged.
**xmin, xmax**float, optional
They are equivalent to left and right respectively, and it is an error to pass both *xmin* and *left* or *xmax* and *right*.
Returns:
**left, right**(float, float)
The new x-axis limits in data coordinates.
See also
[`get_xlim`](matplotlib.axes.axes.get_xlim#matplotlib.axes.Axes.get_xlim "matplotlib.axes.Axes.get_xlim")
[`set_xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound"), [`get_xbound`](matplotlib.axes.axes.get_xbound#matplotlib.axes.Axes.get_xbound "matplotlib.axes.Axes.get_xbound")
[`invert_xaxis`](matplotlib.axes.axes.invert_xaxis#matplotlib.axes.Axes.invert_xaxis "matplotlib.axes.Axes.invert_xaxis"), [`xaxis_inverted`](matplotlib.axes.axes.xaxis_inverted#matplotlib.axes.Axes.xaxis_inverted "matplotlib.axes.Axes.xaxis_inverted")
#### Notes
The *left* value may be greater than the *right* value, in which case the x-axis values will decrease from left to right.
#### Examples
```
>>> set_xlim(left, right)
>>> set_xlim((left, right))
>>> left, right = set_xlim(left, right)
```
One limit may be left unchanged.
```
>>> set_xlim(right=right_lim)
```
Limits may be passed in reverse order to flip the direction of the x-axis. For example, suppose *x* represents the number of years before present. The x-axis limits might be set like the following so 5000 years ago is on the left of the plot and the present is on the right.
```
>>> set_xlim(5000, 0)
```
Examples using `matplotlib.axes.Axes.set_xlim`
----------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[CSD Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/csd_demo.html#sphx-glr-gallery-lines-bars-and-markers-csd-demo-py)
CSD Demo
[EventCollection Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventcollection-demo-py)
EventCollection Demo
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
[pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-grids-py)
pcolormesh grids and shading
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Invert Axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/invert_axes.html#sphx-glr-gallery-subplots-axes-and-figures-invert-axes-py)
Invert Axes
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
[Including upper and lower limits in error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_limits.html#sphx-glr-gallery-statistics-errorbar-limits-py)
Including upper and lower limits in error bars
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Text Rotation Relative To Line](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation_relative_to_line.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-relative-to-line-py)
Text Rotation Relative To Line
[Annotate Transform](https://matplotlib.org/stable/gallery/pyplots/annotate_transform.html#sphx-glr-gallery-pyplots-annotate-transform-py)
Annotate Transform
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Parasite Simple2](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-gallery-axes-grid1-parasite-simple2-py)
Parasite Simple2
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[XKCD](https://matplotlib.org/stable/gallery/showcase/xkcd.html#sphx-glr-gallery-showcase-xkcd-py)
XKCD
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
 [Rain simulation](https://matplotlib.org/stable/gallery/animation/rain.html#sphx-glr-gallery-animation-rain-py)
Rain simulation
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Resampling Data](https://matplotlib.org/stable/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py)
Resampling Data
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[SVG Filter Line](https://matplotlib.org/stable/gallery/misc/svg_filter_line.html#sphx-glr-gallery-misc-svg-filter-line-py)
SVG Filter Line
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html#sphx-glr-gallery-mplot3d-2dcollections3d-py)
Plot 2D data on 3D plot
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Text annotations in 3D](https://matplotlib.org/stable/gallery/mplot3d/text3d.html#sphx-glr-gallery-mplot3d-text3d-py)
Text annotations in 3D
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
[Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html#sphx-glr-gallery-ticks-date-concise-formatter-py)
Formatting date ticks using ConciseDateFormatter
[Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html#sphx-glr-gallery-ticks-date-demo-convert-py)
Date Demo Convert
[Annotation with units](https://matplotlib.org/stable/gallery/units/annotate_with_units.html#sphx-glr-gallery-units-annotate-with-units-py)
Annotation with units
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
[Annotated Cursor](https://matplotlib.org/stable/gallery/widgets/annotated_cursor.html#sphx-glr-gallery-widgets-annotated-cursor-py)
Annotated Cursor
[Cursor](https://matplotlib.org/stable/gallery/widgets/cursor.html#sphx-glr-gallery-widgets-cursor-py)
Cursor
[Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html#sphx-glr-gallery-widgets-span-selector-py)
Span Selector
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
matplotlib mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredDirectionArrows
===================================================================
*class*mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredDirectionArrows(*transform*, *label\_x*, *label\_y*, *length=0.15*, *fontsize=0.08*, *loc='upper left'*, *angle=0*, *aspect\_ratio=1*, *pad=0.4*, *borderpad=0.4*, *frameon=False*, *color='w'*, *alpha=1*, *sep\_x=0.01*, *sep\_y=0*, *fontproperties=None*, *back\_length=0.15*, *head\_width=10*, *head\_length=15*, *tail\_width=2*, *text\_props=None*, *arrow\_props=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/anchored_artists.py#L291-L461)
Bases: [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox")
Draw two perpendicular arrows to indicate directions.
Parameters:
**transform**[`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transformation object for the coordinate system in use, i.e., `matplotlib.axes.Axes.transAxes`.
**label\_x, label\_y**str
Label text for the x and y arrows
**length**float, default: 0.15
Length of the arrow, given in coordinates of *transform*.
**fontsize**float, default: 0.08
Size of label strings, given in coordinates of *transform*.
**loc**str, default: 'upper left'
Location of the arrow. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**angle**float, default: 0
The angle of the arrows in degrees.
**aspect\_ratio**float, default: 1
The ratio of the length of arrow\_x and arrow\_y. Negative numbers can be used to change the direction.
**pad**float, default: 0.4
Padding around the labels and arrows, in fraction of the font size.
**borderpad**float, default: 0.4
Border padding, in fraction of the font size.
**frameon**bool, default: False
If True, draw a box around the arrows and labels.
**color**str, default: 'white'
Color for the arrows and labels.
**alpha**float, default: 1
Alpha values of the arrows and labels
**sep\_x, sep\_y**float, default: 0.01 and 0 respectively
Separation between the arrows and labels in coordinates of *transform*.
**fontproperties**[`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
Font properties for the label text.
**back\_length**float, default: 0.15
Fraction of the arrow behind the arrow crossing.
**head\_width**float, default: 10
Width of arrow head, sent to ArrowStyle.
**head\_length**float, default: 15
Length of arrow head, sent to ArrowStyle.
**tail\_width**float, default: 2
Width of arrow tail, sent to ArrowStyle.
**text\_props, arrow\_props**dict
Properties of the text and arrows, passed to [`textpath.TextPath`](../textpath_api#matplotlib.textpath.TextPath "matplotlib.textpath.TextPath") and [`patches.FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch").
**\*\*kwargs**
Keyword arguments forwarded to [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
#### Notes
If *prop* is passed as a keyword argument, but *fontproperties* is not, then *prop* is be assumed to be the intended *fontproperties*. Using both *prop* and *fontproperties* is not supported.
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> from mpl_toolkits.axes_grid1.anchored_artists import (
... AnchoredDirectionArrows)
>>> fig, ax = plt.subplots()
>>> ax.imshow(np.random.random((10, 10)))
>>> arrows = AnchoredDirectionArrows(ax.transAxes, '111', '110')
>>> ax.add_artist(arrows)
>>> fig.show()
```
Using several of the optional parameters, creating downward pointing arrow and high contrast text labels.
```
>>> import matplotlib.font_manager as fm
>>> fontprops = fm.FontProperties(family='monospace')
>>> arrows = AnchoredDirectionArrows(ax.transAxes, 'East', 'South',
... loc='lower left', color='k',
... aspect_ratio=-1, sep_x=0.02,
... sep_y=-0.01,
... text_props={'ec':'w', 'fc':'k'},
... fontproperties=fontprops)
```
Attributes:
**arrow\_x, arrow\_y**[`matplotlib.patches.FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch")
Arrow x and y
**text\_path\_x, text\_path\_y**[`matplotlib.textpath.TextPath`](../textpath_api#matplotlib.textpath.TextPath "matplotlib.textpath.TextPath")
Path for arrow labels
**p\_x, p\_y**[`matplotlib.patches.PathPatch`](matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch")
Patch for arrow labels
**box**[`matplotlib.offsetbox.AuxTransformBox`](../offsetbox_api#matplotlib.offsetbox.AuxTransformBox "matplotlib.offsetbox.AuxTransformBox")
Container for the arrows and labels.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows`
---------------------------------------------------------------------------------
[Anchored Direction Arrow](https://matplotlib.org/stable/gallery/axes_grid1/demo_anchored_direction_arrows.html#sphx-glr-gallery-axes-grid1-demo-anchored-direction-arrows-py)
Anchored Direction Arrow
| programming_docs |
matplotlib matplotlib.axis.Axis.get_minorticklines matplotlib.axis.Axis.get\_minorticklines
========================================
Axis.get\_minorticklines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1399-L1406)
Return this Axis' minor tick lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
matplotlib mpl_toolkits.mplot3d.art3d.Patch3DCollection mpl\_toolkits.mplot3d.art3d.Patch3DCollection
=============================================
*class*mpl\_toolkits.mplot3d.art3d.Patch3DCollection(*\*args*, *zs=0*, *zdir='z'*, *depthshade=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L397-L489)
Bases: [`PatchCollection`](../collections_api#matplotlib.collections.PatchCollection "matplotlib.collections.PatchCollection")
A collection of 3D patches.
Create a collection of flat 3D patches with its normal vector pointed in *zdir* direction, and located at *zs* on the *zdir* axis. 'zs' can be a scalar or an array-like of the same length as the number of patches in the collection.
Constructor arguments are the same as for [`PatchCollection`](../collections_api#matplotlib.collections.PatchCollection "matplotlib.collections.PatchCollection"). In addition, keywords *zs=0* and *zdir='z'* are available.
Also, the keyword argument *depthshade* is available to indicate whether or not to shade the patches in order to give the appearance of depth (default is *True*). This is typically desired in scatter plots.
do\_3d\_projection()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L458-L468)
get\_depthshade()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L422-L423)
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L483-L489)
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L480-L481)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *depthshade=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *sort\_zpos=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`3d_properties`](#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_3d_properties "mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_3d_properties") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`depthshade`](#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_depthshade "mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_depthshade") | bool |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PatchCollection.set_paths "matplotlib.collections.PatchCollection.set_paths") | unknown |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`sort_zpos`](#mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_sort_zpos "mpl_toolkits.mplot3d.art3d.Patch3DCollection.set_sort_zpos") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_3d\_properties(*zs*, *zdir*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L443-L456)
set\_depthshade(*depthshade*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L425-L436)
Set whether depth shading is performed on collection members.
Parameters:
**depthshade**bool
Whether to shade the patches in order to give the appearance of depth.
set\_sort\_zpos(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L438-L441)
Set the position to use for z-sorting.
matplotlib matplotlib.artist.Artist.set_agg_filter matplotlib.artist.Artist.set\_agg\_filter
=========================================
Artist.set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
matplotlib matplotlib.axes.Axes.get_shared_y_axes matplotlib.axes.Axes.get\_shared\_y\_axes
=========================================
Axes.get\_shared\_y\_axes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4535-L4537)
Return an immutable view on the shared y-axes Grouper.
matplotlib mpl_toolkits.axes_grid1.parasite_axes.host_subplot_class_factory mpl\_toolkits.axes\_grid1.parasite\_axes.host\_subplot\_class\_factory
======================================================================
mpl\_toolkits.axes\_grid1.parasite\_axes.host\_subplot\_class\_factory(*axes\_class*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L235-L238)
matplotlib matplotlib.axes.Axes.quiver matplotlib.axes.Axes.quiver
===========================
Axes.quiver(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5065-L5074)
Plot a 2D field of arrows.
Call signature:
```
quiver([X, Y], U, V, [C], **kwargs)
```
*X*, *Y* define the arrow locations, *U*, *V* define the arrow directions, and *C* optionally sets the color.
**Arrow length**
The default settings auto-scales the length of the arrows to a reasonable size. To change this behavior see the *scale* and *scale\_units* parameters.
**Arrow shape**
The arrow shape is determined by *width*, *headwidth*, *headlength* and *headaxislength*. See the notes below.
**Arrow styling**
Each arrow is internally represented by a filled polygon with a default edge linewidth of 0. As a result, an arrow is rather a filled area, not a line with a head, and [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties like *linewidth*, *edgecolor*, *facecolor*, etc. act accordingly.
Parameters:
**X, Y**1D or 2D array-like, optional
The x and y coordinates of the arrow locations.
If not given, they will be generated as a uniform integer meshgrid based on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D using `X, Y = np.meshgrid(X, Y)`. In this case `len(X)` and `len(Y)` must match the column and row dimensions of *U* and *V*.
**U, V**1D or 2D array-like
The x and y direction components of the arrow vectors. The interpretation of these components (in data or in screen space) depends on *angles*.
*U* and *V* must have the same number of elements, matching the number of arrow locations in *X*, *Y*. *U* and *V* may be masked. Locations masked in any of *U*, *V*, and *C* will not be drawn.
**C**1D or 2D array-like, optional
Numeric data that defines the arrow colors by colormapping via *norm* and *cmap*.
This does not support explicit colors. If you want to set colors directly, use *color* instead. The size of *C* must match the number of arrow locations.
**angles**{'uv', 'xy'} or array-like, default: 'uv'
Method for determining the angle of the arrows.
* 'uv': Arrow direction in screen coordinates. Use this if the arrows symbolize a quantity that is not based on *X*, *Y* data coordinates.
If *U* == *V* the orientation of the arrow on the plot is 45 degrees counter-clockwise from the horizontal axis (positive to the right).
* 'xy': Arrow direction in data coordinates, i.e. the arrows point from (x, y) to (x+u, y+v). Use this e.g. for plotting a gradient field.
* Arbitrary angles may be specified explicitly as an array of values in degrees, counter-clockwise from the horizontal axis.
In this case *U*, *V* is only used to determine the length of the arrows.
Note: inverting a data axis will correspondingly invert the arrows only with `angles='xy'`.
**pivot**{'tail', 'mid', 'middle', 'tip'}, default: 'tail'
The part of the arrow that is anchored to the *X*, *Y* grid. The arrow rotates about this point.
'mid' is a synonym for 'middle'.
**scale**float, optional
Scales the length of the arrow inversely.
Number of data units per arrow length unit, e.g., m/s per plot width; a smaller scale parameter makes the arrow longer. Default is *None*.
If *None*, a simple autoscaling algorithm is used, based on the average vector length and the number of vectors. The arrow length unit is given by the *scale\_units* parameter.
**scale\_units**{'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, optional
If the *scale* kwarg is *None*, the arrow length unit. Default is *None*.
e.g. *scale\_units* is 'inches', *scale* is 2.0, and `(u, v) = (1, 0)`, then the vector will be 0.5 inches long.
If *scale\_units* is 'width' or 'height', then the vector will be half the width/height of the axes.
If *scale\_units* is 'x' then the vector will be 0.5 x-axis units. To plot vectors in the x-y plane, with u and v having the same units as x and y, use `angles='xy', scale_units='xy', scale=1`.
**units**{'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, default: 'width'
Affects the arrow size (except for the length). In particular, the shaft *width* is measured in multiples of this unit.
Supported values are:
* 'width', 'height': The width or height of the Axes.
* 'dots', 'inches': Pixels or inches based on the figure dpi.
* 'x', 'y', 'xy': *X*, *Y* or \(\sqrt{X^2 + Y^2}\) in data units.
The following table summarizes how these values affect the visible arrow size under zooming and figure size changes:
| units | zoom | figure size change |
| --- | --- | --- |
| 'x', 'y', 'xy' | arrow size scales | *
|
| 'width', 'height' | *
| arrow size scales |
| 'dots', 'inches' | *
| *
|
**width**float, optional
Shaft width in arrow units. All head parameters are relative to *width*.
The default depends on choice of *units* above, and number of vectors; a typical starting value is about 0.005 times the width of the plot.
**headwidth**float, default: 3
Head width as multiple of shaft *width*. See the notes below.
**headlength**float, default: 5
Head length as multiple of shaft *width*. See the notes below.
**headaxislength**float, default: 4.5
Head length at shaft intersection as multiple of shaft *width*. See the notes below.
**minshaft**float, default: 1
Length below which arrow scales, in units of head length. Do not set this to less than 1, or small arrows will look terrible!
**minlength**float, default: 1
Minimum length as a multiple of shaft width; if an arrow length is less than this, plot a dot (hexagon) of this diameter instead.
**color**color or color sequence, optional
Explicit color(s) for the arrows. If *C* has been set, *color* has no effect.
This is a synonym for the [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") *facecolor* parameter.
Returns:
[`Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties, optional
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"):
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Axes.quiverkey`](matplotlib.axes.axes.quiverkey#matplotlib.axes.Axes.quiverkey "matplotlib.axes.Axes.quiverkey")
Add a key to a quiver plot.
#### Notes
**Arrow shape**
The arrow is drawn as a polygon using the nodes as shown below. The values *headwidth*, *headlength*, and *headaxislength* are in units of *width*.
The defaults give a slightly swept-back arrow. Here are some guidelines how to get other head shapes:
* To make the head a triangle, make *headaxislength* the same as *headlength*.
* To make the arrow more pointed, reduce *headwidth* or increase *headlength* and *headaxislength*.
* To make the head smaller relative to the shaft, scale down all the head parameters proportionally.
* To remove the head completely, set all *head* parameters to 0.
* To get a diamond-shaped head, make *headaxislength* larger than *headlength*.
* Warning: For *headaxislength* < (*headlength* / *headwidth*), the "headaxis" nodes (i.e. the ones connecting the head with the shaft) will protrude out of the head in forward direction so that the arrow head looks broken.
Examples using `matplotlib.axes.Axes.quiver`
--------------------------------------------
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
[Quiver Simple Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-simple-demo-py)
Quiver Simple Demo
[Trigradient Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/trigradient_demo.html#sphx-glr-gallery-images-contours-and-fields-trigradient-demo-py)
Trigradient Demo
[3D quiver plot](https://matplotlib.org/stable/gallery/mplot3d/quiver3d.html#sphx-glr-gallery-mplot3d-quiver3d-py)
3D quiver plot
[quiver(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/quiver.html#sphx-glr-plot-types-arrays-quiver-py)
quiver(X, Y, U, V)
| programming_docs |
matplotlib matplotlib.pyplot.fignum_exists matplotlib.pyplot.fignum\_exists
================================
matplotlib.pyplot.fignum\_exists(*num*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L833-L835)
Return whether the figure with the given id exists.
matplotlib matplotlib.axis.Tick.set_label2 matplotlib.axis.Tick.set\_label2
================================
Tick.set\_label2(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L323-L332)
Set the label2 text.
Parameters:
**s**str
matplotlib matplotlib.axes.Axes.get_navigate_mode matplotlib.axes.Axes.get\_navigate\_mode
========================================
Axes.get\_navigate\_mode()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4021-L4025)
Get the navigation toolbar button status: 'PAN', 'ZOOM', or None.
matplotlib mpl_toolkits.axes_grid1.axes_size.AxesY mpl\_toolkits.axes\_grid1.axes\_size.AxesY
==========================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.AxesY(*axes*, *aspect=1.0*, *ref\_ax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L117-L141)
Bases: `_Base`
Scaled size whose relative part corresponds to the data height of the *axes* multiplied by the *aspect*.
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L130-L141)
Examples using `mpl_toolkits.axes_grid1.axes_size.AxesY`
--------------------------------------------------------
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Simple Axes Divider 3](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-gallery-axes-grid1-simple-axes-divider3-py)
Simple Axes Divider 3
matplotlib matplotlib.colors.rgb_to_hsv matplotlib.colors.rgb\_to\_hsv
==============================
matplotlib.colors.rgb\_to\_hsv(*arr*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L2043-L2092)
Convert float rgb values (in the range [0, 1]), in a numpy array to hsv values.
Parameters:
**arr**(..., 3) array-like
All values must be in the range [0, 1]
Returns:
(..., 3) ndarray
Colors converted to hsv values in range [0, 1]
Examples using `matplotlib.colors.rgb_to_hsv`
---------------------------------------------
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
matplotlib matplotlib.pyplot.pcolormesh matplotlib.pyplot.pcolormesh
============================
matplotlib.pyplot.pcolormesh(*\*args*, *alpha=None*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *shading=None*, *antialiased=False*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2684-L2694)
Create a pseudocolor plot with a non-regular rectangular grid.
Call signature:
```
pcolormesh([X, Y,] C, **kwargs)
```
*X* and *Y* can be used to specify the corners of the quadrilaterals.
Hint
[`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") is similar to [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor"). It is much faster and preferred in most cases. For a detailed discussion on the differences see [Differences between pcolor() and pcolormesh()](#differences-pcolor-pcolormesh).
Parameters:
**C**2D array-like
The color-mapped values. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**X, Y**array-like, optional
The coordinates of the corners of quadrilaterals of a pcolormesh:
```
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
+-----+
| |
+-----+
(X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
```
Note that the column index corresponds to the x-coordinate, and the row index corresponds to y. For details, see the [Notes](#axes-pcolormesh-grid-orientation) section below.
If `shading='flat'` the dimensions of *X* and *Y* should be one greater than those of *C*, and the quadrilateral is colored due to the value at `C[i, j]`. If *X*, *Y* and *C* have equal dimensions, a warning will be raised and the last row and column of *C* will be ignored.
If `shading='nearest'` or `'gouraud'`, the dimensions of *X* and *Y* should be the same as those of *C* (if not, a ValueError will be raised). For `'nearest'` the color `C[i, j]` is centered on `(X[i, j], Y[i, j])`. For `'gouraud'`, a smooth interpolation is caried out between the quadrilateral corners.
If *X* and/or *Y* are 1-D arrays or column vectors they will be expanded as needed into the appropriate 2D arrays, making a rectangular grid.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
**edgecolors**{'none', None, 'face', color, color sequence}, optional
The color of the edges. Defaults to 'none'. Possible values:
* 'none' or '': No edge.
* *None*: `[rcParams["patch.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.edgecolor#matplotlibrc-sample)` (default: `'black'`) will be used. Note that currently `[rcParams["patch.force\_edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.force_edgecolor#matplotlibrc-sample)` (default: `False`) has to be True for this to work.
* 'face': Use the adjacent face color.
* A color or sequence of colors will set the edge color.
The singular form *edgecolor* works as an alias.
**alpha**float, default: None
The alpha blending value, between 0 (transparent) and 1 (opaque).
**shading**{'flat', 'nearest', 'gouraud', 'auto'}, optional
The fill style for the quadrilateral; defaults to 'flat' or `[rcParams["pcolor.shading"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=pcolor.shading#matplotlibrc-sample)` (default: `'auto'`). Possible values:
* 'flat': A solid color is used for each quad. The color of the quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by `C[i, j]`. The dimensions of *X* and *Y* should be one greater than those of *C*; if they are the same as *C*, then a deprecation warning is raised, and the last row and column of *C* are dropped.
* 'nearest': Each grid point will have a color centered on it, extending halfway between the adjacent grid centers. The dimensions of *X* and *Y* must be the same as *C*.
* 'gouraud': Each quad will be Gouraud shaded: The color of the corners (i', j') are given by `C[i', j']`. The color values of the area in between is interpolated from the corner values. The dimensions of *X* and *Y* must be the same as *C*. When Gouraud shading is used, *edgecolors* is ignored.
* 'auto': Choose 'flat' if dimensions of *X* and *Y* are one larger than *C*. Choose 'nearest' if dimensions are the same.
See [pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html) for more description.
**snap**bool, default: False
Whether to snap the mesh to pixel boundaries.
**rasterized**bool, optional
Rasterize the pcolormesh when drawing vector graphics. This can speed up rendering and produce smaller files for large data sets. See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Returns:
[`matplotlib.collections.QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Additionally, the following arguments are allowed. They are passed along to the [`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh") constructor:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../collections_api#matplotlib.collections.QuadMesh.set_array "matplotlib.collections.QuadMesh.set_array") | (M, N) array-like or M\*N array-like |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`pcolor`](matplotlib.pyplot.pcolor#matplotlib.pyplot.pcolor "matplotlib.pyplot.pcolor")
An alternative implementation with slightly different features. For a detailed discussion on the differences see [Differences between pcolor() and pcolormesh()](#differences-pcolor-pcolormesh).
[`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow")
If *X* and *Y* are each equidistant, [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") can be a faster alternative.
#### Notes
**Masked arrays**
*C* may be a masked array. If `C[i, j]` is masked, the corresponding quadrilateral will be transparent. Masking of *X* and *Y* is not supported. Use [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") if you need this functionality.
**Grid orientation**
The grid orientation follows the standard matrix convention: An array *C* with shape (nrows, ncolumns) is plotted with the column number as *X* and the row number as *Y*.
**Differences between pcolor() and pcolormesh()**
Both methods are used to create a pseudocolor plot of a 2D array using quadrilaterals.
The main difference lies in the created object and internal data handling: While [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") returns a [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"), [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") returns a [`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh"). The latter is more specialized for the given purpose and thus is faster. It should almost always be preferred.
There is also a slight difference in the handling of masked arrays. Both [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") and [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") support masked arrays for *C*. However, only [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") supports masked arrays for *X* and *Y*. The reason lies in the internal handling of the masked values. [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") leaves out the respective polygons from the PolyCollection. [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") sets the facecolor of the masked elements to transparent. You can see the difference when using edgecolors. While all edges are drawn irrespective of masking in a QuadMesh, the edge between two adjacent masked quadrilaterals in [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") is not drawn as the corresponding polygons do not exist in the PolyCollection.
Another difference is the support of Gouraud shading in [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh"), which is not available with [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor").
| programming_docs |
matplotlib matplotlib.axes.Axes.quiverkey matplotlib.axes.Axes.quiverkey
==============================
Axes.quiverkey(*Q*, *X*, *Y*, *U*, *label*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5050-L5054)
Add a key to a quiver plot.
The positioning of the key depends on *X*, *Y*, *coordinates*, and *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions the head, and if *labelpos* is 'W', *X*, *Y* positions the tail; in either of these two cases, *X*, *Y* is somewhere in the middle of the arrow+label key object.
Parameters:
**Q**[`matplotlib.quiver.Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")
A [`Quiver`](matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver") object as returned by a call to [`quiver()`](matplotlib.axes.axes.quiver#matplotlib.axes.Axes.quiver "matplotlib.axes.Axes.quiver").
**X, Y**float
The location of the key.
**U**float
The length of the key.
**label**str
The key label (e.g., length and units of the key).
**angle**float, default: 0
The angle of the key arrow, in degrees anti-clockwise from the x-axis.
**coordinates**{'axes', 'figure', 'data', 'inches'}, default: 'axes'
Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are normalized coordinate systems with (0, 0) in the lower left and (1, 1) in the upper right; 'data' are the axes data coordinates (used for the locations of the vectors in the quiver plot itself); 'inches' is position in the figure in inches, with (0, 0) at the lower left corner.
**color**color
Overrides face and edge colors from *Q*.
**labelpos**{'N', 'S', 'E', 'W'}
Position the label above, below, to the right, to the left of the arrow, respectively.
**labelsep**float, default: 0.1
Distance in inches between the arrow and the label.
**labelcolor**color, default: `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`)
Label color.
**fontproperties**dict, optional
A dictionary with keyword arguments accepted by the [`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") initializer: *family*, *style*, *variant*, *size*, *weight*.
**\*\*kwargs**
Any additional keyword arguments are used to override vector properties taken from *Q*.
Examples using `matplotlib.axes.Axes.quiverkey`
-----------------------------------------------
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
[Quiver Simple Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-simple-demo-py)
Quiver Simple Demo
matplotlib matplotlib.axes.Axes.axhspan matplotlib.axes.Axes.axhspan
============================
Axes.axhspan(*ymin*, *ymax*, *xmin=0*, *xmax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L917-L963)
Add a horizontal span (rectangle) across the Axes.
The rectangle spans from *ymin* to *ymax* vertically, and, by default, the whole x-axis horizontally. The x-span can be set using *xmin* (default: 0) and *xmax* (default: 1) which are in axis units; e.g. `xmin = 0.5` always refers to the middle of the x-axis regardless of the limits set by [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim").
Parameters:
**ymin**float
Lower y-coordinate of the span, in data units.
**ymax**float
Upper y-coordinate of the span, in data units.
**xmin**float, default: 0
Lower x-coordinate of the span, in x-axis (0-1) units.
**xmax**float, default: 1
Upper x-coordinate of the span, in x-axis (0-1) units.
Returns:
[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`axvspan`](matplotlib.axes.axes.axvspan#matplotlib.axes.Axes.axvspan "matplotlib.axes.Axes.axvspan")
Add a vertical span across the Axes.
Examples using `matplotlib.axes.Axes.axhspan`
---------------------------------------------
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib matplotlib.artist.Artist.format_cursor_data matplotlib.artist.Artist.format\_cursor\_data
=============================================
Artist.format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](matplotlib.artist.artist.get_cursor_data#matplotlib.artist.Artist.get_cursor_data "matplotlib.artist.Artist.get_cursor_data")
matplotlib mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes mpl\_toolkits.axes\_grid1.inset\_locator.zoomed\_inset\_axes
============================================================
mpl\_toolkits.axes\_grid1.inset\_locator.zoomed\_inset\_axes(*parent\_axes*, *zoom*, *loc='upper right'*, *bbox\_to\_anchor=None*, *bbox\_transform=None*, *axes\_class=None*, *axes\_kwargs=None*, *borderpad=0.5*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L437-L521)
Create an anchored inset axes by scaling a parent axes. For usage, also see [the examples](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html).
Parameters:
**parent\_axes**[`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Axes to place the inset axes.
**zoom**float
Scaling factor of the data axes. *zoom* > 1 will enlarge the coordinates (i.e., "zoomed in"), while *zoom* < 1 will shrink the coordinates (i.e., "zoomed out").
**loc**str, default: 'upper right'
Location to place the inset axes. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**bbox\_to\_anchor**tuple or [`matplotlib.transforms.BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), optional
Bbox that the inset axes will be anchored to. If None, *parent\_axes.bbox* is used. If a tuple, can be either [left, bottom, width, height], or [left, bottom]. If the kwargs *width* and/or *height* are specified in relative units, the 2-tuple [left, bottom] cannot be used. Note that the units of the bounding box are determined through the transform in use. When using *bbox\_to\_anchor* it almost always makes sense to also specify a *bbox\_transform*. This might often be the axes transform *parent\_axes.transAxes*.
**bbox\_transform**[`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Transformation for the bbox that contains the inset axes. If None, a [`transforms.IdentityTransform`](../transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform") is used (i.e. pixel coordinates). This is useful when not providing any argument to *bbox\_to\_anchor*. When using *bbox\_to\_anchor* it almost always makes sense to also specify a *bbox\_transform*. This might often be the axes transform *parent\_axes.transAxes*. Inversely, when specifying the axes- or figure-transform here, be aware that not specifying *bbox\_to\_anchor* will use *parent\_axes.bbox*, the units of which are in display (pixel) coordinates.
**axes\_class**[`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") type, default: [`HostAxes`](mpl_toolkits.axes_grid1.parasite_axes.hostaxes#mpl_toolkits.axes_grid1.parasite_axes.HostAxes "mpl_toolkits.axes_grid1.parasite_axes.HostAxes")
The type of the newly created inset axes.
**axes\_kwargs**dict, optional
Keyword arguments to pass to the constructor of the inset axes. Valid arguments include:
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
**borderpad**float, default: 0.5
Padding between inset axes and the bbox\_to\_anchor. The units are axes font size, i.e. for a default font size of 10 points *borderpad = 0.5* is equivalent to a padding of 5 points.
Returns:
**inset\_axes***axes\_class*
Inset axes object created.
Examples using `mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes`
------------------------------------------------------------------------
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
| programming_docs |
matplotlib matplotlib.axes.Axes.get_xaxis_transform matplotlib.axes.Axes.get\_xaxis\_transform
==========================================
Axes.get\_xaxis\_transform(*which='grid'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L875-L897)
Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates.
Note
This transformation is primarily used by the [`Axis`](../axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
Examples using `matplotlib.axes.Axes.get_xaxis_transform`
---------------------------------------------------------
[Filling the area between lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-demo-py)
Filling the area between lines
[hlines and vlines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/vline_hline_demo.html#sphx-glr-gallery-lines-bars-and-markers-vline-hline-demo-py)
hlines and vlines
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Centered spines with arrows](https://matplotlib.org/stable/gallery/spines/centered_spines_with_arrows.html#sphx-glr-gallery-spines-centered-spines-with-arrows-py)
Centered spines with arrows
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib mpl_toolkits.axes_grid1.parasite_axes.host_axes mpl\_toolkits.axes\_grid1.parasite\_axes.host\_axes
===================================================
mpl\_toolkits.axes\_grid1.parasite\_axes.host\_axes(*\*args*, *axes\_class=<class 'mpl\_toolkits.axes\_grid1.mpl\_axes.Axes'>*, *figure=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L241-L260)
Create axes that can act as a hosts to parasitic axes.
Parameters:
**figure**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
Figure to which the axes will be added. Defaults to the current figure [`pyplot.gcf()`](matplotlib.pyplot.gcf#matplotlib.pyplot.gcf "matplotlib.pyplot.gcf").
**\*args, \*\*kwargs**
Will be passed on to the underlying `Axes` object creation.
matplotlib mpl_toolkits.axes_grid1.inset_locator.inset_axes mpl\_toolkits.axes\_grid1.inset\_locator.inset\_axes
====================================================
mpl\_toolkits.axes\_grid1.inset\_locator.inset\_axes(*parent\_axes*, *width*, *height*, *loc='upper right'*, *bbox\_to\_anchor=None*, *bbox\_transform=None*, *axes\_class=None*, *axes\_kwargs=None*, *borderpad=0.5*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L297-L434)
Create an inset axes with a given width and height.
Both sizes used can be specified either in inches or percentage. For example,:
```
inset_axes(parent_axes, width='40%', height='30%', loc='lower left')
```
creates in inset axes in the lower left corner of *parent\_axes* which spans over 30% in height and 40% in width of the *parent\_axes*. Since the usage of [`inset_axes`](#mpl_toolkits.axes_grid1.inset_locator.inset_axes "mpl_toolkits.axes_grid1.inset_locator.inset_axes") may become slightly tricky when exceeding such standard cases, it is recommended to read [the examples](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html).
Parameters:
**parent\_axes**[`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Axes to place the inset axes.
**width, height**float or str
Size of the inset axes to create. If a float is provided, it is the size in inches, e.g. *width=1.3*. If a string is provided, it is the size in relative units, e.g. *width='40%'*. By default, i.e. if neither *bbox\_to\_anchor* nor *bbox\_transform* are specified, those are relative to the parent\_axes. Otherwise they are to be understood relative to the bounding box provided via *bbox\_to\_anchor*.
**loc**str, default: 'upper right'
Location to place the inset axes. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**bbox\_to\_anchor**tuple or [`matplotlib.transforms.BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), optional
Bbox that the inset axes will be anchored to. If None, a tuple of (0, 0, 1, 1) is used if *bbox\_transform* is set to *parent\_axes.transAxes* or *parent\_axes.figure.transFigure*. Otherwise, *parent\_axes.bbox* is used. If a tuple, can be either [left, bottom, width, height], or [left, bottom]. If the kwargs *width* and/or *height* are specified in relative units, the 2-tuple [left, bottom] cannot be used. Note that, unless *bbox\_transform* is set, the units of the bounding box are interpreted in the pixel coordinate. When using *bbox\_to\_anchor* with tuple, it almost always makes sense to also specify a *bbox\_transform*. This might often be the axes transform *parent\_axes.transAxes*.
**bbox\_transform**[`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Transformation for the bbox that contains the inset axes. If None, a [`transforms.IdentityTransform`](../transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform") is used. The value of *bbox\_to\_anchor* (or the return value of its get\_points method) is transformed by the *bbox\_transform* and then interpreted as points in the pixel coordinate (which is dpi dependent). You may provide *bbox\_to\_anchor* in some normalized coordinate, and give an appropriate transform (e.g., *parent\_axes.transAxes*).
**axes\_class**[`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") type, default: [`HostAxes`](mpl_toolkits.axes_grid1.parasite_axes.hostaxes#mpl_toolkits.axes_grid1.parasite_axes.HostAxes "mpl_toolkits.axes_grid1.parasite_axes.HostAxes")
The type of the newly created inset axes.
**axes\_kwargs**dict, optional
Keyword arguments to pass to the constructor of the inset axes. Valid arguments include:
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
**borderpad**float, default: 0.5
Padding between inset axes and the bbox\_to\_anchor. The units are axes font size, i.e. for a default font size of 10 points *borderpad = 0.5* is equivalent to a padding of 5 points.
Returns:
**inset\_axes***axes\_class*
Inset axes object created.
#### Notes
The meaning of *bbox\_to\_anchor* and *bbox\_to\_transform* is interpreted differently from that of legend. The value of bbox\_to\_anchor (or the return value of its get\_points method; the default is *parent\_axes.bbox*) is transformed by the bbox\_transform (the default is Identity transform) and then interpreted as points in the pixel coordinate (which is dpi dependent).
Thus, following three calls are identical and creates an inset axes with respect to the *parent\_axes*:
```
axins = inset_axes(parent_axes, "30%", "40%")
axins = inset_axes(parent_axes, "30%", "40%",
bbox_to_anchor=parent_axes.bbox)
axins = inset_axes(parent_axes, "30%", "40%",
bbox_to_anchor=(0, 0, 1, 1),
bbox_transform=parent_axes.transAxes)
```
Examples using `mpl_toolkits.axes_grid1.inset_locator.inset_axes`
-----------------------------------------------------------------
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Controlling the position and size of colorbars with Inset Axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_inset_locator.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-inset-locator-py)
Controlling the position and size of colorbars with Inset Axes
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
matplotlib matplotlib.artist.allow_rasterization matplotlib.artist.allow\_rasterization
======================================
matplotlib.artist.allow\_rasterization(*draw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L24-L64)
Decorator for Artist.draw method. Provides routines that run before and after the draw call. The before and after functions are useful for changing artist-dependent renderer attributes or making other setup function calls, such as starting and flushing a mixed-mode renderer.
matplotlib matplotlib.pyplot.axline matplotlib.pyplot.axline
========================
matplotlib.pyplot.axline(*xy1*, *xy2=None*, *\**, *slope=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2333-L2335)
Add an infinitely long straight line.
The line can be defined either by two points *xy1* and *xy2*, or by one point *xy1* and a *slope*.
This draws a straight line "on the screen", regardless of the x and y scales, and is thus also suitable for drawing exponential decays in semilog plots, power laws in loglog plots, etc. However, *slope* should only be used with linear scales; It has no clear meaning for all other scales, and thus the behavior is undefined. Please specify the line using the points *xy1*, *xy2* for non-linear scales.
The *transform* keyword argument only applies to the points *xy1*, *xy2*. The *slope* (if given) is always in data coordinates. This can be used e.g. with `ax.transAxes` for drawing grid lines with a fixed slope.
Parameters:
**xy1, xy2**(float, float)
Points for the line to pass through. Either *xy2* or *slope* has to be given.
**slope**float, optional
The slope of the line. Either *xy2* or *slope* has to be given.
Returns:
[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Other Parameters:
**\*\*kwargs**
Valid kwargs are [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`axhline`](matplotlib.pyplot.axhline#matplotlib.pyplot.axhline "matplotlib.pyplot.axhline")
for horizontal lines
[`axvline`](matplotlib.pyplot.axvline#matplotlib.pyplot.axvline "matplotlib.pyplot.axvline")
for vertical lines
#### Examples
Draw a thick red line passing through (0, 0) and (1, 1):
```
>>> axline((0, 0), (1, 1), linewidth=4, color='r')
```
Examples using `matplotlib.pyplot.axline`
-----------------------------------------
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
| programming_docs |
matplotlib matplotlib.axes.Axes.get_ymajorticklabels matplotlib.axes.Axes.get\_ymajorticklabels
==========================================
Axes.get\_ymajorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the yaxis' major tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
matplotlib matplotlib.artist.ArtistInspector matplotlib.artist.ArtistInspector
=================================
*class*matplotlib.artist.ArtistInspector(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1383-L1678)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A helper class to inspect an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") and return information about its settable properties and their current values.
Initialize the artist inspector with an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or an iterable of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s. If an iterable is used, we assume it is a homogeneous sequence (all [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s are of the same type) and it is your responsibility to make sure this is so.
aliased\_name(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1522-L1531)
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME'.
e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform'.
aliased\_name\_rest(*s*, *target*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1549-L1563)
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME', formatted for reST.
e.g., for the line markerfacecolor property, which has an alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform'.
get\_aliases()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1409-L1431)
Get a dict mapping property fullnames to sets of aliases for each alias in the [`ArtistInspector`](#matplotlib.artist.ArtistInspector "matplotlib.artist.ArtistInspector").
e.g., for lines:
```
{'markerfacecolor': {'mfc'},
'linewidth' : {'lw'},
}
```
get\_setters()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1484-L1501)
Get the attribute strings with setters for object.
For example, for a line, return `['markerfacecolor', 'linewidth',
....]`.
get\_valid\_values(*attr*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1437-L1471)
Get the legal arguments for the setter associated with *attr*.
This is done by querying the docstring of the setter for a line that begins with "ACCEPTS:" or ".. ACCEPTS:", and then by looking for a numpydoc-style documentation for the setter's first argument.
*static*is\_alias(*method*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1509-L1520)
Return whether the object *method* is an alias for another method.
*static*number\_of\_parameters(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1503-L1507)
Return number of parameters of the callable *func*.
pprint\_getters()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1665-L1678)
Return the getters and actual values as list of strings.
pprint\_setters(*prop=None*, *leadingspace=2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1565-L1587)
If *prop* is *None*, return a list of strings of all settable properties and their valid values.
If *prop* is not *None*, it is a valid property name and that property will be returned as a string of property : valid values.
pprint\_setters\_rest(*prop=None*, *leadingspace=4*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1589-L1642)
If *prop* is *None*, return a list of reST-formatted strings of all settable properties and their valid values.
If *prop* is not *None*, it is a valid property name and that property will be returned as a string of "property : valid" values.
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1644-L1663)
Return a dictionary mapping property name -> value.
matplotlib matplotlib.gridspec.GridSpec matplotlib.gridspec.GridSpec
============================
*class*matplotlib.gridspec.GridSpec(*nrows*, *ncols*, *figure=None*, *left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*, *width\_ratios=None*, *height\_ratios=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/gridspec.py#L328-L485)
Bases: [`GridSpecBase`](matplotlib.gridspec.gridspecbase#matplotlib.gridspec.GridSpecBase "matplotlib.gridspec.GridSpecBase")
A grid layout to place subplots within a figure.
The location of the grid cells is determined in a similar way to [`SubplotParams`](../figure_api#matplotlib.figure.SubplotParams "matplotlib.figure.SubplotParams") using *left*, *right*, *top*, *bottom*, *wspace* and *hspace*.
Indexing a GridSpec instance returns a [`SubplotSpec`](matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec").
Parameters:
**nrows, ncols**int
The number of rows and columns of the grid.
**figure**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure"), optional
Only used for constrained layout to create a proper layoutgrid.
**left, right, top, bottom**float, optional
Extent of the subplots as a fraction of figure width or height. Left cannot be larger than right, and bottom cannot be larger than top. If not given, the values will be inferred from a figure or rcParams at draw time. See also [`GridSpec.get_subplot_params`](#matplotlib.gridspec.GridSpec.get_subplot_params "matplotlib.gridspec.GridSpec.get_subplot_params").
**wspace**float, optional
The amount of width reserved for space between subplots, expressed as a fraction of the average axis width. If not given, the values will be inferred from a figure or rcParams when necessary. See also [`GridSpec.get_subplot_params`](#matplotlib.gridspec.GridSpec.get_subplot_params "matplotlib.gridspec.GridSpec.get_subplot_params").
**hspace**float, optional
The amount of height reserved for space between subplots, expressed as a fraction of the average axis height. If not given, the values will be inferred from a figure or rcParams when necessary. See also [`GridSpec.get_subplot_params`](#matplotlib.gridspec.GridSpec.get_subplot_params "matplotlib.gridspec.GridSpec.get_subplot_params").
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height.
get\_subplot\_params(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/gridspec.py#L422-L441)
Return the [`SubplotParams`](../figure_api#matplotlib.figure.SubplotParams "matplotlib.figure.SubplotParams") for the GridSpec.
In order of precedence the values are taken from
* non-*None* attributes of the GridSpec
* the provided *figure*
* `[rcParams["figure.subplot.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.*#matplotlibrc-sample)`
locally\_modified\_subplot\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/gridspec.py#L443-L450)
Return a list of the names of the subplot parameters explicitly set in the GridSpec.
This is a subset of the attributes of [`SubplotParams`](../figure_api#matplotlib.figure.SubplotParams "matplotlib.figure.SubplotParams").
tight\_layout(*figure*, *renderer=None*, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/gridspec.py#L452-L485)
Adjust subplot parameters to give specified padding.
Parameters:
**pad**float
Padding between the figure edge and the edges of subplots, as a fraction of the font-size.
**h\_pad, w\_pad**float, optional
Padding (height/width) between edges of adjacent subplots. Defaults to *pad*.
**rect**tuple (left, bottom, right, top), default: None
(left, bottom, right, top) rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Default (None) is the whole figure.
update(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/gridspec.py#L394-L420)
Update the subplot parameters of the grid.
Parameters that are not explicitly given are not changed. Setting a parameter to *None* resets it to `[rcParams["figure.subplot.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.*#matplotlibrc-sample)`.
Parameters:
**left, right, top, bottom**float or None, optional
Extent of the subplots as a fraction of figure width or height.
**wspace, hspace**float, optional
Spacing between the subplots as a fraction of the average subplot width / height.
Examples using `matplotlib.gridspec.GridSpec`
---------------------------------------------
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Aligning Labels](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/align_labels_demo.html#sphx-glr-gallery-subplots-axes-and-figures-align-labels-demo-py)
Aligning Labels
[Resizing axes with constrained layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_constrained_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-constrained-layout-py)
Resizing axes with constrained layout
[Resizing axes with tight layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_tight_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-tight-layout-py)
Resizing axes with tight layout
[Combining two subplots using subplots and GridSpec](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_and_subplots.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-and-subplots-py)
Combining two subplots using subplots and GridSpec
[Using Gridspec to make multi-column/row subplot layouts](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_multicolumn.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-multicolumn-py)
Using Gridspec to make multi-column/row subplot layouts
[Nested Gridspecs](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_nested.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-nested-py)
Nested Gridspecs
[Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html#sphx-glr-gallery-subplots-axes-and-figures-subfigures-py)
Figure subfigures
[Creating multiple subplots using plt.subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-demo-py)
Creating multiple subplots using ``plt.subplots``
[Custom spines with axisartist](https://matplotlib.org/stable/gallery/axisartist/simple_axisartist1.html#sphx-glr-gallery-axisartist-simple-axisartist1-py)
Custom spines with axisartist
[GridSpec demo](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec03.html#sphx-glr-gallery-userdemo-demo-gridspec03-py)
GridSpec demo
[Nested GridSpecs](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec06.html#sphx-glr-gallery-userdemo-demo-gridspec06-py)
Nested GridSpecs
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html#sphx-glr-tutorials-intermediate-imshow-extent-py)
\*origin\* and \*extent\* in `~.Axes.imshow`
matplotlib mpl_toolkits.axes_grid1.axes_rgb.RGBAxes mpl\_toolkits.axes\_grid1.axes\_rgb.RGBAxes
===========================================
*class*mpl\_toolkits.axes\_grid1.axes\_rgb.RGBAxes(*\*args*, *pad=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_rgb.py#L56-L141)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
4-panel imshow (RGB, R, G, B).
Layout:
| | |
| --- | --- |
| RGB | R |
| G |
| B |
Subclasses can override the `_defaultAxesClass` attribute.
Attributes:
**RGB**`_defaultAxesClass`
The axes object for the three-channel imshow.
**R**`_defaultAxesClass`
The axes object for the red channel imshow.
**G**`_defaultAxesClass`
The axes object for the green channel imshow.
**B**`_defaultAxesClass`
The axes object for the blue channel imshow.
Parameters:
**pad**float, default: 0
fraction of the axes height to put as padding.
**axes\_class**matplotlib.axes.Axes
**\*args**
Unpacked into axes\_class() init for RGB
**\*\*kwargs**
Unpacked into axes\_class() init for RGB, R, G, B axes
imshow\_rgb(*r*, *g*, *b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_rgb.py#L109-L141)
Create the four images {rgb, r, g, b}.
Parameters:
**r, g, b**array-like
The red, green, and blue arrays.
**kwargs**imshow kwargs
kwargs get unpacked into the imshow calls for the four images.
Returns:
**rgb**matplotlib.image.AxesImage
**r**matplotlib.image.AxesImage
**g**matplotlib.image.AxesImage
**b**matplotlib.image.AxesImage
Examples using `mpl_toolkits.axes_grid1.axes_rgb.RGBAxes`
---------------------------------------------------------
[Showing RGB channels using RGBAxes](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html#sphx-glr-gallery-axes-grid1-demo-axes-rgb-py)
Showing RGB channels using RGBAxes
matplotlib matplotlib.pyplot.plot matplotlib.pyplot.plot
======================
matplotlib.pyplot.plot(*\*args*, *scalex=True*, *scaley=True*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2726-L2730)
Plot y versus x as lines and/or markers.
Call signatures:
```
plot([x], y, [fmt], *, data=None, **kwargs)
plot([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
```
The coordinates of the points or line nodes are given by *x*, *y*.
The optional parameter *fmt* is a convenient way for defining basic formatting like color, marker and linestyle. It's a shortcut string notation described in the *Notes* section below.
```
>>> plot(x, y) # plot x and y using default line style and color
>>> plot(x, y, 'bo') # plot x and y using blue circle markers
>>> plot(y) # plot y using x as index array 0..N-1
>>> plot(y, 'r+') # ditto, but with red plusses
```
You can use [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties as keyword arguments for more control on the appearance. Line properties and *fmt* can be mixed. The following two calls yield identical results:
```
>>> plot(x, y, 'go--', linewidth=2, markersize=12)
>>> plot(x, y, color='green', marker='o', linestyle='dashed',
... linewidth=2, markersize=12)
```
When conflicting with *fmt*, keyword arguments take precedence.
**Plotting labelled data**
There's a convenient way for plotting objects with labelled data (i.e. data that can be accessed by index `obj['y']`). Instead of giving the data in *x* and *y*, you can provide the object in the *data* parameter and just give the labels for *x* and *y*:
```
>>> plot('xlabel', 'ylabel', data=obj)
```
All indexable objects are supported. This could e.g. be a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)"), a [`pandas.DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame "(in pandas v1.4.4)") or a structured numpy array.
**Plotting multiple sets of data**
There are various ways to plot multiple sets of data.
* The most straight forward way is just to call [`plot`](#matplotlib.pyplot.plot "matplotlib.pyplot.plot") multiple times. Example:
```
>>> plot(x1, y1, 'bo')
>>> plot(x2, y2, 'go')
```
* If *x* and/or *y* are 2D arrays a separate data set will be drawn for every column. If both *x* and *y* are 2D, they must have the same shape. If only one of them is 2D with shape (N, m) the other must have length N and will be used for every data set m.
Example:
```
>>> x = [1, 2, 3]
>>> y = np.array([[1, 2], [3, 4], [5, 6]])
>>> plot(x, y)
```
is equivalent to:
```
>>> for col in range(y.shape[1]):
... plot(x, y[:, col])
```
* The third way is to specify multiple sets of *[x]*, *y*, *[fmt]* groups:
```
>>> plot(x1, y1, 'g^', x2, y2, 'g-')
```
In this case, any additional keyword argument applies to all datasets. Also this syntax cannot be combined with the *data* parameter.
By default, each line is assigned a different style specified by a 'style cycle'. The *fmt* and line property parameters are only necessary if you want explicit deviations from these defaults. Alternatively, you can also change the style cycle using `[rcParams["axes.prop\_cycle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.prop_cycle#matplotlibrc-sample)` (default: `cycler('color', ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])`).
Parameters:
**x, y**array-like or scalar
The horizontal / vertical coordinates of the data points. *x* values are optional and default to `range(len(y))`.
Commonly, these parameters are 1D arrays.
They can also be scalars, or two-dimensional (in that case, the columns represent separate data sets).
These arguments cannot be passed as keywords.
**fmt**str, optional
A format string, e.g. 'ro' for red circles. See the *Notes* section for a full description of the format strings.
Format strings are just an abbreviation for quickly setting basic line properties. All of these and more can also be controlled by keyword arguments.
This argument cannot be passed as keyword.
**data**indexable object, optional
An object with labelled data. If given, provide the label names to plot in *x* and *y*.
Note
Technically there's a slight ambiguity in calls where the second label is a valid *fmt*. `plot('n', 'o', data=obj)` could be `plt(x, y)` or `plt(y, fmt)`. In such cases, the former interpretation is chosen, but a warning is issued. You may suppress the warning by adding an empty format string `plot('n', 'o', '', data=obj)`.
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
A list of lines representing the plotted data.
Other Parameters:
**scalex, scaley**bool, default: True
These parameters determine if the view limits are adapted to the data limits. The values are passed on to [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view").
**\*\*kwargs**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties, optional
*kwargs* are used to specify properties like a line label (for auto legends), linewidth, antialiasing, marker face color. Example:
```
>>> plot([1, 2, 3], [1, 2, 3], 'go-', label='line 1', linewidth=2)
>>> plot([1, 2, 3], [1, 4, 9], 'rs', label='line 2')
```
If you specify multiple lines with one plot call, the kwargs apply to all those lines. In case the label object is iterable, each element is used as labels for each set of data.
Here is a list of available [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`scatter`](matplotlib.pyplot.scatter#matplotlib.pyplot.scatter "matplotlib.pyplot.scatter")
XY scatter plot with markers of varying size and/or color ( sometimes also called bubble chart).
#### Notes
**Format Strings**
A format string consists of a part for color, marker and line:
```
fmt = '[marker][line][color]'
```
Each of them is optional. If not provided, the value from the style cycle is used. Exception: If `line` is given, but no `marker`, the data will be a line without markers.
Other combinations such as `[color][marker][line]` are also supported, but note that their parsing may be ambiguous.
**Markers**
| character | description |
| --- | --- |
| `'.'` | point marker |
| `','` | pixel marker |
| `'o'` | circle marker |
| `'v'` | triangle\_down marker |
| `'^'` | triangle\_up marker |
| `'<'` | triangle\_left marker |
| `'>'` | triangle\_right marker |
| `'1'` | tri\_down marker |
| `'2'` | tri\_up marker |
| `'3'` | tri\_left marker |
| `'4'` | tri\_right marker |
| `'8'` | octagon marker |
| `'s'` | square marker |
| `'p'` | pentagon marker |
| `'P'` | plus (filled) marker |
| `'*'` | star marker |
| `'h'` | hexagon1 marker |
| `'H'` | hexagon2 marker |
| `'+'` | plus marker |
| `'x'` | x marker |
| `'X'` | x (filled) marker |
| `'D'` | diamond marker |
| `'d'` | thin\_diamond marker |
| `'|'` | vline marker |
| `'_'` | hline marker |
**Line Styles**
| character | description |
| --- | --- |
| `'-'` | solid line style |
| `'--'` | dashed line style |
| `'-.'` | dash-dot line style |
| `':'` | dotted line style |
Example format strings:
```
'b' # blue markers with default shape
'or' # red circles
'-g' # green solid line
'--' # dashed line with default color
'^k:' # black triangle_up markers connected by a dotted line
```
**Colors**
The supported color abbreviations are the single letter codes
| character | color |
| --- | --- |
| `'b'` | blue |
| `'g'` | green |
| `'r'` | red |
| `'c'` | cyan |
| `'m'` | magenta |
| `'y'` | yellow |
| `'k'` | black |
| `'w'` | white |
and the `'CN'` colors that index into the default property cycle.
If the color is the only part of the format string, you can additionally use any [`matplotlib.colors`](../colors_api#module-matplotlib.colors "matplotlib.colors") spec, e.g. full names (`'green'`) or hex strings (`'#008000'`).
Examples using `matplotlib.pyplot.plot`
---------------------------------------
[Plotting masked and NaN values](https://matplotlib.org/stable/gallery/lines_bars_and_markers/masked_demo.html#sphx-glr-gallery-lines-bars-and-markers-masked-demo-py)
Plotting masked and NaN values
[Scatter Masked](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_masked.html#sphx-glr-gallery-lines-bars-and-markers-scatter-masked-py)
Scatter Masked
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py)
Step Demo
[Custom Figure subclasses](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/custom_figure_class.html#sphx-glr-gallery-subplots-axes-and-figures-custom-figure-class-py)
Custom Figure subclasses
[Managing multiple figures in pyplot](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/multiple_figs_demo.html#sphx-glr-gallery-subplots-axes-and-figures-multiple-figs-demo-py)
Managing multiple figures in pyplot
[Shared Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/shared_axis_demo.html#sphx-glr-gallery-subplots-axes-and-figures-shared-axis-demo-py)
Shared Axis
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[plot() format string](https://matplotlib.org/stable/gallery/pyplots/pyplot_formatstr.html#sphx-glr-gallery-pyplots-pyplot-formatstr-py)
plot() format string
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Simple](https://matplotlib.org/stable/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py)
Pyplot Simple
[Pyplot Three](https://matplotlib.org/stable/gallery/pyplots/pyplot_three.html#sphx-glr-gallery-pyplots-pyplot-three-py)
Pyplot Three
[Pyplot Two Subplots](https://matplotlib.org/stable/gallery/pyplots/pyplot_two_subplots.html#sphx-glr-gallery-pyplots-pyplot-two-subplots-py)
Pyplot Two Subplots
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Solarized Light stylesheet](https://matplotlib.org/stable/gallery/style_sheets/plot_solarizedlight2.html#sphx-glr-gallery-style-sheets-plot-solarizedlight2-py)
Solarized Light stylesheet
[Frame grabbing](https://matplotlib.org/stable/gallery/animation/frame_grabbing_sgskip.html#sphx-glr-gallery-animation-frame-grabbing-sgskip-py)
Frame grabbing
[Coords Report](https://matplotlib.org/stable/gallery/misc/coords_report.html#sphx-glr-gallery-misc-coords-report-py)
Coords Report
[Customize Rc](https://matplotlib.org/stable/gallery/misc/customize_rc.html#sphx-glr-gallery-misc-customize-rc-py)
Customize Rc
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Multipage PDF](https://matplotlib.org/stable/gallery/misc/multipage_pdf.html#sphx-glr-gallery-misc-multipage-pdf-py)
Multipage PDF
[Print Stdout](https://matplotlib.org/stable/gallery/misc/print_stdout_sgskip.html#sphx-glr-gallery-misc-print-stdout-sgskip-py)
Print Stdout
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[transforms.offset\_copy](https://matplotlib.org/stable/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py)
transforms.offset\_copy
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[Placing date ticks using recurrence rules](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html#sphx-glr-gallery-ticks-date-demo-rrule-py)
Placing date ticks using recurrence rules
[Rotating custom tick labels](https://matplotlib.org/stable/gallery/ticks/ticklabels_rotation.html#sphx-glr-gallery-ticks-ticklabels-rotation-py)
Rotating custom tick labels
[Tool Manager](https://matplotlib.org/stable/gallery/user_interfaces/toolmanager_sgskip.html#sphx-glr-gallery-user-interfaces-toolmanager-sgskip-py)
Tool Manager
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Customizing Matplotlib with style sheets and rcParams](https://matplotlib.org/stable/tutorials/introductory/customizing.html#sphx-glr-tutorials-introductory-customizing-py)
Customizing Matplotlib with style sheets and rcParams
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Path effects guide](https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py)
Path effects guide
| programming_docs |
matplotlib matplotlib.axes.Axes.get_xlabel matplotlib.axes.Axes.get\_xlabel
================================
Axes.get\_xlabel()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3456-L3461)
Get the xlabel text string.
matplotlib matplotlib.axes.Axes.sharex matplotlib.axes.Axes.sharex
===========================
Axes.sharex(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1180-L1197)
Share the x-axis with *other*.
This is equivalent to passing `sharex=other` when constructing the Axes, and cannot be used if the x-axis is already being shared with another Axes.
Examples using `matplotlib.axes.Axes.sharex`
--------------------------------------------
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
matplotlib matplotlib.colors.LogNorm matplotlib.colors.LogNorm
=========================
*class*matplotlib.colors.LogNorm(*vmin=None*, *vmax=None*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py)
Bases: [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
Normalize a given value to the 0-1 range on a log scale.
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1676-L1695)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
autoscale(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1714-L1717)
Set *vmin*, *vmax* to min, max of *A*.
autoscale\_None(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1719-L1721)
If vmin or vmax are not set, use the min/max of *A* to set them.
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1697-L1712)
Examples using `matplotlib.colors.LogNorm`
------------------------------------------
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Time Series Histogram](https://matplotlib.org/stable/gallery/statistics/time_series_histogram.html#sphx-glr-gallery-statistics-time-series-histogram-py)
Time Series Histogram
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
matplotlib matplotlib.axes.Axes.get_navigate matplotlib.axes.Axes.get\_navigate
==================================
Axes.get\_navigate()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4005-L4009)
Get whether the Axes responds to navigation commands.
matplotlib matplotlib.artist.Artist.properties matplotlib.artist.Artist.properties
===================================
Artist.properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
matplotlib matplotlib.patches.CirclePolygon matplotlib.patches.CirclePolygon
================================
*class*matplotlib.patches.CirclePolygon(*xy*, *radius=5*, *\**, *resolution=20*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1490-L1513)
Bases: [`RegularPolygon`](matplotlib.patches.regularpolygon#matplotlib.patches.RegularPolygon "matplotlib.patches.RegularPolygon")
A polygon-approximation of a circle patch.
Create a circle at *xy* = (*x*, *y*) with given *radius*.
This circle is approximated by a regular polygon with *resolution* sides. For a smoother circle drawn with splines, see [`Circle`](matplotlib.patches.circle#matplotlib.patches.Circle "matplotlib.patches.Circle").
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib matplotlib.animation.FuncAnimation matplotlib.animation.FuncAnimation
==================================
*class*matplotlib.animation.FuncAnimation(*fig*, *func*, *frames=None*, *init\_func=None*, *fargs=None*, *save\_count=None*, *\**, *cache\_frame\_data=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1503-L1749)
Makes an animation by repeatedly calling a function *func*.
Note
You must store the created Animation in a variable that lives as long as the animation should run. Otherwise, the Animation object will be garbage-collected and the animation stops.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object used to get needed events, such as draw or resize.
**func**callable
The function to call at each frame. The first argument will be the next value in *frames*. Any additional positional arguments can be supplied via the *fargs* parameter.
The required signature is:
```
def func(frame, *fargs) -> iterable_of_artists
```
If `blit == True`, *func* must return an iterable of all artists that were modified or created. This information is used by the blitting algorithm to determine which parts of the figure have to be updated. The return value is unused if `blit == False` and may be omitted in that case.
**frames**iterable, int, generator function, or None, optional
Source of data to pass *func* and each frame of the animation
* If an iterable, then simply use the values provided. If the iterable has a length, it will override the *save\_count* kwarg.
* If an integer, then equivalent to passing `range(frames)`
* If a generator function, then must have the signature:
```
def gen_function() -> obj
```
* If *None*, then equivalent to passing `itertools.count`.
In all of these cases, the values in *frames* is simply passed through to the user-supplied *func* and thus can be of any type.
**init\_func**callable, optional
A function used to draw a clear frame. If not given, the results of drawing from the first item in the frames sequence will be used. This function will be called once before the first frame.
The required signature is:
```
def init_func() -> iterable_of_artists
```
If `blit == True`, *init\_func* must return an iterable of artists to be re-drawn. This information is used by the blitting algorithm to determine which parts of the figure have to be updated. The return value is unused if `blit == False` and may be omitted in that case.
**fargs**tuple or None, optional
Additional arguments to pass to each call to *func*.
**save\_count**int, default: 100
Fallback for the number of values from *frames* to cache. This is only used if the number of frames cannot be inferred from *frames*, i.e. when it's an iterator without length or a generator.
**interval**int, default: 200
Delay between frames in milliseconds.
**repeat\_delay**int, default: 0
The delay in milliseconds between consecutive animation runs, if *repeat* is True.
**repeat**bool, default: True
Whether the animation repeats when the sequence of frames is completed.
**blit**bool, default: False
Whether blitting is used to optimize drawing. Note: when using blitting, any animated artists will be drawn according to their zorder; however, they will be drawn on top of any previous artists, regardless of their zorder.
**cache\_frame\_data**bool, default: True
Whether frame data is cached. Disabling cache might be helpful when frames contain large objects.
\_\_init\_\_(*fig*, *func*, *frames=None*, *init\_func=None*, *fargs=None*, *save\_count=None*, *\**, *cache\_frame\_data=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1593-L1648)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.FuncAnimation.__init__ "matplotlib.animation.FuncAnimation.__init__")(fig, func[, frames, init\_func, ...]) | |
| [`new_frame_seq`](#matplotlib.animation.FuncAnimation.new_frame_seq "matplotlib.animation.FuncAnimation.new_frame_seq")() | Return a new sequence of frame information. |
| [`new_saved_frame_seq`](#matplotlib.animation.FuncAnimation.new_saved_frame_seq "matplotlib.animation.FuncAnimation.new_saved_frame_seq")() | Return a new sequence of saved/cached frame information. |
| `pause`() | Pause the animation. |
| `resume`() | Resume the animation. |
| `save`(filename[, writer, fps, dpi, codec, ...]) | Save the animation as a movie file by drawing every frame. |
| `to_html5_video`([embed\_limit]) | Convert the animation to an HTML5 `<video>` tag. |
| `to_jshtml`([fps, embed\_frames, default\_mode]) | Generate HTML representation of the animation. |
new\_frame\_seq()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1650-L1652)
Return a new sequence of frame information.
new\_saved\_frame\_seq()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1654-L1683)
Return a new sequence of saved/cached frame information.
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase mpl\_toolkits.axes\_grid1.axes\_grid.CbarAxesBase
=================================================
*class*mpl\_toolkits.axes\_grid1.axes\_grid.CbarAxesBase(*\*args*, *orientation*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L20-L41)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
cla()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L38-L41)
colorbar(*mappable*, *\**, *ticks=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L26-L32)
toggle\_label(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_grid.py#L34-L36)
matplotlib mpl_toolkits.axisartist.axis_artist.Ticks mpl\_toolkits.axisartist.axis\_artist.Ticks
===========================================
*class*mpl\_toolkits.axisartist.axis\_artist.Ticks(*ticksize*, *tick\_out=False*, *\**, *axis=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L107-L200)
Bases: [`AttributeCopier`](mpl_toolkits.axisartist.axis_artist.attributecopier#mpl_toolkits.axisartist.axis_artist.AttributeCopier "mpl_toolkits.axisartist.axis_artist.AttributeCopier"), [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Ticks are derived from Line2D, and note that ticks themselves are markers. Thus, you should use set\_mec, set\_mew, etc.
To change the tick size (length), you need to use set\_ticksize. To change the direction of the ticks (ticks are in opposite direction of ticklabels by default), use set\_tick\_out(False).
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L176-L200)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L146-L147)
Return the line color.
See also [`set_color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color").
get\_markeredgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L149-L150)
Return the marker edge color.
See also [`set_markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor").
get\_markeredgewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L152-L153)
Return the marker edge width in points.
See also [`set_markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth").
get\_ref\_artist()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L134-L136)
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
get\_tick\_out()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L159-L161)
Return whether ticks are drawn inside or outside the axes.
get\_ticksize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L167-L169)
Return length of the ticks in points.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *dash\_capstyle=<UNSET>*, *dash\_joinstyle=<UNSET>*, *dashes=<UNSET>*, *data=<UNSET>*, *drawstyle=<UNSET>*, *fillstyle=<UNSET>*, *gapcolor=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *locs\_angles=<UNSET>*, *marker=<UNSET>*, *markeredgecolor=<UNSET>*, *markeredgewidth=<UNSET>*, *markerfacecolor=<UNSET>*, *markerfacecoloralt=<UNSET>*, *markersize=<UNSET>*, *markevery=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *solid\_capstyle=<UNSET>*, *solid\_joinstyle=<UNSET>*, *tick\_out=<UNSET>*, *ticksize=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xdata=<UNSET>*, *ydata=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | unknown |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`locs_angles`](#mpl_toolkits.axisartist.axis_artist.Ticks.set_locs_angles "mpl_toolkits.axisartist.axis_artist.Ticks.set_locs_angles") | unknown |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`tick_out`](#mpl_toolkits.axisartist.axis_artist.Ticks.set_tick_out "mpl_toolkits.axisartist.axis_artist.Ticks.set_tick_out") | unknown |
| [`ticksize`](#mpl_toolkits.axisartist.axis_artist.Ticks.set_ticksize "mpl_toolkits.axisartist.axis_artist.Ticks.set_ticksize") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_color(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L138-L144)
Set the color of the line.
Parameters:
**color**color
set\_locs\_angles(*locs\_angles*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L171-L172)
set\_tick\_out(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L155-L157)
Set whether ticks are drawn inside or outside the axes.
set\_ticksize(*ticksize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L163-L165)
Set length of the ticks in points.
matplotlib matplotlib.axes.Axes.hlines matplotlib.axes.Axes.hlines
===========================
Axes.hlines(*y*, *xmin*, *xmax*, *colors=None*, *linestyles='solid'*, *label=''*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L1022-L1100)
Plot horizontal lines at each *y* from *xmin* to *xmax*.
Parameters:
**y**float or array-like
y-indexes where to plot the lines.
**xmin, xmax**float or array-like
Respective beginning and end of each line. If scalars are provided, all lines will have the same length.
**colors**list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
**linestyles**{'solid', 'dashed', 'dashdot', 'dotted'}, optional
**label**str, default: ''
Returns:
[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*y*, *xmin*, *xmax*, *colors*
**\*\*kwargs**[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") properties.
See also
[`vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines")
vertical lines
[`axhline`](matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline")
horizontal line across the Axes
Examples using `matplotlib.axes.Axes.hlines`
--------------------------------------------
[hlines and vlines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/vline_hline_demo.html#sphx-glr-gallery-lines-bars-and-markers-vline-hline-demo-py)
hlines and vlines
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
matplotlib matplotlib.axes.Axes.axvspan matplotlib.axes.Axes.axvspan
============================
Axes.axvspan(*xmin*, *xmax*, *ymin=0*, *ymax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L965-L1020)
Add a vertical span (rectangle) across the Axes.
The rectangle spans from *xmin* to *xmax* horizontally, and, by default, the whole y-axis vertically. The y-span can be set using *ymin* (default: 0) and *ymax* (default: 1) which are in axis units; e.g. `ymin = 0.5` always refers to the middle of the y-axis regardless of the limits set by [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim").
Parameters:
**xmin**float
Lower x-coordinate of the span, in data units.
**xmax**float
Upper x-coordinate of the span, in data units.
**ymin**float, default: 0
Lower y-coordinate of the span, in y-axis units (0-1).
**ymax**float, default: 1
Upper y-coordinate of the span, in y-axis units (0-1).
Returns:
[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`axhspan`](matplotlib.axes.axes.axhspan#matplotlib.axes.Axes.axhspan "matplotlib.axes.Axes.axhspan")
Add a horizontal span across the Axes.
#### Examples
Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the Axes.
```
>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
```
Examples using `matplotlib.axes.Axes.axvspan`
---------------------------------------------
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
| programming_docs |
matplotlib matplotlib.axis.Axis.get_inverted matplotlib.axis.Axis.get\_inverted
==================================
Axis.get\_inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1053-L1062)
Return whether this Axis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.
matplotlib matplotlib.axes.Axes.set_ylim matplotlib.axes.Axes.set\_ylim
==============================
Axes.set\_ylim(*bottom=None*, *top=None*, *\**, *emit=True*, *auto=False*, *ymin=None*, *ymax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3847-L3924)
Set the y-axis view limits.
Parameters:
**bottom**float, optional
The bottom ylim in data coordinates. Passing *None* leaves the limit unchanged.
The bottom and top ylims may also be passed as the tuple (*bottom*, *top*) as the first positional argument (or as the *bottom* keyword argument).
**top**float, optional
The top ylim in data coordinates. Passing *None* leaves the limit unchanged.
**emit**bool, default: True
Whether to notify observers of limit change.
**auto**bool or None, default: False
Whether to turn on autoscaling of the y-axis. *True* turns on, *False* turns off, *None* leaves unchanged.
**ymin, ymax**float, optional
They are equivalent to bottom and top respectively, and it is an error to pass both *ymin* and *bottom* or *ymax* and *top*.
Returns:
**bottom, top**(float, float)
The new y-axis limits in data coordinates.
See also
[`get_ylim`](matplotlib.axes.axes.get_ylim#matplotlib.axes.Axes.get_ylim "matplotlib.axes.Axes.get_ylim")
[`set_ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound"), [`get_ybound`](matplotlib.axes.axes.get_ybound#matplotlib.axes.Axes.get_ybound "matplotlib.axes.Axes.get_ybound")
[`invert_yaxis`](matplotlib.axes.axes.invert_yaxis#matplotlib.axes.Axes.invert_yaxis "matplotlib.axes.Axes.invert_yaxis"), [`yaxis_inverted`](matplotlib.axes.axes.yaxis_inverted#matplotlib.axes.Axes.yaxis_inverted "matplotlib.axes.Axes.yaxis_inverted")
#### Notes
The *bottom* value may be greater than the *top* value, in which case the y-axis values will decrease from *bottom* to *top*.
#### Examples
```
>>> set_ylim(bottom, top)
>>> set_ylim((bottom, top))
>>> bottom, top = set_ylim(bottom, top)
```
One limit may be left unchanged.
```
>>> set_ylim(top=top_lim)
```
Limits may be passed in reverse order to flip the direction of the y-axis. For example, suppose `y` represents depth of the ocean in m. The y-axis limits might be set like the following so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top.
```
>>> set_ylim(5000, 0)
```
Examples using `matplotlib.axes.Axes.set_ylim`
----------------------------------------------
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[EventCollection Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventcollection-demo-py)
EventCollection Demo
[Hat graph](https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py)
Hat graph
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
[pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-grids-py)
pcolormesh grids and shading
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Annotate Transform](https://matplotlib.org/stable/gallery/pyplots/annotate_transform.html#sphx-glr-gallery-pyplots-annotate-transform-py)
Annotate Transform
[Annotating a plot](https://matplotlib.org/stable/gallery/pyplots/annotation_basic.html#sphx-glr-gallery-pyplots-annotation-basic-py)
Annotating a plot
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Parasite Simple2](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-gallery-axes-grid1-parasite-simple2-py)
Parasite Simple2
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
[Simple Axisline](https://matplotlib.org/stable/gallery/axisartist/simple_axisline.html#sphx-glr-gallery-axisartist-simple-axisline-py)
Simple Axisline
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[XKCD](https://matplotlib.org/stable/gallery/showcase/xkcd.html#sphx-glr-gallery-showcase-xkcd-py)
XKCD
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
[Animated histogram](https://matplotlib.org/stable/gallery/animation/animated_histogram.html#sphx-glr-gallery-animation-animated-histogram-py)
Animated histogram
 [Rain simulation](https://matplotlib.org/stable/gallery/animation/rain.html#sphx-glr-gallery-animation-rain-py)
Rain simulation
 [MATPLOTLIB UNCHAINED](https://matplotlib.org/stable/gallery/animation/unchained.html#sphx-glr-gallery-animation-unchained-py)
MATPLOTLIB \*\*UNCHAINED\*\*
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Pick Event Demo2](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo2.html#sphx-glr-gallery-event-handling-pick-event-demo2-py)
Pick Event Demo2
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[Pythonic Matplotlib](https://matplotlib.org/stable/gallery/misc/pythonic_matplotlib.html#sphx-glr-gallery-misc-pythonic-matplotlib-py)
Pythonic Matplotlib
[SVG Filter Line](https://matplotlib.org/stable/gallery/misc/svg_filter_line.html#sphx-glr-gallery-misc-svg-filter-line-py)
SVG Filter Line
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html#sphx-glr-gallery-mplot3d-2dcollections3d-py)
Plot 2D data on 3D plot
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Text annotations in 3D](https://matplotlib.org/stable/gallery/mplot3d/text3d.html#sphx-glr-gallery-mplot3d-text3d-py)
Text annotations in 3D
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
[Annotation with units](https://matplotlib.org/stable/gallery/units/annotate_with_units.html#sphx-glr-gallery-units-annotate-with-units-py)
Annotation with units
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
[Annotated Cursor](https://matplotlib.org/stable/gallery/widgets/annotated_cursor.html#sphx-glr-gallery-widgets-annotated-cursor-py)
Annotated Cursor
[Cursor](https://matplotlib.org/stable/gallery/widgets/cursor.html#sphx-glr-gallery-widgets-cursor-py)
Cursor
[Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html#sphx-glr-gallery-widgets-span-selector-py)
Span Selector
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
matplotlib matplotlib.axes.Axes.bar_label matplotlib.axes.Axes.bar\_label
===============================
Axes.bar\_label(*container*, *labels=None*, *\**, *fmt='%g'*, *label\_type='edge'*, *padding=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L2619-L2765)
Label a bar plot.
Adds labels to bars in the given [`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer"). You may need to adjust the axis limits to fit the labels.
Parameters:
**container**[`BarContainer`](../container_api#matplotlib.container.BarContainer "matplotlib.container.BarContainer")
Container with all the bars and optionally errorbars, likely returned from [`bar`](matplotlib.axes.axes.bar#matplotlib.axes.Axes.bar "matplotlib.axes.Axes.bar") or [`barh`](matplotlib.axes.axes.barh#matplotlib.axes.Axes.barh "matplotlib.axes.Axes.barh").
**labels**array-like, optional
A list of label texts, that should be displayed. If not given, the label texts will be the data values formatted with *fmt*.
**fmt**str, default: '%g'
A format string for the label.
**label\_type**{'edge', 'center'}, default: 'edge'
The label type. Possible values:
* 'edge': label placed at the end-point of the bar segment, and the value displayed will be the position of that end-point.
* 'center': label placed in the center of the bar segment, and the value displayed will be the length of that segment. (useful for stacked bars, i.e., [Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html))
**padding**float, default: 0
Distance of label from the end of the bar, in points.
**\*\*kwargs**
Any remaining keyword arguments are passed through to [`Axes.annotate`](matplotlib.axes.axes.annotate#matplotlib.axes.Axes.annotate "matplotlib.axes.Axes.annotate"). The alignment parameters ( *horizontalalignment* / *ha*, *verticalalignment* / *va*) are not supported because the labels are automatically aligned to the bars.
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
A list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instances for the labels.
Examples using `matplotlib.axes.Axes.bar_label`
-----------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Grouped bar chart with labels](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html#sphx-glr-gallery-lines-bars-and-markers-barchart-py)
Grouped bar chart with labels
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
matplotlib mpl_toolkits.axes_grid1.axes_size.MaxExtent mpl\_toolkits.axes\_grid1.axes\_size.MaxExtent
==============================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.MaxExtent(*artist\_list*, *w\_or\_h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L144-L164)
Bases: `_Base`
Size whose absolute part is either the largest width or the largest height of the given *artist\_list*.
add\_artist(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L155-L156)
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L158-L164)
matplotlib matplotlib.axes.Axes.get_axisbelow matplotlib.axes.Axes.get\_axisbelow
===================================
Axes.get\_axisbelow()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3149-L3161)
Get whether axis ticks and gridlines are above or below most artists.
Returns:
bool or 'line'
See also
[`set_axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow")
matplotlib matplotlib.patches.PathPatch matplotlib.patches.PathPatch
============================
*class*matplotlib.patches.PathPatch(*path*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L932-L957)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A general polycurve path patch.
*path* is a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") object.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L953-L954)
Return the path of this patch.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path`](#matplotlib.patches.PathPatch.set_path "matplotlib.patches.PathPatch.set_path") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L956-L957)
Examples using `matplotlib.patches.PathPatch`
---------------------------------------------
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Box plots with custom fill colors](https://matplotlib.org/stable/gallery/statistics/boxplot_color.html#sphx-glr-gallery-statistics-boxplot-color-py)
Box plots with custom fill colors
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Compound path](https://matplotlib.org/stable/gallery/shapes_and_collections/compound_path.html#sphx-glr-gallery-shapes-and-collections-compound-path-py)
Compound path
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[Bezier Curve](https://matplotlib.org/stable/gallery/shapes_and_collections/quad_bezier.html#sphx-glr-gallery-shapes-and-collections-quad-bezier-py)
Bezier Curve
[Firefox](https://matplotlib.org/stable/gallery/showcase/firefox.html#sphx-glr-gallery-showcase-firefox-py)
Firefox
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.inset_locator.AnchoredZoomLocator mpl\_toolkits.axes\_grid1.inset\_locator.AnchoredZoomLocator
============================================================
*class*mpl\_toolkits.axes\_grid1.inset\_locator.AnchoredZoomLocator(*parent\_axes*, *zoom*, *loc*, *borderpad=0.5*, *bbox\_to\_anchor=None*, *bbox\_transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L115-L134)
Bases: [`AnchoredLocatorBase`](mpl_toolkits.axes_grid1.inset_locator.anchoredlocatorbase#mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase "mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase")
Parameters:
**loc**str
The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.4
Padding around the child as fraction of the fontsize.
**borderpad**float, default: 0.5
Padding between the offsetbox frame and the *bbox\_to\_anchor*.
**child**[`OffsetBox`](../offsetbox_api#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The box that will be anchored.
**prop**[`FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
This is only used as a reference for paddings. If not given, `[rcParams["legend.fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fontsize#matplotlibrc-sample)` (default: `'medium'`) is used.
**frameon**bool
Whether to draw a frame around the box.
**bbox\_to\_anchor**[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
**bbox\_transform**None or [`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*).
**\*\*kwargs**
All other parameters are passed on to [`OffsetBox`](../offsetbox_api#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox").
#### Notes
See [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for a detailed description of the anchoring mechanism.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L128-L134)
Return the extent of the box as (width, height, x, y).
This is the extent of the child plus the padding.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib matplotlib.axes.Axes.angle_spectrum matplotlib.axes.Axes.angle\_spectrum
====================================
Axes.angle\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7355-L7422)
Plot the angle spectrum.
Compute the angle spectrum (wrapped phase spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the angle spectrum in radians (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`magnitude_spectrum`](matplotlib.axes.axes.magnitude_spectrum#matplotlib.axes.Axes.magnitude_spectrum "matplotlib.axes.Axes.magnitude_spectrum")
Plots the magnitudes of the corresponding frequencies.
[`phase_spectrum`](matplotlib.axes.axes.phase_spectrum#matplotlib.axes.Axes.phase_spectrum "matplotlib.axes.Axes.phase_spectrum")
Plots the unwrapped version of this function.
[`specgram`](matplotlib.axes.axes.specgram#matplotlib.axes.Axes.specgram "matplotlib.axes.Axes.specgram")
Can plot the angle spectrum of segments within the signal in a colormap.
matplotlib mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple mpl\_toolkits.axisartist.grid\_finder.ExtremeFinderSimple
=========================================================
*class*mpl\_toolkits.axisartist.grid\_finder.ExtremeFinderSimple(*nx*, *ny*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L49-L92)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A helper class to figure out the range of grid lines that need to be drawn.
Parameters:
**nx, ny**int
The number of samples in each direction.
\_\_call\_\_(*transform\_xy*, *x1*, *y1*, *x2*, *y2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L64-L86)
Compute an approximation of the bounding box obtained by applying *transform\_xy* to the box delimited by `(x1, y1, x2, y2)`.
The intended use is to have `(x1, y1, x2, y2)` in axes coordinates, and have *transform\_xy* be the transform from axes coordinates to data coordinates; this method then returns the range of data coordinates that span the actual axes.
The computation is done by sampling `nx * ny` equispaced points in the `(x1, y1, x2, y2)` box and finding the resulting points with extremal coordinates; then adding some padding to take into account the finite sampling.
As each sampling step covers a relative range of *1/nx* or *1/ny*, the padding is computed by expanding the span covered by the extremal coordinates by these fractions.
Examples using `mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple`
------------------------------------------------------------------------
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Curvilinear grid demo](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid-py)
Curvilinear grid demo
[Demo CurveLinear Grid2](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid2.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid2-py)
Demo CurveLinear Grid2
[floating\_axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axis.html#sphx-glr-gallery-axisartist-demo-floating-axis-py)
floating\_axis demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
| programming_docs |
matplotlib matplotlib.lines.segment_hits matplotlib.lines.segment\_hits
==============================
matplotlib.lines.segment\_hits(*cx*, *cy*, *x*, *y*, *radius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L72-L106)
Return the indices of the segments in the polyline with coordinates (*cx*, *cy*) that are within a distance *radius* of the point (*x*, *y*).
matplotlib matplotlib.axes.Axes.sharey matplotlib.axes.Axes.sharey
===========================
Axes.sharey(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1199-L1216)
Share the y-axis with *other*.
This is equivalent to passing `sharey=other` when constructing the Axes, and cannot be used if the y-axis is already being shared with another Axes.
Examples using `matplotlib.axes.Axes.sharey`
--------------------------------------------
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
matplotlib mpl_toolkits.axes_grid1.axes_size.GetExtentHelper mpl\_toolkits.axes\_grid1.axes\_size.GetExtentHelper
====================================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.GetExtentHelper(*ax*, *direction*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L257-L276)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
\_\_call\_\_(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L271-L276)
Call self as a function.
matplotlib matplotlib.axes.Axes.clear matplotlib.axes.Axes.clear
==========================
Axes.clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1340-L1347)
Clear the Axes.
Examples using `matplotlib.axes.Axes.clear`
-------------------------------------------
[pyplot animation](https://matplotlib.org/stable/gallery/animation/animation_demo.html#sphx-glr-gallery-animation-animation-demo-py)
pyplot animation
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
matplotlib matplotlib.axes.Axes.legend matplotlib.axes.Axes.legend
===========================
Axes.legend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L186-L309)
Place a legend on the Axes.
Call signatures:
```
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
ax.legend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
ax.legend()
```
Note
Specific artists can be excluded from the automatic legend element selection by using a label starting with an underscore, "\_". A string starting with an underscore is the default label for all artists, so calling [`Axes.legend`](#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
ax.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax.plot([1, 2, 3], label='label1')
line2, = ax.plot([1, 2, 3], label='label2')
ax.legend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on an Axes, call this function with an iterable of strings, one for each legend item. For example:
```
ax.plot([1, 2, 3])
ax.plot([5, 6, 7])
ax.legend(['First line', 'Second line'])
```
Parameters:
**handles**sequence of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](../legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend.py), [png](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_00_00.png))
Examples using `matplotlib.axes.Axes.legend`
--------------------------------------------
[Bar color demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_colors.html#sphx-glr-gallery-lines-bars-and-markers-bar-colors-py)
Bar color demo
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Stacked bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html#sphx-glr-gallery-lines-bars-and-markers-bar-stacked-py)
Stacked bar chart
[Grouped bar chart with labels](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html#sphx-glr-gallery-lines-bars-and-markers-barchart-py)
Grouped bar chart with labels
[Plotting categorical variables](https://matplotlib.org/stable/gallery/lines_bars_and_markers/categorical_variables.html#sphx-glr-gallery-lines-bars-and-markers-categorical-variables-py)
Plotting categorical variables
[Fill Between and Alpha](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_alpha.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-alpha-py)
Fill Between and Alpha
[Hat graph](https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py)
Hat graph
[Customizing dashed line styles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/line_demo_dash_control.html#sphx-glr-gallery-lines-bars-and-markers-line-demo-dash-control-py)
Customizing dashed line styles
[Lines with a ticked patheffect](https://matplotlib.org/stable/gallery/lines_bars_and_markers/lines_with_ticks_demo.html#sphx-glr-gallery-lines-bars-and-markers-lines-with-ticks-demo-py)
Lines with a ticked patheffect
[Scatter plots with custom symbols](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_custom_symbol.html#sphx-glr-gallery-lines-bars-and-markers-scatter-custom-symbol-py)
Scatter plots with custom symbols
[Scatter plots with a legend](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#sphx-glr-gallery-lines-bars-and-markers-scatter-with-legend-py)
Scatter plots with a legend
[Stackplots and streamgraphs](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-stackplot-demo-py)
Stackplots and streamgraphs
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Contourf Hatching](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_hatching.html#sphx-glr-gallery-images-contours-and-fields-contourf-hatching-py)
Contourf Hatching
[Tricontour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_demo.html#sphx-glr-gallery-images-contours-and-fields-tricontour-demo-py)
Tricontour Demo
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Using histograms to plot a cumulative distribution](https://matplotlib.org/stable/gallery/statistics/histogram_cumulative.html#sphx-glr-gallery-statistics-histogram-cumulative-py)
Using histograms to plot a cumulative distribution
[The histogram (hist) function with multiple data sets](https://matplotlib.org/stable/gallery/statistics/histogram_multihist.html#sphx-glr-gallery-statistics-histogram-multihist-py)
The histogram (hist) function with multiple data sets
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Labeling a pie and a donut](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py)
Labeling a pie and a donut
[Polar Legend](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_legend.html#sphx-glr-gallery-pie-and-polar-charts-polar-legend-py)
Polar Legend
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[Legend using pre-defined labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend.html#sphx-glr-gallery-text-labels-and-annotations-legend-py)
Legend using pre-defined labels
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[Mathtext](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_demo.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-demo-py)
Mathtext
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Parasite Simple](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py)
Parasite Simple
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html#sphx-glr-gallery-mplot3d-2dcollections3d-py)
Plot 2D data on 3D plot
[Parametric Curve](https://matplotlib.org/stable/gallery/mplot3d/lines3d.html#sphx-glr-gallery-mplot3d-lines3d-py)
Parametric Curve
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Custom tick formatter for time series](https://matplotlib.org/stable/gallery/ticks/date_index_formatter.html#sphx-glr-gallery-ticks-date-index-formatter-py)
Custom tick formatter for time series
[Group barchart with units](https://matplotlib.org/stable/gallery/units/bar_unit_demo.html#sphx-glr-gallery-units-bar-unit-demo-py)
Group barchart with units
[Simple Legend01](https://matplotlib.org/stable/gallery/userdemo/simple_legend01.html#sphx-glr-gallery-userdemo-simple-legend01-py)
Simple Legend01
[Simple Legend02](https://matplotlib.org/stable/gallery/userdemo/simple_legend02.html#sphx-glr-gallery-userdemo-simple-legend02-py)
Simple Legend02
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
| programming_docs |
matplotlib matplotlib.axes.Axes.violin matplotlib.axes.Axes.violin
===========================
Axes.violin(*vpstats*, *positions=None*, *vert=True*, *widths=0.5*, *showmeans=False*, *showextrema=True*, *showmedians=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L8011-L8176)
Drawing function for violin plots.
Draw a violin plot for each column of *vpstats*. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, the maximum, and the quantiles values.
Parameters:
**vpstats**list of dicts
A list of dictionaries containing stats for each violin plot. Required keys are:
* `coords`: A list of scalars containing the coordinates that the violin's kernel density estimate were evaluated at.
* `vals`: A list of scalars containing the values of the kernel density estimate at each of the coordinates given in *coords*.
* `mean`: The mean value for this violin's dataset.
* `median`: The median value for this violin's dataset.
* `min`: The minimum value for this violin's dataset.
* `max`: The maximum value for this violin's dataset.
Optional keys are:
* `quantiles`: A list of scalars containing the quantile values for this violin's dataset.
**positions**array-like, default: [1, 2, ..., n]
The positions of the violins. The ticks and limits are automatically set to match the positions.
**vert**bool, default: True.
If true, plots the violins vertically. Otherwise, plots the violins horizontally.
**widths**array-like, default: 0.5
Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space.
**showmeans**bool, default: False
If true, will toggle rendering of the means.
**showextrema**bool, default: True
If true, will toggle rendering of the extrema.
**showmedians**bool, default: False
If true, will toggle rendering of the medians.
Returns:
dict
A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys:
* `bodies`: A list of the [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") instances containing the filled area of each violin.
* `cmeans`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the mean values of each of the violin's distribution.
* `cmins`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the bottom of each violin's distribution.
* `cmaxes`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the top of each violin's distribution.
* `cbars`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the centers of each violin's distribution.
* `cmedians`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance that marks the median values of each of the violin's distribution.
* `cquantiles`: A [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") instance created to identify the quantiles values of each of the violin's distribution.
matplotlib matplotlib.axes.Axes.set_axisbelow matplotlib.axes.Axes.set\_axisbelow
===================================
Axes.set\_axisbelow(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3163-L3195)
Set whether axis ticks and gridlines are above or below most artists.
This controls the zorder of the ticks and gridlines. For more information on the zorder see [Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html).
Parameters:
**b**bool or 'line'
Possible values:
* *True* (zorder = 0.5): Ticks and gridlines are below all Artists.
* 'line' (zorder = 1.5): Ticks and gridlines are above patches (e.g. rectangles, with default zorder = 1) but still below lines and markers (with their default zorder = 2).
* *False* (zorder = 2.5): Ticks and gridlines are above patches and lines / markers.
See also
[`get_axisbelow`](matplotlib.axes.axes.get_axisbelow#matplotlib.axes.Axes.get_axisbelow "matplotlib.axes.Axes.get_axisbelow")
matplotlib matplotlib.artist.Artist.get_transformed_clip_path_and_affine matplotlib.artist.Artist.get\_transformed\_clip\_path\_and\_affine
==================================================================
Artist.get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
matplotlib mpl_toolkits.axes_grid1.axes_grid mpl\_toolkits.axes\_grid1.axes\_grid
====================================
Classes
-------
| | |
| --- | --- |
| [`AxesGrid`](mpl_toolkits.axes_grid1.axes_grid.axesgrid#mpl_toolkits.axes_grid1.axes_grid.AxesGrid "mpl_toolkits.axes_grid1.axes_grid.AxesGrid") | alias of [`ImageGrid`](mpl_toolkits.axes_grid1.axes_grid.imagegrid#mpl_toolkits.axes_grid1.axes_grid.ImageGrid "mpl_toolkits.axes_grid1.axes_grid.ImageGrid") |
| [`CbarAxes`](mpl_toolkits.axes_grid1.axes_grid.cbaraxes#mpl_toolkits.axes_grid1.axes_grid.CbarAxes "mpl_toolkits.axes_grid1.axes_grid.CbarAxes")(\*args, orientation, \*\*kwargs) | [*Deprecated*] |
| [`CbarAxesBase`](mpl_toolkits.axes_grid1.axes_grid.cbaraxesbase#mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase "mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase")(\*args, orientation, \*\*kwargs) | |
| [`Grid`](mpl_toolkits.axes_grid1.axes_grid.grid#mpl_toolkits.axes_grid1.axes_grid.Grid "mpl_toolkits.axes_grid1.axes_grid.Grid")(fig, rect, nrows\_ncols[, ngrids, ...]) | A grid of Axes. |
| [`ImageGrid`](mpl_toolkits.axes_grid1.axes_grid.imagegrid#mpl_toolkits.axes_grid1.axes_grid.ImageGrid "mpl_toolkits.axes_grid1.axes_grid.ImageGrid")(fig, rect, nrows\_ncols[, ngrids, ...]) | Parameters:
|
matplotlib matplotlib.axis.Axis.get_minor_locator matplotlib.axis.Axis.get\_minor\_locator
========================================
Axis.get\_minor\_locator()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1515-L1517)
Get the locator of the minor ticker.
matplotlib matplotlib.axis.Axis.get_major_formatter matplotlib.axis.Axis.get\_major\_formatter
==========================================
Axis.get\_major\_formatter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1519-L1521)
Get the formatter of the major ticker.
matplotlib matplotlib.colors.make_norm_from_scale matplotlib.colors.make\_norm\_from\_scale
=========================================
matplotlib.colors.make\_norm\_from\_scale(*scale\_cls*, *base\_norm\_cls=None*, *\**, *init=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1575-L1621)
Decorator for building a [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass from a [`ScaleBase`](../scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase") subclass.
After
```
@make_norm_from_scale(scale_cls)
class norm_cls(Normalize):
...
```
*norm\_cls* is filled with methods so that normalization computations are forwarded to *scale\_cls* (i.e., *scale\_cls* is the scale that would be used for the colorbar of a mappable normalized with *norm\_cls*).
If *init* is not passed, then the constructor signature of *norm\_cls* will be `norm_cls(vmin=None, vmax=None, clip=False)`; these three parameters will be forwarded to the base class (`Normalize.__init__`), and a *scale\_cls* object will be initialized with no arguments (other than a dummy axis).
If the *scale\_cls* constructor takes additional parameters, then *init* should be passed to [`make_norm_from_scale`](#matplotlib.colors.make_norm_from_scale "matplotlib.colors.make_norm_from_scale"). It is a callable which is *only* used for its signature. First, this signature will become the signature of *norm\_cls*. Second, the *norm\_cls* constructor will bind the parameters passed to it using this signature, extract the bound *vmin*, *vmax*, and *clip* values, pass those to `Normalize.__init__`, and forward the remaining bound values (including any defaults defined by the signature) to the *scale\_cls* constructor.
matplotlib matplotlib.artist.Artist.get_zorder matplotlib.artist.Artist.get\_zorder
====================================
Artist.get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
Examples using `matplotlib.artist.Artist.get_zorder`
----------------------------------------------------
[SVG Filter Line](https://matplotlib.org/stable/gallery/misc/svg_filter_line.html#sphx-glr-gallery-misc-svg-filter-line-py)
SVG Filter Line
[SVG Filter Pie](https://matplotlib.org/stable/gallery/misc/svg_filter_pie.html#sphx-glr-gallery-misc-svg-filter-pie-py)
SVG Filter Pie
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib matplotlib.artist.kwdoc matplotlib.artist.kwdoc
=======================
matplotlib.artist.kwdoc(*artist*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1804-L1823)
Inspect an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") class (using [`ArtistInspector`](matplotlib.artist.artistinspector#matplotlib.artist.ArtistInspector "matplotlib.artist.ArtistInspector")) and return information about its settable properties and their current values.
Parameters:
**artist**[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or an iterable of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s
Returns:
str
The settable properties of *artist*, as plain text if `[rcParams["docstring.hardcopy"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=docstring.hardcopy#matplotlibrc-sample)` (default: `False`) is False and as a rst table (intended for use in Sphinx) if it is True.
matplotlib matplotlib.axes.Axes.eventplot matplotlib.axes.Axes.eventplot
==============================
Axes.eventplot(*positions*, *orientation='horizontal'*, *lineoffsets=1*, *linelengths=1*, *linewidths=None*, *colors=None*, *linestyles='solid'*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L1182-L1411)
Plot identical parallel lines at the given positions.
This type of plot is commonly used in neuroscience for representing neural events, where it is usually called a spike raster, dot raster, or raster plot.
However, it is useful in any situation where you wish to show the timing or position of multiple sets of discrete events, such as the arrival times of people to a business on each day of the month or the date of hurricanes each year of the last century.
Parameters:
**positions**array-like or list of array-like
A 1D array-like defines the positions of one sequence of events.
Multiple groups of events may be passed as a list of array-likes. Each group can be styled independently by passing lists of values to *lineoffsets*, *linelengths*, *linewidths*, *colors* and *linestyles*.
Note that *positions* can be a 2D array, but in practice different event groups usually have different counts so that one will use a list of different-length arrays rather than a 2D array.
**orientation**{'horizontal', 'vertical'}, default: 'horizontal'
The direction of the event sequence:
* 'horizontal': the events are arranged horizontally. The indicator lines are vertical.
* 'vertical': the events are arranged vertically. The indicator lines are horizontal.
**lineoffsets**float or array-like, default: 1
The offset of the center of the lines from the origin, in the direction orthogonal to *orientation*.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linelengths**float or array-like, default: 1
The total height of the lines (i.e. the lines stretches from `lineoffset - linelength/2` to `lineoffset + linelength/2`).
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linewidths**float or array-like, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The line width(s) of the event lines, in points.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**colors**color or list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
The color(s) of the event lines.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**linestyles**str or tuple or list of such values, default: 'solid'
Default is 'solid'. Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink in points.
If *positions* is 2D, this can be a sequence with length matching the length of *positions*.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*positions*, *lineoffsets*, *linelengths*, *linewidths*, *colors*, *linestyles*
**\*\*kwargs**
Other keyword arguments are line collection properties. See [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") for a list of the valid properties.
Returns:
list of [`EventCollection`](../collections_api#matplotlib.collections.EventCollection "matplotlib.collections.EventCollection")
The [`EventCollection`](../collections_api#matplotlib.collections.EventCollection "matplotlib.collections.EventCollection") that were added.
#### Notes
For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only a single value is given, that value is applied to all lines. If an array-like is given, it must have the same length as *positions*, and each value will be applied to the corresponding row of the array.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.py), [png](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.png))
Examples using `matplotlib.axes.Axes.eventplot`
-----------------------------------------------
[eventplot(D)](https://matplotlib.org/stable/plot_types/stats/eventplot.html#sphx-glr-plot-types-stats-eventplot-py)
eventplot(D)
matplotlib matplotlib.pyplot.setp matplotlib.pyplot.setp
======================
matplotlib.pyplot.setp(*obj*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L580-L582)
Set one or more properties on an [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), or list allowed values.
Parameters:
**obj**[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artist(s) whose properties are being set or queried. When setting properties, all artists are affected; when querying the allowed values, only the first instance in the sequence is queried.
For example, two lines can be made thicker and red with a single call:
```
>>> x = arange(0, 1, 0.01)
>>> lines = plot(x, sin(2*pi*x), x, sin(4*pi*x))
>>> setp(lines, linewidth=2, color='r')
```
**file**file-like, default: [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "(in Python v3.10)")
Where [`setp`](#matplotlib.pyplot.setp "matplotlib.pyplot.setp") writes its output when asked to list allowed values.
```
>>> with open('output.log') as file:
... setp(line, file=file)
```
The default, `None`, means [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "(in Python v3.10)").
**\*args, \*\*kwargs**
The properties to set. The following combinations are supported:
* Set the linestyle of a line to be dashed:
```
>>> line, = plot([1, 2, 3])
>>> setp(line, linestyle='--')
```
* Set multiple properties at once:
```
>>> setp(line, linewidth=2, color='r')
```
* List allowed values for a line's linestyle:
```
>>> setp(line, 'linestyle')
linestyle: {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
```
* List all properties that can be set, and their allowed values:
```
>>> setp(line)
agg_filter: a filter function, ...
[long output listing omitted]
```
[`setp`](#matplotlib.pyplot.setp "matplotlib.pyplot.setp") also supports MATLAB style string/value pairs. For example, the following are equivalent:
```
>>> setp(lines, 'linewidth', 2, 'color', 'r') # MATLAB style
>>> setp(lines, linewidth=2, color='r') # Python style
```
See also
[`getp`](matplotlib.pyplot.getp#matplotlib.pyplot.getp "matplotlib.pyplot.getp")
Examples using `matplotlib.pyplot.setp`
---------------------------------------
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Pie Demo2](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_demo2.html#sphx-glr-gallery-pie-and-polar-charts-pie-demo2-py)
Pie Demo2
[Labeling a pie and a donut](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py)
Labeling a pie and a donut
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Topographic hillshading](https://matplotlib.org/stable/gallery/specialty_plots/topographic_hillshading.html#sphx-glr-gallery-specialty-plots-topographic-hillshading-py)
Topographic hillshading
[Evans test](https://matplotlib.org/stable/gallery/units/evans_test.html#sphx-glr-gallery-units-evans-test-py)
Evans test
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
| programming_docs |
matplotlib matplotlib.axis.Axis.get_ticklabels matplotlib.axis.Axis.get\_ticklabels
====================================
Axis.get\_ticklabels(*minor=False*, *which=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1359-L1388)
Get this Axis' tick labels.
Parameters:
**minor**bool
Whether to return the minor or the major ticklabels.
**which**None, ('minor', 'major', 'both')
Overrides *minor*.
Selects which ticklabels to return
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
Examples using `matplotlib.axis.Axis.get_ticklabels`
----------------------------------------------------
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
matplotlib mpl_toolkits.mplot3d.proj3d.inv_transform mpl\_toolkits.mplot3d.proj3d.inv\_transform
===========================================
mpl\_toolkits.mplot3d.proj3d.inv\_transform(*xs*, *ys*, *zs*, *M*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L139-L147)
matplotlib mpl_toolkits.axes_grid1.axes_size.AxesX mpl\_toolkits.axes\_grid1.axes\_size.AxesX
==========================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.AxesX(*axes*, *aspect=1.0*, *ref\_ax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L91-L114)
Bases: `_Base`
Scaled size whose relative part corresponds to the data width of the *axes* multiplied by the *aspect*.
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L104-L114)
Examples using `mpl_toolkits.axes_grid1.axes_size.AxesX`
--------------------------------------------------------
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Simple Axes Divider 3](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-gallery-axes-grid1-simple-axes-divider3-py)
Simple Axes Divider 3
matplotlib matplotlib.axis.Axis.get_minorticklabels matplotlib.axis.Axis.get\_minorticklabels
=========================================
Axis.get\_minorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1351-L1357)
Return this Axis' minor tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
matplotlib matplotlib.artist.Artist.remove_callback matplotlib.artist.Artist.remove\_callback
=========================================
Artist.remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](matplotlib.artist.artist.add_callback#matplotlib.artist.Artist.add_callback "matplotlib.artist.Artist.add_callback")
matplotlib matplotlib.pyplot.subplot2grid matplotlib.pyplot.subplot2grid
==============================
matplotlib.pyplot.subplot2grid(*shape*, *loc*, *rowspan=1*, *colspan=1*, *fig=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1542-L1602)
Create a subplot at a specific location inside a regular grid.
Parameters:
**shape**(int, int)
Number of rows and of columns of the grid in which to place axis.
**loc**(int, int)
Row number and column number of the axis location within the grid.
**rowspan**int, default: 1
Number of rows for the axis to span downwards.
**colspan**int, default: 1
Number of columns for the axis to span to the right.
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure"), optional
Figure to place the subplot in. Defaults to the current figure.
**\*\*kwargs**
Additional keyword arguments are handed to [`add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot").
Returns:
[`axes.SubplotBase`](matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase"), or another subclass of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The axes of the subplot. The returned axes base class depends on the projection used. It is [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](../projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used. The returned axes is then a subplot subclass of the base class.
#### Notes
The following call
```
ax = subplot2grid((nrows, ncols), (row, col), rowspan, colspan)
```
is identical to
```
fig = gcf()
gs = fig.add_gridspec(nrows, ncols)
ax = fig.add_subplot(gs[row:row+rowspan, col:col+colspan])
```
Examples using `matplotlib.pyplot.subplot2grid`
-----------------------------------------------
[Resizing axes with tight layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_tight_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-tight-layout-py)
Resizing axes with tight layout
[subplot2grid demo](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec01.html#sphx-glr-gallery-userdemo-demo-gridspec01-py)
subplot2grid demo
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.axes.Axes.barbs matplotlib.axes.Axes.barbs
==========================
Axes.barbs(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5077-L5086)
Plot a 2D field of barbs.
Call signature:
```
barbs([X, Y], U, V, [C], **kwargs)
```
Where *X*, *Y* define the barb locations, *U*, *V* define the barb directions, and *C* optionally sets the color.
All arguments may be 1D or 2D. *U*, *V*, *C* may be masked arrays, but masked *X*, *Y* are not supported at present.
Barbs are traditionally used in meteorology as a way to plot the speed and direction of wind observations, but can technically be used to plot any two dimensional vector quantity. As opposed to arrows, which give vector magnitude by the length of the arrow, the barbs give more quantitative information about the vector magnitude by putting slanted lines or a triangle for various increments in magnitude, as show schematically below:
```
: /\ \
: / \ \
: / \ \ \
: / \ \ \
: ------------------------------
```
The largest increment is given by a triangle (or "flag"). After those come full lines (barbs). The smallest increment is a half line. There is only, of course, ever at most 1 half line. If the magnitude is small and only needs a single half-line and no full lines or triangles, the half-line is offset from the end of the barb so that it can be easily distinguished from barbs with a single full line. The magnitude for the barb shown above would nominally be 65, using the standard increments of 50, 10, and 5.
See also <https://en.wikipedia.org/wiki/Wind_barb>.
Parameters:
**X, Y**1D or 2D array-like, optional
The x and y coordinates of the barb locations. See *pivot* for how the barbs are drawn to the x, y positions.
If not given, they will be generated as a uniform integer meshgrid based on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D using `X, Y = np.meshgrid(X, Y)`. In this case `len(X)` and `len(Y)` must match the column and row dimensions of *U* and *V*.
**U, V**1D or 2D array-like
The x and y components of the barb shaft.
**C**1D or 2D array-like, optional
Numeric data that defines the barb colors by colormapping via *norm* and *cmap*.
This does not support explicit colors. If you want to set colors directly, use *barbcolor* instead.
**length**float, default: 7
Length of the barb in points; the other parts of the barb are scaled against this.
**pivot**{'tip', 'middle'} or float, default: 'tip'
The part of the arrow that is anchored to the *X*, *Y* grid. The barb rotates about this point. This can also be a number, which shifts the start of the barb that many points away from grid point.
**barbcolor**color or color sequence
The color of all parts of the barb except for the flags. This parameter is analogous to the *edgecolor* parameter for polygons, which can be used instead. However this parameter will override facecolor.
**flagcolor**color or color sequence
The color of any flags on the barb. This parameter is analogous to the *facecolor* parameter for polygons, which can be used instead. However, this parameter will override facecolor. If this is not set (and *C* has not either) then *flagcolor* will be set to match *barbcolor* so that the barb has a uniform color. If *C* has been set, *flagcolor* has no effect.
**sizes**dict, optional
A dictionary of coefficients specifying the ratio of a given feature to the length of the barb. Only those values one wishes to override need to be included. These features include:
* 'spacing' - space between features (flags, full/half barbs)
* 'height' - height (distance from shaft to top) of a flag or full barb
* 'width' - width of a flag, twice the width of a full barb
* 'emptybarb' - radius of the circle used for low magnitudes
**fill\_empty**bool, default: False
Whether the empty barbs (circles) that are drawn should be filled with the flag color. If they are not filled, the center is transparent.
**rounding**bool, default: True
Whether the vector magnitude should be rounded when allocating barb components. If True, the magnitude is rounded to the nearest multiple of the half-barb increment. If False, the magnitude is simply truncated to the next lowest multiple.
**barb\_increments**dict, optional
A dictionary of increments specifying values to associate with different parts of the barb. Only those values one wishes to override need to be included.
* 'half' - half barbs (Default is 5)
* 'full' - full barbs (Default is 10)
* 'flag' - flags (default is 50)
**flip\_barb**bool or array-like of bool, default: False
Whether the lines and flags should point opposite to normal. Normal behavior is for the barbs and lines to point right (comes from wind barbs having these features point towards low pressure in the Northern Hemisphere).
A single value is applied to all barbs. Individual barbs can be flipped by passing a bool array of the same size as *U* and *V*.
Returns:
**barbs**[`Barbs`](matplotlib.quiver.barbs#matplotlib.quiver.Barbs "matplotlib.quiver.Barbs")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
The barbs can further be customized using [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") keyword arguments:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.axes.Axes.barbs`
-------------------------------------------
[Wind Barbs](https://matplotlib.org/stable/gallery/images_contours_and_fields/barb_demo.html#sphx-glr-gallery-images-contours-and-fields-barb-demo-py)
Wind Barbs
[barbs(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/barbs.html#sphx-glr-plot-types-arrays-barbs-py)
barbs(X, Y, U, V)
matplotlib matplotlib.axes.Axes.inset_axes matplotlib.axes.Axes.inset\_axes
================================
Axes.inset\_axes(*bounds*, *\**, *transform=None*, *zorder=5*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L314-L387)
Add a child inset Axes to this existing Axes.
Parameters:
**bounds**[x0, y0, width, height]
Lower-left corner of inset Axes, and its width and height.
**transform**[`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Defaults to `ax.transAxes`, i.e. the units of *rect* are in Axes-relative coordinates.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the inset [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). *str* is the name of a custom projection, see [`projections`](../projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**zorder**number
Defaults to 5 (same as [`Axes.legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")). Adjust higher or lower to change whether it is above or below data plotted on the parent Axes.
**\*\*kwargs**
Other keyword arguments are passed on to the inset Axes class.
Returns:
ax
The created [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance.
Warning
This method is experimental as of 3.0, and the API may change.
#### Examples
This example makes two inset Axes, the first is in Axes-relative coordinates, and the second in data-coordinates:
```
fig, ax = plt.subplots()
ax.plot(range(10))
axin1 = ax.inset_axes([0.8, 0.1, 0.15, 0.15])
axin2 = ax.inset_axes(
[5, 7, 2.3, 2.3], transform=ax.transData)
```
Examples using `matplotlib.axes.Axes.inset_axes`
------------------------------------------------
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Placing Colorbars](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/colorbar_placement.html#sphx-glr-gallery-subplots-axes-and-figures-colorbar-placement-py)
Placing Colorbars
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
| programming_docs |
matplotlib matplotlib.axis.Axis.get_minorticklocs matplotlib.axis.Axis.get\_minorticklocs
=======================================
Axis.get\_minorticklocs()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1418-L1434)
Return this Axis' minor tick locations in data coordinates.
matplotlib matplotlib.axes.Axes.set_facecolor matplotlib.axes.Axes.set\_facecolor
===================================
Axes.set\_facecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1525-L1535)
Set the facecolor of the Axes.
Parameters:
**color**color
Examples using `matplotlib.axes.Axes.set_facecolor`
---------------------------------------------------
[Color Demo](https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-gallery-color-color-demo-py)
Color Demo
matplotlib matplotlib.pyplot.delaxes matplotlib.pyplot.delaxes
=========================
matplotlib.pyplot.delaxes(*ax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1056-L1062)
Remove an [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") (defaulting to the current axes) from its figure.
matplotlib matplotlib.pyplot.imshow matplotlib.pyplot.imshow
========================
matplotlib.pyplot.imshow(*X*, *cmap=None*, *norm=None*, *\**, *aspect=None*, *interpolation=None*, *alpha=None*, *vmin=None*, *vmax=None*, *origin=None*, *extent=None*, *interpolation\_stage=None*, *filternorm=True*, *filterrad=4.0*, *resample=None*, *url=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2605-L2620)
Display data as an image, i.e., on a 2D regular raster.
The input may either be actual RGB(A) data, or 2D scalar data, which will be rendered as a pseudocolor image. For displaying a grayscale image set up the colormapping using the parameters `cmap='gray', vmin=0, vmax=255`.
The number of pixels used to render an image is set by the Axes size and the *dpi* of the figure. This can lead to aliasing artifacts when the image is resampled because the displayed image size will usually not match the size of *X* (see [Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html)). The resampling can be controlled via the *interpolation* parameter and/or `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`).
Parameters:
**X**array-like or PIL image
The image data. Supported array shapes are:
* (M, N): an image with scalar data. The values are mapped to colors using normalization and a colormap. See parameters *norm*, *cmap*, *vmin*, *vmax*.
* (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
* (M, N, 4): an image with RGBA values (0-1 float or 0-255 int), i.e. including transparency.
The first two dimensions (M, N) define the rows and columns of the image.
Out-of-range RGB(A) values are clipped.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *X* is RGB(A).
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *X* is RGB(A).
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
This parameter is ignored if *X* is RGB(A).
**aspect**{'equal', 'auto'} or float, default: `[rcParams["image.aspect"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.aspect#matplotlibrc-sample)` (default: `'equal'`)
The aspect ratio of the Axes. This parameter is particularly relevant for images since it determines whether data pixels are square.
This parameter is a shortcut for explicitly calling [`Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect"). See there for further details.
* 'equal': Ensures an aspect ratio of 1. Pixels will be square (unless pixel sizes are explicitly made non-square in data coordinates using *extent*).
* 'auto': The Axes is kept fixed and the aspect is adjusted so that the data fit in the Axes. In general, this will result in non-square pixels.
**interpolation**str, default: `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`)
The interpolation method used.
Supported values are 'none', 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'blackman'.
If *interpolation* is 'none', then no interpolation is performed on the Agg, ps, pdf and svg backends. Other backends will fall back to 'nearest'. Note that most SVG renderers perform interpolation at rendering and that the default interpolation method they implement may differ.
If *interpolation* is the default 'antialiased', then 'nearest' interpolation is used if the image is upsampled by more than a factor of three (i.e. the number of display pixels is at least three times the size of the data array). If the upsampling rate is smaller than 3, or the image is downsampled, then 'hanning' interpolation is used to act as an anti-aliasing filter, unless the image happens to be upsampled by exactly a factor of two or one.
See [Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html) for an overview of the supported interpolation methods, and [Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html) for a discussion of image antialiasing.
Some interpolation methods require an additional radius parameter, which can be set by *filterrad*. Additionally, the antigrain image resize filter is controlled by the parameter *filternorm*.
**interpolation\_stage**{'data', 'rgba'}, default: 'data'
If 'data', interpolation is carried out on the data provided by the user. If 'rgba', the interpolation is carried out after the colormapping has been applied (visual interpolation).
**alpha**float or array-like, optional
The alpha blending value, between 0 (transparent) and 1 (opaque). If *alpha* is an array, the alpha blending values are applied pixel by pixel, and *alpha* must have the same shape as *X*.
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Place the [0, 0] index of the array in the upper left or lower left corner of the Axes. The convention (the default) 'upper' is typically used for matrices and images.
Note that the vertical axis points upward for 'lower' but downward for 'upper'.
See the [origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html) tutorial for examples and a more detailed description.
**extent**floats (left, right, bottom, top), optional
The bounding box in data coordinates that the image will fill. The image is stretched individually along x and y to fill the box.
The default extent is determined by the following conditions. Pixels have unit size in data coordinates. Their centers are on integer coordinates, and their center coordinates range from 0 to columns-1 horizontally and from 0 to rows-1 vertically.
Note that the direction of the vertical axis and thus the default values for top and bottom depend on *origin*:
* For `origin == 'upper'` the default is `(-0.5, numcols-0.5, numrows-0.5, -0.5)`.
* For `origin == 'lower'` the default is `(-0.5, numcols-0.5, -0.5, numrows-0.5)`.
See the [origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html) tutorial for examples and a more detailed description.
**filternorm**bool, default: True
A parameter for the antigrain image resize filter (see the antigrain documentation). If *filternorm* is set, the filter normalizes integer values and corrects the rounding errors. It doesn't do anything with the source floating point values, it corrects only integers according to the rule of 1.0 which means that any sum of pixel weights must be equal to 1.0. So, the filter function must produce a graph of the proper shape.
**filterrad**float > 0, default: 4.0
The filter radius for filters that have a radius parameter, i.e. when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
**resample**bool, default: `[rcParams["image.resample"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.resample#matplotlibrc-sample)` (default: `True`)
When *True*, use a full resampling method. When *False*, only resample when the output image is larger than the input image.
**url**str, optional
Set the url of the created [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"). See [`Artist.set_url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url").
Returns:
[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties
These parameters are passed on to the constructor of the [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") artist.
See also
[`matshow`](matplotlib.pyplot.matshow#matplotlib.pyplot.matshow "matplotlib.pyplot.matshow")
Plot a matrix or an array as an image.
#### Notes
Unless *extent* is used, pixel centers will be located at integer coordinates. In other words: the origin will coincide with the center of pixel (0, 0).
There are two common representations for RGB images with an alpha channel:
* Straight (unassociated) alpha: R, G, and B channels represent the color of the pixel, disregarding its opacity.
* Premultiplied (associated) alpha: R, G, and B channels represent the color of the pixel, adjusted for its opacity by multiplication.
[`imshow`](#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow") expects RGB images adopting the straight (unassociated) alpha representation.
Examples using `matplotlib.pyplot.imshow`
-----------------------------------------
[Layer Images](https://matplotlib.org/stable/gallery/images_contours_and_fields/layer_images.html#sphx-glr-gallery-images-contours-and-fields-layer-images-py)
Layer Images
[Subplots spacings and margins](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_adjust.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-adjust-py)
Subplots spacings and margins
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html#sphx-glr-gallery-misc-hyperlinks-sgskip-py)
Hyperlinks
[Image tutorial](https://matplotlib.org/stable/tutorials/introductory/images.html#sphx-glr-tutorials-introductory-images-py)
Image tutorial
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.artist.Artist.is_transform_set matplotlib.artist.Artist.is\_transform\_set
===========================================
Artist.is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") has been called.
matplotlib matplotlib.animation.FFMpegWriter matplotlib.animation.FFMpegWriter
=================================
*class*matplotlib.animation.FFMpegWriter(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L545-L565)
Pipe-based ffmpeg writer.
Frames are streamed directly to ffmpeg via a pipe and written in a single pass.
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
\_\_init\_\_(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L263-L297)
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.FFMpegWriter.__init__ "matplotlib.animation.FFMpegWriter.__init__")([fps, codec, bitrate, extra\_args, ...]) | Parameters:
|
| `bin_path`() | Return the binary path to the commandline tool used by a specific subclass. |
| `finish`() | Finish any processing for writing the movie. |
| `grab_frame`(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| `isAvailable`() | Return whether a MovieWriter subclass is actually available. |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| `setup`(fig, outfile[, dpi]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
| `output_args` | |
| `supported_formats` | |
matplotlib matplotlib.axes.Axes.get_data_ratio matplotlib.axes.Axes.get\_data\_ratio
=====================================
Axes.get\_data\_ratio()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1877-L1889)
Return the aspect ratio of the scaled data.
#### Notes
This method is intended to be overridden by new projection types.
matplotlib matplotlib.quiver.Quiver matplotlib.quiver.Quiver
========================
*class*matplotlib.quiver.Quiver(*ax*, *\*args*, *scale=None*, *headwidth=3*, *headlength=5*, *headaxislength=4.5*, *minshaft=1*, *minlength=1*, *units='width'*, *scale\_units=None*, *angles='uv'*, *width=None*, *color='k'*, *pivot='tail'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L458-L737)
Bases: [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
Specialized PolyCollection for arrows.
The only API method is set\_UVC(), which can be used to change the size, orientation, and color of the arrows; their locations are fixed when the class is instantiated. Possibly this method will be useful in animations.
Much of the work in this class is done in the draw() method so that as much information as possible is available about the plot. In subsequent draw() calls, recalculation is limited to things that might have changed, so there should be no performance penalty from putting the calculations in the draw() method.
The constructor takes one required argument, an Axes instance, followed by the args and kwargs described by the following pyplot interface documentation:
Plot a 2D field of arrows.
Call signature:
```
quiver([X, Y], U, V, [C], **kwargs)
```
*X*, *Y* define the arrow locations, *U*, *V* define the arrow directions, and *C* optionally sets the color.
**Arrow length**
The default settings auto-scales the length of the arrows to a reasonable size. To change this behavior see the *scale* and *scale\_units* parameters.
**Arrow shape**
The arrow shape is determined by *width*, *headwidth*, *headlength* and *headaxislength*. See the notes below.
**Arrow styling**
Each arrow is internally represented by a filled polygon with a default edge linewidth of 0. As a result, an arrow is rather a filled area, not a line with a head, and [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties like *linewidth*, *edgecolor*, *facecolor*, etc. act accordingly.
Parameters:
**X, Y**1D or 2D array-like, optional
The x and y coordinates of the arrow locations.
If not given, they will be generated as a uniform integer meshgrid based on the dimensions of *U* and *V*.
If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D using `X, Y = np.meshgrid(X, Y)`. In this case `len(X)` and `len(Y)` must match the column and row dimensions of *U* and *V*.
**U, V**1D or 2D array-like
The x and y direction components of the arrow vectors. The interpretation of these components (in data or in screen space) depends on *angles*.
*U* and *V* must have the same number of elements, matching the number of arrow locations in *X*, *Y*. *U* and *V* may be masked. Locations masked in any of *U*, *V*, and *C* will not be drawn.
**C**1D or 2D array-like, optional
Numeric data that defines the arrow colors by colormapping via *norm* and *cmap*.
This does not support explicit colors. If you want to set colors directly, use *color* instead. The size of *C* must match the number of arrow locations.
**angles**{'uv', 'xy'} or array-like, default: 'uv'
Method for determining the angle of the arrows.
* 'uv': Arrow direction in screen coordinates. Use this if the arrows symbolize a quantity that is not based on *X*, *Y* data coordinates.
If *U* == *V* the orientation of the arrow on the plot is 45 degrees counter-clockwise from the horizontal axis (positive to the right).
* 'xy': Arrow direction in data coordinates, i.e. the arrows point from (x, y) to (x+u, y+v). Use this e.g. for plotting a gradient field.
* Arbitrary angles may be specified explicitly as an array of values in degrees, counter-clockwise from the horizontal axis.
In this case *U*, *V* is only used to determine the length of the arrows.
Note: inverting a data axis will correspondingly invert the arrows only with `angles='xy'`.
**pivot**{'tail', 'mid', 'middle', 'tip'}, default: 'tail'
The part of the arrow that is anchored to the *X*, *Y* grid. The arrow rotates about this point.
'mid' is a synonym for 'middle'.
**scale**float, optional
Scales the length of the arrow inversely.
Number of data units per arrow length unit, e.g., m/s per plot width; a smaller scale parameter makes the arrow longer. Default is *None*.
If *None*, a simple autoscaling algorithm is used, based on the average vector length and the number of vectors. The arrow length unit is given by the *scale\_units* parameter.
**scale\_units**{'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, optional
If the *scale* kwarg is *None*, the arrow length unit. Default is *None*.
e.g. *scale\_units* is 'inches', *scale* is 2.0, and `(u, v) = (1, 0)`, then the vector will be 0.5 inches long.
If *scale\_units* is 'width' or 'height', then the vector will be half the width/height of the axes.
If *scale\_units* is 'x' then the vector will be 0.5 x-axis units. To plot vectors in the x-y plane, with u and v having the same units as x and y, use `angles='xy', scale_units='xy', scale=1`.
**units**{'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, default: 'width'
Affects the arrow size (except for the length). In particular, the shaft *width* is measured in multiples of this unit.
Supported values are:
* 'width', 'height': The width or height of the Axes.
* 'dots', 'inches': Pixels or inches based on the figure dpi.
* 'x', 'y', 'xy': *X*, *Y* or \(\sqrt{X^2 + Y^2}\) in data units.
The following table summarizes how these values affect the visible arrow size under zooming and figure size changes:
| units | zoom | figure size change |
| --- | --- | --- |
| 'x', 'y', 'xy' | arrow size scales | *
|
| 'width', 'height' | *
| arrow size scales |
| 'dots', 'inches' | *
| *
|
**width**float, optional
Shaft width in arrow units. All head parameters are relative to *width*.
The default depends on choice of *units* above, and number of vectors; a typical starting value is about 0.005 times the width of the plot.
**headwidth**float, default: 3
Head width as multiple of shaft *width*. See the notes below.
**headlength**float, default: 5
Head length as multiple of shaft *width*. See the notes below.
**headaxislength**float, default: 4.5
Head length at shaft intersection as multiple of shaft *width*. See the notes below.
**minshaft**float, default: 1
Length below which arrow scales, in units of head length. Do not set this to less than 1, or small arrows will look terrible!
**minlength**float, default: 1
Minimum length as a multiple of shaft width; if an arrow length is less than this, plot a dot (hexagon) of this diameter instead.
**color**color or color sequence, optional
Explicit color(s) for the arrows. If *C* has been set, *color* has no effect.
This is a synonym for the [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") *facecolor* parameter.
Returns:
[`Quiver`](#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")
Other Parameters:
**data**indexable object, optional
DATA\_PARAMETER\_PLACEHOLDER
**\*\*kwargs**[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties, optional
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"):
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Axes.quiverkey`](matplotlib.axes.axes.quiverkey#matplotlib.axes.Axes.quiverkey "matplotlib.axes.Axes.quiverkey")
Add a key to a quiver plot.
#### Notes
**Arrow shape**
The arrow is drawn as a polygon using the nodes as shown below. The values *headwidth*, *headlength*, and *headaxislength* are in units of *width*.
The defaults give a slightly swept-back arrow. Here are some guidelines how to get other head shapes:
* To make the head a triangle, make *headaxislength* the same as *headlength*.
* To make the arrow more pointed, reduce *headwidth* or increase *headlength* and *headaxislength*.
* To make the head smaller relative to the shaft, scale down all the head parameters proportionally.
* To remove the head completely, set all *head* parameters to 0.
* To get a diamond-shaped head, make *headaxislength* larger than *headlength*.
* Warning: For *headaxislength* < (*headlength* / *headwidth*), the "headaxis" nodes (i.e. the ones connecting the head with the shaft) will protrude out of the head in forward direction so that the arrow head looks broken.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L550-L556)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L541-L548)
quiver\_doc*='\nPlot a 2D field of arrows.\n\nCall signature::\n\n quiver([X, Y], U, V, [C], \*\*kwargs)\n\n\*X\*, \*Y\* define the arrow locations, \*U\*, \*V\* define the arrow directions, and\n\*C\* optionally sets the color.\n\n\*\*Arrow length\*\*\n\nThe default settings auto-scales the length of the arrows to a reasonable size.\nTo change this behavior see the \*scale\* and \*scale\_units\* parameters.\n\n\*\*Arrow shape\*\*\n\nThe arrow shape is determined by \*width\*, \*headwidth\*, \*headlength\* and\n\*headaxislength\*. See the notes below.\n\n\*\*Arrow styling\*\*\n\nEach arrow is internally represented by a filled polygon with a default edge\nlinewidth of 0. As a result, an arrow is rather a filled area, not a line with\na head, and `.PolyCollection` properties like \*linewidth\*, \*edgecolor\*,\n\*facecolor\*, etc. act accordingly.\n\n\nParameters\n----------\nX, Y : 1D or 2D array-like, optional\n The x and y coordinates of the arrow locations.\n\n If not given, they will be generated as a uniform integer meshgrid based\n on the dimensions of \*U\* and \*V\*.\n\n If \*X\* and \*Y\* are 1D but \*U\*, \*V\* are 2D, \*X\*, \*Y\* are expanded to 2D\n using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``\n must match the column and row dimensions of \*U\* and \*V\*.\n\nU, V : 1D or 2D array-like\n The x and y direction components of the arrow vectors. The interpretation\n of these components (in data or in screen space) depends on \*angles\*.\n\n \*U\* and \*V\* must have the same number of elements, matching the number of\n arrow locations in \*X\*, \*Y\*. \*U\* and \*V\* may be masked. Locations masked\n in any of \*U\*, \*V\*, and \*C\* will not be drawn.\n\nC : 1D or 2D array-like, optional\n Numeric data that defines the arrow colors by colormapping via \*norm\* and\n \*cmap\*.\n\n This does not support explicit colors. If you want to set colors directly,\n use \*color\* instead. The size of \*C\* must match the number of arrow\n locations.\n\nangles : {\'uv\', \'xy\'} or array-like, default: \'uv\'\n Method for determining the angle of the arrows.\n\n - \'uv\': Arrow direction in screen coordinates. Use this if the arrows\n symbolize a quantity that is not based on \*X\*, \*Y\* data coordinates.\n\n If \*U\* == \*V\* the orientation of the arrow on the plot is 45 degrees\n counter-clockwise from the horizontal axis (positive to the right).\n\n - \'xy\': Arrow direction in data coordinates, i.e. the arrows point from\n (x, y) to (x+u, y+v). Use this e.g. for plotting a gradient field.\n\n - Arbitrary angles may be specified explicitly as an array of values\n in degrees, counter-clockwise from the horizontal axis.\n\n In this case \*U\*, \*V\* is only used to determine the length of the\n arrows.\n\n Note: inverting a data axis will correspondingly invert the\n arrows only with ``angles=\'xy\'``.\n\npivot : {\'tail\', \'mid\', \'middle\', \'tip\'}, default: \'tail\'\n The part of the arrow that is anchored to the \*X\*, \*Y\* grid. The arrow\n rotates about this point.\n\n \'mid\' is a synonym for \'middle\'.\n\nscale : float, optional\n Scales the length of the arrow inversely.\n\n Number of data units per arrow length unit, e.g., m/s per plot width; a\n smaller scale parameter makes the arrow longer. Default is \*None\*.\n\n If \*None\*, a simple autoscaling algorithm is used, based on the average\n vector length and the number of vectors. The arrow length unit is given by\n the \*scale\_units\* parameter.\n\nscale\_units : {\'width\', \'height\', \'dots\', \'inches\', \'x\', \'y\', \'xy\'}, optional\n If the \*scale\* kwarg is \*None\*, the arrow length unit. Default is \*None\*.\n\n e.g. \*scale\_units\* is \'inches\', \*scale\* is 2.0, and ``(u, v) = (1, 0)``,\n then the vector will be 0.5 inches long.\n\n If \*scale\_units\* is \'width\' or \'height\', then the vector will be half the\n width/height of the axes.\n\n If \*scale\_units\* is \'x\' then the vector will be 0.5 x-axis\n units. To plot vectors in the x-y plane, with u and v having\n the same units as x and y, use\n ``angles=\'xy\', scale\_units=\'xy\', scale=1``.\n\nunits : {\'width\', \'height\', \'dots\', \'inches\', \'x\', \'y\', \'xy\'}, default: \'width\'\n Affects the arrow size (except for the length). In particular, the shaft\n \*width\* is measured in multiples of this unit.\n\n Supported values are:\n\n - \'width\', \'height\': The width or height of the Axes.\n - \'dots\', \'inches\': Pixels or inches based on the figure dpi.\n - \'x\', \'y\', \'xy\': \*X\*, \*Y\* or :math:`\\sqrt{X^2 + Y^2}` in data units.\n\n The following table summarizes how these values affect the visible arrow\n size under zooming and figure size changes:\n\n ================= ================= ==================\n units zoom figure size change\n ================= ================= ==================\n \'x\', \'y\', \'xy\' arrow size scales -\n \'width\', \'height\' - arrow size scales\n \'dots\', \'inches\' - -\n ================= ================= ==================\n\nwidth : float, optional\n Shaft width in arrow units. All head parameters are relative to \*width\*.\n\n The default depends on choice of \*units\* above, and number of vectors;\n a typical starting value is about 0.005 times the width of the plot.\n\nheadwidth : float, default: 3\n Head width as multiple of shaft \*width\*. See the notes below.\n\nheadlength : float, default: 5\n Head length as multiple of shaft \*width\*. See the notes below.\n\nheadaxislength : float, default: 4.5\n Head length at shaft intersection as multiple of shaft \*width\*.\n See the notes below.\n\nminshaft : float, default: 1\n Length below which arrow scales, in units of head length. Do not\n set this to less than 1, or small arrows will look terrible!\n\nminlength : float, default: 1\n Minimum length as a multiple of shaft width; if an arrow length\n is less than this, plot a dot (hexagon) of this diameter instead.\n\ncolor : color or color sequence, optional\n Explicit color(s) for the arrows. If \*C\* has been set, \*color\* has no\n effect.\n\n This is a synonym for the `.PolyCollection` \*facecolor\* parameter.\n\nOther Parameters\n----------------\ndata : indexable object, optional\n DATA\_PARAMETER\_PLACEHOLDER\n\n\*\*kwargs : `~matplotlib.collections.PolyCollection` properties, optional\n All other keyword arguments are passed on to `.PolyCollection`:\n\n \n .. table::\n :class: property-table\n\n ================================================================================================= ==============================================================================================================================================================\n Property Description \n ================================================================================================= ==============================================================================================================================================================\n :meth:`agg\_filter <matplotlib.artist.Artist.set\_agg\_filter>` a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image\n :meth:`alpha <matplotlib.collections.Collection.set\_alpha>` array-like or scalar or None \n :meth:`animated <matplotlib.artist.Artist.set\_animated>` bool \n :meth:`antialiased <matplotlib.collections.Collection.set\_antialiased>` or aa or antialiaseds bool or list of bools \n :meth:`array <matplotlib.cm.ScalarMappable.set\_array>` array-like or None \n :meth:`capstyle <matplotlib.collections.Collection.set\_capstyle>` `.CapStyle` or {\'butt\', \'projecting\', \'round\'} \n :meth:`clim <matplotlib.cm.ScalarMappable.set\_clim>` (vmin: float, vmax: float) \n :meth:`clip\_box <matplotlib.artist.Artist.set\_clip\_box>` `.Bbox` \n :meth:`clip\_on <matplotlib.artist.Artist.set\_clip\_on>` bool \n :meth:`clip\_path <matplotlib.artist.Artist.set\_clip\_path>` Patch or (Path, Transform) or None \n :meth:`cmap <matplotlib.cm.ScalarMappable.set\_cmap>` `.Colormap` or str or None \n :meth:`color <matplotlib.collections.Collection.set\_color>` color or list of rgba tuples \n :meth:`edgecolor <matplotlib.collections.Collection.set\_edgecolor>` or ec or edgecolors color or list of colors or \'face\' \n :meth:`facecolor <matplotlib.collections.Collection.set\_facecolor>` or facecolors or fc color or list of colors \n :meth:`figure <matplotlib.artist.Artist.set\_figure>` `.Figure` \n :meth:`gid <matplotlib.artist.Artist.set\_gid>` str \n :meth:`hatch <matplotlib.collections.Collection.set\_hatch>` {\'/\', \'\\\\\', \'|\', \'-\', \'+\', \'x\', \'o\', \'O\', \'.\', \'\*\'} \n :meth:`in\_layout <matplotlib.artist.Artist.set\_in\_layout>` bool \n :meth:`joinstyle <matplotlib.collections.Collection.set\_joinstyle>` `.JoinStyle` or {\'miter\', \'round\', \'bevel\'} \n :meth:`label <matplotlib.artist.Artist.set\_label>` object \n :meth:`linestyle <matplotlib.collections.Collection.set\_linestyle>` or dashes or linestyles or ls str or tuple or list thereof \n :meth:`linewidth <matplotlib.collections.Collection.set\_linewidth>` or linewidths or lw float or list of floats \n :meth:`mouseover <matplotlib.artist.Artist.set\_mouseover>` bool \n :meth:`norm <matplotlib.cm.ScalarMappable.set\_norm>` `.Normalize` or str or None \n :meth:`offset\_transform <matplotlib.collections.Collection.set\_offset\_transform>` or transOffset unknown \n :meth:`offsets <matplotlib.collections.Collection.set\_offsets>` (N, 2) or (2,) array-like \n :meth:`path\_effects <matplotlib.artist.Artist.set\_path\_effects>` `.AbstractPathEffect` \n :meth:`paths <matplotlib.collections.PolyCollection.set\_verts>` list of array-like \n :meth:`picker <matplotlib.artist.Artist.set\_picker>` None or bool or float or callable \n :meth:`pickradius <matplotlib.collections.Collection.set\_pickradius>` unknown \n :meth:`rasterized <matplotlib.artist.Artist.set\_rasterized>` bool \n :meth:`sizes <matplotlib.collections.\_CollectionWithSizes.set\_sizes>` ndarray or None \n :meth:`sketch\_params <matplotlib.artist.Artist.set\_sketch\_params>` (scale: float, length: float, randomness: float) \n :meth:`snap <matplotlib.artist.Artist.set\_snap>` bool or None \n :meth:`transform <matplotlib.artist.Artist.set\_transform>` `.Transform` \n :meth:`url <matplotlib.artist.Artist.set\_url>` str \n :meth:`urls <matplotlib.collections.Collection.set\_urls>` list of str or None \n :meth:`verts <matplotlib.collections.PolyCollection.set\_verts>` list of array-like \n :meth:`verts\_and\_codes <matplotlib.collections.PolyCollection.set\_verts\_and\_codes>` unknown \n :meth:`visible <matplotlib.artist.Artist.set\_visible>` bool \n :meth:`zorder <matplotlib.artist.Artist.set\_zorder>` float \n ================================================================================================= ==============================================================================================================================================================\n\n\nReturns\n-------\n`~matplotlib.quiver.Quiver`\n\nSee Also\n--------\n.Axes.quiverkey : Add a key to a quiver plot.\n\nNotes\n-----\n\n\*\*Arrow shape\*\*\n\nThe arrow is drawn as a polygon using the nodes as shown below. The values\n\*headwidth\*, \*headlength\*, and \*headaxislength\* are in units of \*width\*.\n\n.. image:: /\_static/quiver\_sizes.svg\n :width: 500px\n\nThe defaults give a slightly swept-back arrow. Here are some guidelines how to\nget other head shapes:\n\n- To make the head a triangle, make \*headaxislength\* the same as \*headlength\*.\n- To make the arrow more pointed, reduce \*headwidth\* or increase \*headlength\*\n and \*headaxislength\*.\n- To make the head smaller relative to the shaft, scale down all the head\n parameters proportionally.\n- To remove the head completely, set all \*head\* parameters to 0.\n- To get a diamond-shaped head, make \*headaxislength\* larger than \*headlength\*.\n- Warning: For \*headaxislength\* < (\*headlength\* / \*headwidth\*), the "headaxis"\n nodes (i.e. the ones connecting the head with the shaft) will protrude out\n of the head in forward direction so that the arrow head looks broken.\n'*
set(*\**, *UVC=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *verts\_and\_codes=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`UVC`](#matplotlib.quiver.Quiver.set_UVC "matplotlib.quiver.Quiver.set_UVC") | unknown |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_UVC(*U*, *V*, *C=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/quiver.py#L558-L583)
Examples using `matplotlib.quiver.Quiver`
-----------------------------------------
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
[Quiver Simple Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-simple-demo-py)
Quiver Simple Demo
| programming_docs |
matplotlib matplotlib.axes.Axes.set_autoscale_on matplotlib.axes.Axes.set\_autoscale\_on
=======================================
Axes.set\_autoscale\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2622-L2632)
Set whether autoscaling is applied to each axis on the next draw or call to [`Axes.autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view").
Parameters:
**b**bool
Examples using `matplotlib.axes.Axes.set_autoscale_on`
------------------------------------------------------
[Resampling Data](https://matplotlib.org/stable/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py)
Resampling Data
matplotlib mpl_toolkits.axes_grid1.inset_locator.BboxConnectorPatch mpl\_toolkits.axes\_grid1.inset\_locator.BboxConnectorPatch
===========================================================
*class*mpl\_toolkits.axes\_grid1.inset\_locator.BboxConnectorPatch(*bbox1*, *bbox2*, *loc1a*, *loc2a*, *loc1b*, *loc2b*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L245-L288)
Bases: [`BboxConnector`](mpl_toolkits.axes_grid1.inset_locator.bboxconnector#mpl_toolkits.axes_grid1.inset_locator.BboxConnector "mpl_toolkits.axes_grid1.inset_locator.BboxConnector")
Connect two bboxes with a quadrilateral.
The quadrilateral is specified by two lines that start and end at corners of the bboxes. The four sides of the quadrilateral are defined by the two lines given, the line between the two corners specified in *bbox1* and the line between the two corners specified in *bbox2*.
Parameters:
**bbox1, bbox2**[`matplotlib.transforms.Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
Bounding boxes to connect.
**loc1a, loc2a, loc1b, loc2b**{1, 2, 3, 4}
The first line connects corners *loc1a* of *bbox1* and *loc2a* of *bbox2*; the second line connects corners *loc1b* of *bbox1* and *loc2b* of *bbox2*. Valid values are:
```
'upper right' : 1,
'upper left' : 2,
'lower left' : 3,
'lower right' : 4
```
**\*\*kwargs**
Patch properties for the line drawn:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/inset_locator.py#L282-L288)
Return the path of this patch.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.inset_locator.BboxConnectorPatch`
-------------------------------------------------------------------------
[Axes Zoom Effect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_zoom_effect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-zoom-effect-py)
Axes Zoom Effect
matplotlib matplotlib.axis.Tick.get_tick_padding matplotlib.axis.Tick.get\_tick\_padding
=======================================
Tick.get\_tick\_padding()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L228-L235)
Get the length of the tick outside of the Axes.
matplotlib mpl_toolkits.axes_grid1.anchored_artists.AnchoredDrawingArea mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredDrawingArea
===============================================================
*class*mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredDrawingArea(*width*, *height*, *xdescent*, *ydescent*, *loc*, *pad=0.4*, *borderpad=0.5*, *prop=None*, *frameon=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/anchored_artists.py#L12-L69)
Bases: [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox")
An anchored container with a fixed size and fillable DrawingArea.
Artists added to the *drawing\_area* will have their coordinates interpreted as pixels. Any transformations set on the artists will be overridden.
Parameters:
**width, height**float
Width and height of the container, in pixels.
**xdescent, ydescent**float
Descent of the container in the x- and y- direction, in pixels.
**loc**str
Location of this artist. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.4
Padding around the child objects, in fraction of the font size.
**borderpad**float, default: 0.5
Border padding, in fraction of the font size.
**prop**[`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
Font property used as a reference for paddings.
**frameon**bool, default: True
If True, draw a box around this artists.
**\*\*kwargs**
Keyword arguments forwarded to [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
#### Examples
To display blue and red circles of different sizes in the upper right of an Axes *ax*:
```
>>> ada = AnchoredDrawingArea(20, 20, 0, 0,
... loc='upper right', frameon=False)
>>> ada.drawing_area.add_artist(Circle((10, 10), 10, fc="b"))
>>> ada.drawing_area.add_artist(Circle((30, 10), 5, fc="r"))
>>> ax.add_artist(ada)
```
Attributes:
**drawing\_area**[`matplotlib.offsetbox.DrawingArea`](../offsetbox_api#matplotlib.offsetbox.DrawingArea "matplotlib.offsetbox.DrawingArea")
A container for artists to display.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.anchored_artists.AnchoredDrawingArea`
-----------------------------------------------------------------------------
[Simple Anchored Artists](https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-gallery-axes-grid1-simple-anchored-artists-py)
Simple Anchored Artists
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
| programming_docs |
matplotlib matplotlib.patches.ConnectionStyle matplotlib.patches.ConnectionStyle
==================================
*class*matplotlib.patches.ConnectionStyle(*stylename*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2650-L3072)
Bases: `_Style`
[`ConnectionStyle`](#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") is a container class which defines several connectionstyle classes, which is used to create a path between two points. These are mainly used with [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch").
A connectionstyle object can be either created as:
```
ConnectionStyle.Arc3(rad=0.2)
```
or:
```
ConnectionStyle("Arc3", rad=0.2)
```
or:
```
ConnectionStyle("Arc3, rad=0.2")
```
The following classes are defined
| Class | Name | Attrs |
| --- | --- | --- |
| Arc3 | `arc3` | rad=0.0 |
| Angle3 | `angle3` | angleA=90, angleB=0 |
| Angle | `angle` | angleA=90, angleB=0, rad=0.0 |
| Arc | `arc` | angleA=0, angleB=0, armA=None, armB=None, rad=0.0 |
| Bar | `bar` | armA=0.0, armB=0.0, fraction=0.3, angle=None |
An instance of any connection style class is an callable object, whose call signature is:
```
__call__(self, posA, posB,
patchA=None, patchB=None,
shrinkA=2., shrinkB=2.)
```
and it returns a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") instance. *posA* and *posB* are tuples of (x, y) coordinates of the two points to be connected. *patchA* (or *patchB*) is given, the returned path is clipped so that it start (or end) from the boundary of the patch. The path is further shrunk by *shrinkA* (or *shrinkB*) which is given in points.
Return the instance of the subclass with the given style name.
*class*Angle(*angleA=90*, *angleB=0*, *rad=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2845-L2905)
Bases: `_Base`
Creates a piecewise continuous quadratic Bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. The connecting edges are rounded with *rad*.
*angleA*
starting angle of the path
*angleB*
ending angle of the path
*rad*
rounding radius of the edge
connect(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2872-L2905)
*class*Angle3(*angleA=90*, *angleB=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2807-L2843)
Bases: `_Base`
Creates a simple quadratic Bezier curve between two points. The middle control points is placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively.
*angleA*
starting angle of the path
*angleB*
ending angle of the path
connect(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2828-L2843)
*class*Arc(*angleA=0*, *angleB=0*, *armA=None*, *armB=None*, *rad=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2907-L2999)
Bases: `_Base`
Creates a piecewise continuous quadratic Bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with *rad*.
*angleA* :
starting angle of the path
*angleB* :
ending angle of the path
*armA* :
length of the starting arm
*armB* :
length of the ending arm
*rad* :
rounding radius of the edges
connect(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2942-L2999)
*class*Arc3(*rad=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2771-L2805)
Bases: `_Base`
Creates a simple quadratic Bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is *rad* times the distance of C0-C2.
*rad*
curvature of the curve.
connect(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2788-L2805)
*class*Bar(*armA=0.0*, *armB=0.0*, *fraction=0.3*, *angle=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3001-L3072)
Bases: `_Base`
A line with *angle* between A and B with *armA* and *armB*. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (*armA* + *fraction* x AB distance). Same for armB.
Parameters:
**armA**float
minimum length of armA
**armB**float
minimum length of armB
**fraction**float
a fraction of the distance between two points that will be added to armA and armB.
**angle**float or None
angle of the connecting line (if None, parallel to A and B)
connect(*posA*, *posB*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3033-L3072)
matplotlib mpl_toolkits.mplot3d.art3d.patch_2d_to_3d mpl\_toolkits.mplot3d.art3d.patch\_2d\_to\_3d
=============================================
mpl\_toolkits.mplot3d.art3d.patch\_2d\_to\_3d(*patch*, *z=0*, *zdir='z'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L380-L384)
Convert a Patch to a Patch3D object.
matplotlib matplotlib.patches.Patch matplotlib.patches.Patch
========================
*class*matplotlib.patches.Patch(*\**, *edgecolor=None*, *facecolor=None*, *color=None*, *linewidth=None*, *linestyle=None*, *antialiased=None*, *hatch=None*, *fill=True*, *capstyle=None*, *joinstyle=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L25-L608)
Bases: [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
A patch is a 2D artist with a face color and an edge color.
If any of *edgecolor*, *facecolor*, *linewidth*, or *antialiased* are *None*, they default to their rc params setting.
The following kwarg properties are supported
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
contains(*mouseevent*, *radius=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L126-L154)
Test whether the mouse event occurred in the patch.
Returns:
(bool, empty dict)
contains\_point(*point*, *radius=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L156-L204)
Return whether the given point is inside the patch.
Parameters:
**point**(float, float)
The point (x, y) to check, in target coordinates of `self.get_transform()`. These are display coordinates for patches that are added to a figure or axes.
**radius**float, optional
Add an additional margin on the patch in target coordinates of `self.get_transform()`. See [`Path.contains_point`](../path_api#matplotlib.path.Path.contains_point "matplotlib.path.Path.contains_point") for further details.
Returns:
bool
#### Notes
The proper use of this method depends on the transform of the patch. Isolated patches do not have a transform. In this case, the patch creation coordinates and the point coordinates match. The following example checks that the center of a circle is within the circle
```
>>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> c.contains_point(center)
True
```
The convention of checking against the transformed patch stems from the fact that this method is predominantly used to check if display coordinates (e.g. from mouse events) are within the patch. If you want to do the above check with data coordinates, you have to properly transform them first:
```
>>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> plt.gca().add_patch(c)
>>> transformed_center = c.get_transform().transform(center)
>>> c.contains_point(transformed_center)
True
```
contains\_points(*points*, *radius=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L206-L233)
Return whether the given points are inside the patch.
Parameters:
**points**(N, 2) array
The points to check, in target coordinates of `self.get_transform()`. These are display coordinates for patches that are added to a figure or axes. Columns contain x and y values.
**radius**float, optional
Add an additional margin on the patch in target coordinates of `self.get_transform()`. See [`Path.contains_point`](../path_api#matplotlib.path.Path.contains_point "matplotlib.path.Path.contains_point") for further details.
Returns:
length-N bool array
#### Notes
The proper use of this method depends on the transform of the patch. See the notes on [`Patch.contains_point`](#matplotlib.patches.Patch.contains_point "matplotlib.patches.Patch.contains_point").
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L580-L595)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
*property*fill
Return whether the patch is filled.
get\_aa()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L282-L284)
Alias for [`get_antialiased`](#matplotlib.patches.Patch.get_antialiased "matplotlib.patches.Patch.get_antialiased").
get\_antialiased()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L282-L284)
Return whether antialiasing is used for drawing.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L470-L472)
Return the capstyle.
get\_data\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L264-L269)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") mapping data coordinates to physical coordinates.
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L286-L288)
Alias for [`get_edgecolor`](#matplotlib.patches.Patch.get_edgecolor "matplotlib.patches.Patch.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L286-L288)
Return the edge color.
get\_extents()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L254-L258)
Return the [`Patch`](#matplotlib.patches.Patch "matplotlib.patches.Patch")'s axis-aligned extents as a [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L290-L292)
Return the face color.
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L290-L292)
Alias for [`get_facecolor`](#matplotlib.patches.Patch.get_facecolor "matplotlib.patches.Patch.get_facecolor").
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L445-L447)
Return whether the patch is filled.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L527-L529)
Return the hatching pattern.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L490-L492)
Return the joinstyle.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L298-L300)
Return the linestyle.
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L294-L296)
Return the line width in points.
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L298-L300)
Alias for [`get_linestyle`](#matplotlib.patches.Patch.get_linestyle "matplotlib.patches.Patch.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L294-L296)
Alias for [`get_linewidth`](#matplotlib.patches.Patch.get_linewidth "matplotlib.patches.Patch.get_linewidth").
get\_patch\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L271-L280)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L597-L599)
Return the path of this patch.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L260-L262)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") applied to the [`Patch`](#matplotlib.patches.Patch "matplotlib.patches.Patch").
get\_verts()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L100-L112)
Return a copy of the vertices used in this patch.
If the patch contains Bezier curves, the curves will be interpolated by line segments. To access the curves as curves, use [`get_path`](#matplotlib.patches.Patch.get_path "matplotlib.patches.Patch.get_path").
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L601-L602)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") | bool or None |
| [`capstyle`](#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") | color or None |
| [`facecolor`](#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L302-L313)
Alias for [`set_antialiased`](#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased").
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L375-L380)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**scalar or None
*alpha* must be within the 0-1 range, inclusive.
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L302-L313)
Set whether to use antialiased rendering.
Parameters:
**aa**bool or None
set\_capstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L454-L468)
Set the [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle").
The default capstyle is 'round' for [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") and 'butt' for all other patches.
Parameters:
**s**[`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L359-L373)
Set both the edgecolor and the facecolor.
Parameters:
**c**color
See also
[`Patch.set_facecolor`](#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor"), [`Patch.set_edgecolor`](#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor")
For setting the edge or face color individually.
set\_ec(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L330-L339)
Alias for [`set_edgecolor`](#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor").
set\_edgecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L330-L339)
Set the patch edge color.
Parameters:
**color**color or None
set\_facecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L348-L357)
Set the patch face color.
Parameters:
**color**color or None
set\_fc(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L348-L357)
Alias for [`set_facecolor`](#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor").
set\_fill(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L432-L443)
Set whether to fill the patch.
Parameters:
**b**bool
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L494-L525)
Set the hatching pattern.
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_joinstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L474-L488)
Set the [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle").
The default joinstyle is 'round' for [`FancyArrowPatch`](matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch") and 'miter' for all other patches.
Parameters:
**s**[`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L397-L430)
Set the patch linestyle.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
| `'none'`, `'None'`, `' '`, or `''` | draw nothing |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq)
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
The line style.
set\_linewidth(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L382-L395)
Set the patch linewidth in points.
Parameters:
**w**float or None
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L397-L430)
Alias for [`set_linestyle`](#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle").
set\_lw(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L382-L395)
Alias for [`set_linewidth`](#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth").
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L235-L252)
Copy properties from *other* to *self*.
zorder*=1*
Examples using `matplotlib.patches.Patch`
-----------------------------------------
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Controlling view limits using margins and sticky\_edges](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_margins.html#sphx-glr-gallery-subplots-axes-and-figures-axes-margins-py)
Controlling view limits using margins and sticky\_edges
[Axes Zoom Effect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_zoom_effect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-zoom-effect-py)
Axes Zoom Effect
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Text Rotation Mode](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_rotation_mode.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-rotation-mode-py)
Text Rotation Mode
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Text Layout](https://matplotlib.org/stable/gallery/pyplots/text_layout.html#sphx-glr-gallery-pyplots-text-layout-py)
Text Layout
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Compound path](https://matplotlib.org/stable/gallery/shapes_and_collections/compound_path.html#sphx-glr-gallery-shapes-and-collections-compound-path-py)
Compound path
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Hatch demo](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_demo.html#sphx-glr-gallery-shapes-and-collections-hatch-demo-py)
Hatch demo
[Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html#sphx-glr-gallery-shapes-and-collections-hatch-style-reference-py)
Hatch style reference
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[Bezier Curve](https://matplotlib.org/stable/gallery/shapes_and_collections/quad_bezier.html#sphx-glr-gallery-shapes-and-collections-quad-bezier-py)
Bezier Curve
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Grayscale style sheet](https://matplotlib.org/stable/gallery/style_sheets/grayscale.html#sphx-glr-gallery-style-sheets-grayscale-py)
Grayscale style sheet
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Firefox](https://matplotlib.org/stable/gallery/showcase/firefox.html#sphx-glr-gallery-showcase-firefox-py)
Firefox
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Trifinder Event Demo](https://matplotlib.org/stable/gallery/event_handling/trifinder_event_demo.html#sphx-glr-gallery-event-handling-trifinder-event-demo-py)
Trifinder Event Demo
[Viewlims](https://matplotlib.org/stable/gallery/event_handling/viewlims.html#sphx-glr-gallery-event-handling-viewlims-py)
Viewlims
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Changing colors of lines intersecting a box](https://matplotlib.org/stable/gallery/misc/bbox_intersect.html#sphx-glr-gallery-misc-bbox-intersect-py)
Changing colors of lines intersecting a box
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[SVG Filter Pie](https://matplotlib.org/stable/gallery/misc/svg_filter_pie.html#sphx-glr-gallery-misc-svg-filter-pie-py)
SVG Filter Pie
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Hinton diagrams](https://matplotlib.org/stable/gallery/specialty_plots/hinton_demo.html#sphx-glr-gallery-specialty-plots-hinton-demo-py)
Hinton diagrams
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Ellipse with units](https://matplotlib.org/stable/gallery/units/ellipse_with_units.html#sphx-glr-gallery-units-ellipse-with-units-py)
Ellipse with units
[Anchored Box04](https://matplotlib.org/stable/gallery/userdemo/anchored_box04.html#sphx-glr-gallery-userdemo-anchored-box04-py)
Anchored Box04
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Menu](https://matplotlib.org/stable/gallery/widgets/menu.html#sphx-glr-gallery-widgets-menu-py)
Menu
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Text properties and layout](https://matplotlib.org/stable/tutorials/text/text_props.html#sphx-glr-tutorials-text-text-props-py)
Text properties and layout
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
| programming_docs |
matplotlib matplotlib.axes.Axes.end_pan matplotlib.axes.Axes.end\_pan
=============================
Axes.end\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4219-L4227)
Called when a pan operation completes (when the mouse button is up.)
#### Notes
This is intended to be overridden by new projection types.
matplotlib mpl_toolkits.axisartist.axisline_style mpl\_toolkits.axisartist.axisline\_style
========================================
Classes
-------
| | |
| --- | --- |
| [`AxislineStyle`](mpl_toolkits.axisartist.axisline_style.axislinestyle#mpl_toolkits.axisartist.axisline_style.AxislineStyle "mpl_toolkits.axisartist.axisline_style.AxislineStyle")(stylename, \*\*kwargs) | A container class which defines style classes for AxisArtists. |
matplotlib matplotlib.axes.Axes.get_facecolor matplotlib.axes.Axes.get\_facecolor
===================================
Axes.get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1521-L1523)
Get the facecolor of the Axes.
matplotlib matplotlib.axis.Axis.get_tick_space matplotlib.axis.Axis.get\_tick\_space
=====================================
Axis.get\_tick\_space()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2092-L2095)
Return the estimated number of ticks that can fit on the axis.
matplotlib matplotlib.axes.Axes.hexbin matplotlib.axes.Axes.hexbin
===========================
Axes.hexbin(*x*, *y*, *C=None*, *gridsize=100*, *bins=None*, *xscale='linear'*, *yscale='linear'*, *extent=None*, *cmap=None*, *norm=None*, *vmin=None*, *vmax=None*, *alpha=None*, *linewidths=None*, *edgecolors='face'*, *reduce\_C\_function=<function mean>*, *mincnt=None*, *marginals=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L4644-L5009)
Make a 2D hexagonal binning plot of points *x*, *y*.
If *C* is *None*, the value of the hexagon is determined by the number of points in the hexagon. Otherwise, *C* specifies values at the coordinate (x[i], y[i]). For each hexagon, these values are reduced using *reduce\_C\_function*.
Parameters:
**x, y**array-like
The data positions. *x* and *y* must be of the same length.
**C**array-like, optional
If given, these values are accumulated in the bins. Otherwise, every point has a value of 1. Must be of the same length as *x* and *y*.
**gridsize**int or (int, int), default: 100
If a single int, the number of hexagons in the *x*-direction. The number of hexagons in the *y*-direction is chosen such that the hexagons are approximately regular.
Alternatively, if a tuple (*nx*, *ny*), the number of hexagons in the *x*-direction and the *y*-direction.
**bins**'log' or int or sequence, default: None
Discretization of the hexagon values.
* If *None*, no binning is applied; the color of each hexagon directly corresponds to its count value.
* If 'log', use a logarithmic scale for the colormap. Internally, \(log\_{10}(i+1)\) is used to determine the hexagon color. This is equivalent to `norm=LogNorm()`.
* If an integer, divide the counts in the specified number of bins, and color the hexagons accordingly.
* If a sequence of values, the values of the lower bound of the bins to be used.
**xscale**{'linear', 'log'}, default: 'linear'
Use a linear or log10 scale on the horizontal axis.
**yscale**{'linear', 'log'}, default: 'linear'
Use a linear or log10 scale on the vertical axis.
**mincnt**int > 0, default: *None*
If not *None*, only display cells with more than *mincnt* number of points in the cell.
**marginals**bool, default: *False*
If marginals is *True*, plot the marginal density as colormapped rectangles along the bottom of the x-axis and left of the y-axis.
**extent**4-tuple of float, default: *None*
The limits of the bins (xmin, xmax, ymin, ymax). The default assigns the limits based on *gridsize*, *x*, *y*, *xscale* and *yscale*.
If *xscale* or *yscale* is set to 'log', the limits are expected to be the exponent for a power of 10. E.g. for x-limits of 1 and 50 in 'linear' scale and y-limits of 10 and 1000 in 'log' scale, enter (1, 50, 1, 3).
Returns:
[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") defining the hexagonal bins.
* [`PolyCollection.get_offsets`](../collections_api#matplotlib.collections.PolyCollection.get_offsets "matplotlib.collections.PolyCollection.get_offsets") contains a Mx2 array containing the x, y positions of the M hexagon centers.
* [`PolyCollection.get_array`](../collections_api#matplotlib.collections.PolyCollection.get_array "matplotlib.collections.PolyCollection.get_array") contains the values of the M hexagons.
If *marginals* is *True*, horizontal bar and vertical bar (both PolyCollections) will be attached to the return collection as attributes *hbar* and *vbar*.
Other Parameters:
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
**alpha**float between 0 and 1, optional
The alpha blending value, between 0 (transparent) and 1 (opaque).
**linewidths**float, default: *None*
If *None*, defaults to 1.0.
**edgecolors**{'face', 'none', *None*} or color, default: 'face'
The color of the hexagon edges. Possible values are:
* 'face': Draw the edges in the same color as the fill color.
* 'none': No edges are drawn. This can sometimes lead to unsightly unpainted pixels between the hexagons.
* *None*: Draw outlines in the default color.
* An explicit color.
**reduce\_C\_function**callable, default: [`numpy.mean`](https://numpy.org/doc/stable/reference/generated/numpy.mean.html#numpy.mean "(in NumPy v1.23)")
The function to aggregate *C* within the bins. It is ignored if *C* is not given. This must have the signature:
```
def reduce_C_function(C: array) -> float
```
Commonly used functions are:
* [`numpy.mean`](https://numpy.org/doc/stable/reference/generated/numpy.mean.html#numpy.mean "(in NumPy v1.23)"): average of the points
* [`numpy.sum`](https://numpy.org/doc/stable/reference/generated/numpy.sum.html#numpy.sum "(in NumPy v1.23)"): integral of the point values
* [`numpy.amax`](https://numpy.org/doc/stable/reference/generated/numpy.amax.html#numpy.amax "(in NumPy v1.23)"): value taken from the largest point
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *C*
**\*\*kwargs**[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"):
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`hist2d`](matplotlib.axes.axes.hist2d#matplotlib.axes.Axes.hist2d "matplotlib.axes.Axes.hist2d")
2D histogram rectangular bins
Examples using `matplotlib.axes.Axes.hexbin`
--------------------------------------------
[Hexagonal binned plot](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html#sphx-glr-gallery-statistics-hexbin-demo-py)
Hexagonal binned plot
[hexbin(x, y, C)](https://matplotlib.org/stable/plot_types/stats/hexbin.html#sphx-glr-plot-types-stats-hexbin-py)
hexbin(x, y, C)
matplotlib mpl_toolkits.mplot3d.proj3d.rot_x mpl\_toolkits.mplot3d.proj3d.rot\_x
===================================
mpl\_toolkits.mplot3d.proj3d.rot\_x(*V*, *alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L184-L190)
matplotlib matplotlib.patches.Ellipse matplotlib.patches.Ellipse
==========================
*class*matplotlib.patches.Ellipse(*xy*, *width*, *height*, *\**, *angle=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1516-L1666)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A scale-free ellipse.
Parameters:
**xy**(float, float)
xy coordinates of ellipse centre.
**width**float
Total length (diameter) of horizontal axis.
**height**float
Total length (diameter) of vertical axis.
**angle**float, default: 0
Rotation in degrees anti-clockwise.
#### Notes
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*property*angle
Return the angle of the ellipse.
*property*center
Return the center of the ellipse.
get\_angle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1652-L1654)
Return the angle of the ellipse.
get\_center()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1599-L1601)
Return the center of the ellipse.
get\_corners()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1658-L1666)
Return the corners of the ellipse bounding box.
The bounding box orientation is moving anti-clockwise from the lower left corner defined before rotation.
get\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1635-L1637)
Return the height of the ellipse.
get\_patch\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1584-L1586)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1580-L1582)
Return the path of the ellipse.
get\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1616-L1620)
Return the width of the ellipse.
*property*height
Return the height of the ellipse.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *center=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](#matplotlib.patches.Ellipse.set_angle "matplotlib.patches.Ellipse.set_angle") | float |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`center`](#matplotlib.patches.Ellipse.set_center "matplotlib.patches.Ellipse.set_center") | (float, float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](#matplotlib.patches.Ellipse.set_height "matplotlib.patches.Ellipse.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.patches.Ellipse.set_width "matplotlib.patches.Ellipse.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_angle(*angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1641-L1650)
Set the angle of the ellipse.
Parameters:
**angle**float
set\_center(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1588-L1597)
Set the center of the ellipse.
Parameters:
**xy**(float, float)
set\_height(*height*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1624-L1633)
Set the height of the ellipse.
Parameters:
**height**float
set\_width(*width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1605-L1614)
Set the width of the ellipse.
Parameters:
**width**float
*property*width
Return the width of the ellipse.
Examples using `matplotlib.patches.Ellipse`
-------------------------------------------
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Hatch demo](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_demo.html#sphx-glr-gallery-shapes-and-collections-hatch-demo-py)
Hatch demo
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Grayscale style sheet](https://matplotlib.org/stable/gallery/style_sheets/grayscale.html#sphx-glr-gallery-style-sheets-grayscale-py)
Grayscale style sheet
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[Ellipse with units](https://matplotlib.org/stable/gallery/units/ellipse_with_units.html#sphx-glr-gallery-units-ellipse-with-units-py)
Ellipse with units
[Anchored Box04](https://matplotlib.org/stable/gallery/userdemo/anchored_box04.html#sphx-glr-gallery-userdemo-anchored-box04-py)
Anchored Box04
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
| programming_docs |
matplotlib matplotlib.pyplot.ylim matplotlib.pyplot.ylim
======================
matplotlib.pyplot.ylim(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1717-L1751)
Get or set the y-limits of the current axes.
Call signatures:
```
bottom, top = ylim() # return the current ylim
ylim((bottom, top)) # set the ylim to bottom, top
ylim(bottom, top) # set the ylim to bottom, top
```
If you do not specify args, you can alternatively pass *bottom* or *top* as kwargs, i.e.:
```
ylim(top=3) # adjust the top leaving bottom unchanged
ylim(bottom=1) # adjust the bottom leaving top unchanged
```
Setting limits turns autoscaling off for the y-axis.
Returns:
bottom, top
A tuple of the new y-axis limits.
#### Notes
Calling this function with no arguments (e.g. `ylim()`) is the pyplot equivalent of calling [`get_ylim`](matplotlib.axes.axes.get_ylim#matplotlib.axes.Axes.get_ylim "matplotlib.axes.Axes.get_ylim") on the current axes. Calling this function with arguments is the pyplot equivalent of calling [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") on the current axes. All arguments are passed though.
Examples using `matplotlib.pyplot.ylim`
---------------------------------------
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Frame grabbing](https://matplotlib.org/stable/gallery/animation/frame_grabbing_sgskip.html#sphx-glr-gallery-animation-frame-grabbing-sgskip-py)
Frame grabbing
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
matplotlib matplotlib.artist.Artist.set_transform matplotlib.artist.Artist.set\_transform
=======================================
Artist.set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
Examples using `matplotlib.artist.Artist.set_transform`
-------------------------------------------------------
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
matplotlib matplotlib.axes.Axes.fill matplotlib.axes.Axes.fill
=========================
Axes.fill(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5090-L5140)
Plot filled polygons.
Parameters:
**\*args**sequence of x, y, [color]
Each polygon is defined by the lists of *x* and *y* positions of its nodes, optionally followed by a *color* specifier. See [`matplotlib.colors`](../colors_api#module-matplotlib.colors "matplotlib.colors") for supported color specifiers. The standard color cycle is used for polygons without a color specifier.
You can plot multiple polygons by providing multiple *x*, *y*, *[color]* groups.
For example, each of the following is legal:
```
ax.fill(x, y) # a polygon with default color
ax.fill(x, y, "b") # a blue polygon
ax.fill(x, y, x2, y2) # two polygons
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
```
**data**indexable object, optional
An object with labelled data. If given, provide the label names to plot in *x* and *y*, e.g.:
```
ax.fill("time", "signal",
data={"time": [0, 1, 2], "signal": [0, 1, 0]})
```
Returns:
list of [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
#### Notes
Use [`fill_between()`](matplotlib.axes.axes.fill_between#matplotlib.axes.Axes.fill_between "matplotlib.axes.Axes.fill_between") if you would like to fill the region between two curves.
Examples using `matplotlib.axes.Axes.fill`
------------------------------------------
[Filled polygon](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py)
Filled polygon
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[Ellipse with units](https://matplotlib.org/stable/gallery/units/ellipse_with_units.html#sphx-glr-gallery-units-ellipse-with-units-py)
Ellipse with units
matplotlib mpl_toolkits.axisartist.angle_helper.ExtremeFinderCycle mpl\_toolkits.axisartist.angle\_helper.ExtremeFinderCycle
=========================================================
*class*mpl\_toolkits.axisartist.angle\_helper.ExtremeFinderCycle(*nx*, *ny*, *lon\_cycle=360.0*, *lat\_cycle=None*, *lon\_minmax=None*, *lat\_minmax=(-90, 90)*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L310-L394)
Bases: [`ExtremeFinderSimple`](mpl_toolkits.axisartist.grid_finder.extremefindersimple#mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple "mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple")
This subclass handles the case where one or both coordinates should be taken modulo 360, or be restricted to not exceed a specific range.
Parameters:
**nx, ny**int
The number of samples in each direction.
**lon\_cycle, lat\_cycle**360 or None
If not None, values in the corresponding direction are taken modulo *lon\_cycle* or *lat\_cycle*; in theory this can be any number but the implementation actually assumes that it is 360 (if not None); other values give nonsensical results.
This is done by "unwrapping" the transformed grid coordinates so that jumps are less than a half-cycle; then normalizing the span to no more than a full cycle.
For example, if values are in the union of the [0, 2] and [358, 360] intervals (typically, angles measured modulo 360), the values in the second interval are normalized to [-2, 0] instead so that the values now cover [-2, 2]. If values are in a range of [5, 1000], this gets normalized to [5, 365].
**lon\_minmax, lat\_minmax**(float, float) or None
If not None, the computed bounding box is clipped to the given range in the corresponding direction.
\_\_call\_\_(*transform\_xy*, *x1*, *y1*, *x2*, *y2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L350-L394)
Compute an approximation of the bounding box obtained by applying *transform\_xy* to the box delimited by `(x1, y1, x2, y2)`.
The intended use is to have `(x1, y1, x2, y2)` in axes coordinates, and have *transform\_xy* be the transform from axes coordinates to data coordinates; this method then returns the range of data coordinates that span the actual axes.
The computation is done by sampling `nx * ny` equispaced points in the `(x1, y1, x2, y2)` box and finding the resulting points with extremal coordinates; then adding some padding to take into account the finite sampling.
As each sampling step covers a relative range of *1/nx* or *1/ny*, the padding is computed by expanding the span covered by the extremal coordinates by these fractions.
Examples using `mpl_toolkits.axisartist.angle_helper.ExtremeFinderCycle`
------------------------------------------------------------------------
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Curvilinear grid demo](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid-py)
Curvilinear grid demo
[floating\_axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axis.html#sphx-glr-gallery-axisartist-demo-floating-axis-py)
floating\_axis demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
matplotlib matplotlib.artist.Artist.set_animated matplotlib.artist.Artist.set\_animated
======================================
Artist.set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](../figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](../animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
matplotlib mpl_toolkits.axisartist.angle_helper.LocatorDM mpl\_toolkits.axisartist.angle\_helper.LocatorDM
================================================
*class*mpl\_toolkits.axisartist.angle\_helper.LocatorDM(*nbins*, *include\_last=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L174-L177)
Bases: [`LocatorBase`](mpl_toolkits.axisartist.angle_helper.locatorbase#mpl_toolkits.axisartist.angle_helper.LocatorBase "mpl_toolkits.axisartist.angle_helper.LocatorBase")
\_\_call\_\_(*v1*, *v2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L175-L177)
Call self as a function.
matplotlib matplotlib.axis.Axis.set_pickradius matplotlib.axis.Axis.set\_pickradius
====================================
Axis.set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1824-L1836)
Set the depth of the axis used by the picker.
Parameters:
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
matplotlib matplotlib.axes.Axes.pcolorfast matplotlib.axes.Axes.pcolorfast
===============================
Axes.pcolorfast(*\*args*, *alpha=None*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L6168-L6352)
Create a pseudocolor plot with a non-regular rectangular grid.
Call signature:
```
ax.pcolorfast([X, Y], C, /, **kwargs)
```
This method is similar to [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") and [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh"). It's designed to provide the fastest pcolor-type plotting with the Agg backend. To achieve this, it uses different algorithms internally depending on the complexity of the input grid (regular rectangular, non-regular rectangular or arbitrary quadrilateral).
Warning
This method is experimental. Compared to [`pcolor`](matplotlib.axes.axes.pcolor#matplotlib.axes.Axes.pcolor "matplotlib.axes.Axes.pcolor") or [`pcolormesh`](matplotlib.axes.axes.pcolormesh#matplotlib.axes.Axes.pcolormesh "matplotlib.axes.Axes.pcolormesh") it has some limitations:
* It supports only flat shading (no outlines)
* It lacks support for log scaling of the axes.
* It does not have a have a pyplot wrapper.
Parameters:
**C**array-like
The image data. Supported array shapes are:
* (M, N): an image with scalar data. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
* (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
* (M, N, 4): an image with RGBA values (0-1 float or 0-255 int), i.e. including transparency.
The first two dimensions (M, N) define the rows and columns of the image.
This parameter can only be passed positionally.
**X, Y**tuple or array-like, default: `(0, N)`, `(0, M)`
*X* and *Y* are used to specify the coordinates of the quadrilaterals. There are different ways to do this:
* Use tuples `X=(xmin, xmax)` and `Y=(ymin, ymax)` to define a *uniform rectangular grid*.
The tuples define the outer edges of the grid. All individual quadrilaterals will be of the same size. This is the fastest version.
* Use 1D arrays *X*, *Y* to specify a *non-uniform rectangular grid*.
In this case *X* and *Y* have to be monotonic 1D arrays of length *N+1* and *M+1*, specifying the x and y boundaries of the cells.
The speed is intermediate. Note: The grid is checked, and if found to be uniform the fast version is used.
* Use 2D arrays *X*, *Y* if you need an *arbitrary quadrilateral grid* (i.e. if the quadrilaterals are not rectangular).
In this case *X* and *Y* are 2D arrays with shape (M + 1, N + 1), specifying the x and y coordinates of the corners of the colored quadrilaterals.
This is the most general, but the slowest to render. It may produce faster and more compact output using ps, pdf, and svg backends, however.
These arguments can only be passed positionally.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *C* is RGB(A).
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *C* is RGB(A).
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
This parameter is ignored if *C* is RGB(A).
**alpha**float, default: None
The alpha blending value, between 0 (transparent) and 1 (opaque).
**snap**bool, default: False
Whether to snap the mesh to pixel boundaries.
Returns:
[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") or [`PcolorImage`](../image_api#matplotlib.image.PcolorImage "matplotlib.image.PcolorImage") or [`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh")
The return type depends on the type of grid:
* [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") for a regular rectangular grid.
* [`PcolorImage`](../image_api#matplotlib.image.PcolorImage "matplotlib.image.PcolorImage") for a non-regular rectangular grid.
* [`QuadMesh`](../collections_api#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh") for a non-rectangular grid.
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**
Supported additional parameters depend on the type of grid. See return types of *image* for further description.
Examples using `matplotlib.axes.Axes.pcolorfast`
------------------------------------------------
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
matplotlib matplotlib.colors.is_color_like matplotlib.colors.is\_color\_like
=================================
matplotlib.colors.is\_color\_like(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L218-L228)
Return whether *c* can be interpreted as an RGB(A) color.
matplotlib matplotlib.patches.Annulus matplotlib.patches.Annulus
==========================
*class*matplotlib.patches.Annulus(*xy*, *r*, *width*, *angle=0.0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1669-L1853)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
An elliptical annulus.
Parameters:
**xy**(float, float)
xy coordinates of annulus centre.
**r**float or (float, float)
The radius, or semi-axes:
* If float: radius of the outer circle.
* If two floats: semi-major and -minor axes of outer ellipse.
**width**float
Width (thickness) of the annular ring. The width is measured inward from the outer ellipse so that for the inner ellipse the semi-axes are given by `r - width`. *width* must be less than or equal to the semi-minor axis.
**angle**float, default: 0
Rotation angle in degrees (anti-clockwise from the positive x-axis). Ignored for circular annuli (i.e., if *r* is a scalar).
**\*\*kwargs**
Keyword arguments control the [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*property*angle
Return the angle of the annulus.
*property*center
Return the center of the annulus.
get\_angle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1770-L1772)
Return the angle of the annulus.
get\_center()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1728-L1730)
Return the center of the annulus.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1850-L1853)
Return the path of this patch.
get\_radii()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1822-L1824)
Return the semi-major and semi-minor radii of the annulus.
get\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1752-L1754)
Return the width (thickness) of the annulus ring.
*property*radii
Return the semi-major and semi-minor radii of the annulus.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *center=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *radii=<UNSET>*, *rasterized=<UNSET>*, *semimajor=<UNSET>*, *semiminor=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](#matplotlib.patches.Annulus.set_angle "matplotlib.patches.Annulus.set_angle") | float |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`center`](#matplotlib.patches.Annulus.set_center "matplotlib.patches.Annulus.set_center") | (float, float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`radii`](#matplotlib.patches.Annulus.set_radii "matplotlib.patches.Annulus.set_radii") | float or (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`semimajor`](#matplotlib.patches.Annulus.set_semimajor "matplotlib.patches.Annulus.set_semimajor") | float |
| [`semiminor`](#matplotlib.patches.Annulus.set_semiminor "matplotlib.patches.Annulus.set_semiminor") | float |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.patches.Annulus.set_width "matplotlib.patches.Annulus.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_angle(*angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1758-L1768)
Set the tilt angle of the annulus.
Parameters:
**angle**float
set\_center(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1716-L1726)
Set the center of the annulus.
Parameters:
**xy**(float, float)
set\_radii(*r*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1800-L1820)
Set the semi-major (*a*) and semi-minor radii (*b*) of the annulus.
Parameters:
**r**float or (float, float)
The radius, or semi-axes:
* If float: radius of the outer circle.
* If two floats: semi-major and -minor axes of outer ellipse.
set\_semimajor(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1776-L1786)
Set the semi-major axis *a* of the annulus.
Parameters:
**a**float
set\_semiminor(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1788-L1798)
Set the semi-minor axis *b* of the annulus.
Parameters:
**b**float
set\_width(*width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1734-L1750)
Set the width (thickness) of the annulus ring.
The width is measured inwards from the outer ellipse.
Parameters:
**width**float
*property*width
Return the width (thickness) of the annulus ring.
| programming_docs |
matplotlib matplotlib.pyplot.acorr matplotlib.pyplot.acorr
=======================
matplotlib.pyplot.acorr(*x*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2275-L2278)
Plot the autocorrelation of *x*.
Parameters:
**x**array-like
**detrend**callable, default: [`mlab.detrend_none`](../mlab_api#matplotlib.mlab.detrend_none "matplotlib.mlab.detrend_none") (no detrending)
A detrending function applied to *x*. It must have the signature
```
detrend(x: np.ndarray) -> np.ndarray
```
**normed**bool, default: True
If `True`, input vectors are normalised to unit length.
**usevlines**bool, default: True
Determines the plot style.
If `True`, vertical lines are plotted from 0 to the acorr value using [`Axes.vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines"). Additionally, a horizontal line is plotted at y=0 using [`Axes.axhline`](matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline").
If `False`, markers are plotted at the acorr values using [`Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
**maxlags**int, default: 10
Number of lags to show. If `None`, will return all `2 * len(x) - 1` lags.
Returns:
**lags**array (length `2*maxlags+1`)
The lag vector.
**c**array (length `2*maxlags+1`)
The auto correlation vector.
**line**[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") or [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") added to the Axes of the correlation:
* [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") if *usevlines* is True.
* [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") if *usevlines* is False.
**b**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") or None
Horizontal line at 0 if *usevlines* is True None *usevlines* is False.
Other Parameters:
**linestyle**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") property, optional
The linestyle for plotting the data points. Only used if *usevlines* is `False`.
**marker**str, default: 'o'
The marker for plotting the data points. Only used if *usevlines* is `False`.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Additional parameters are passed to [`Axes.vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines") and [`Axes.axhline`](matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline") if *usevlines* is `True`; otherwise they are passed to [`Axes.plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
#### Notes
The cross correlation is performed with [`numpy.correlate`](https://numpy.org/doc/stable/reference/generated/numpy.correlate.html#numpy.correlate "(in NumPy v1.23)") with `mode = "full"`.
matplotlib mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable mpl\_toolkits.axes\_grid1.axes\_divider.make\_axes\_locatable
=============================================================
mpl\_toolkits.axes\_grid1.axes\_divider.make\_axes\_locatable(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L694-L699)
matplotlib matplotlib.axis.Tick.set_pad matplotlib.axis.Tick.set\_pad
=============================
Tick.set\_pad(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L264-L273)
Set the tick label pad in points
Parameters:
**val**float
matplotlib matplotlib.pyplot.spy matplotlib.pyplot.spy
=====================
matplotlib.pyplot.spy(*Z*, *precision=0*, *marker=None*, *markersize=None*, *aspect='equal'*, *origin='upper'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2817-L2825)
Plot the sparsity pattern of a 2D array.
This visualizes the non-zero values of the array.
Two plotting styles are available: image and marker. Both are available for full arrays, but only the marker style works for [`scipy.sparse.spmatrix`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix "(in SciPy v1.9.1)") instances.
**Image style**
If *marker* and *markersize* are *None*, [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") is used. Any extra remaining keyword arguments are passed to this method.
**Marker style**
If *Z* is a [`scipy.sparse.spmatrix`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix "(in SciPy v1.9.1)") or *marker* or *markersize* are *None*, a [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") object will be returned with the value of marker determining the marker type, and any remaining keyword arguments passed to [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
Parameters:
**Z**(M, N) array-like
The array to be plotted.
**precision**float or 'present', default: 0
If *precision* is 0, any non-zero value will be plotted. Otherwise, values of \(|Z| > precision\) will be plotted.
For [`scipy.sparse.spmatrix`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spmatrix.html#scipy.sparse.spmatrix "(in SciPy v1.9.1)") instances, you can also pass 'present'. In this case any value present in the array will be plotted, even if it is identically zero.
**aspect**{'equal', 'auto', None} or float, default: 'equal'
The aspect ratio of the Axes. This parameter is particularly relevant for images since it determines whether data pixels are square.
This parameter is a shortcut for explicitly calling [`Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect"). See there for further details.
* 'equal': Ensures an aspect ratio of 1. Pixels will be square.
* 'auto': The Axes is kept fixed and the aspect is adjusted so that the data fit in the Axes. In general, this will result in non-square pixels.
* *None*: Use `[rcParams["image.aspect"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.aspect#matplotlibrc-sample)` (default: `'equal'`).
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Place the [0, 0] index of the array in the upper left or lower left corner of the Axes. The convention 'upper' is typically used for matrices and images.
Returns:
[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") or [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The return type depends on the plotting style (see above).
Other Parameters:
**\*\*kwargs**
The supported additional parameters depend on the plotting style.
For the image style, you can pass the following additional parameters of [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow"):
* *cmap*
* *alpha*
* *url*
* any [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties (passed on to the [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"))
For the marker style, you can pass any [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") property except for *linestyle*:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib mpl_toolkits.mplot3d.proj3d.proj_trans_points mpl\_toolkits.mplot3d.proj3d.proj\_trans\_points
================================================
mpl\_toolkits.mplot3d.proj3d.proj\_trans\_points(*points*, *M*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L179-L181)
matplotlib matplotlib.animation.ImageMagickWriter matplotlib.animation.ImageMagickWriter
======================================
*class*matplotlib.animation.ImageMagickWriter(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L660-L669)
Pipe-based animated gif.
Frames are streamed directly to ImageMagick via a pipe and written in a single pass.
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
\_\_init\_\_(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L263-L297)
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.ImageMagickWriter.__init__ "matplotlib.animation.ImageMagickWriter.__init__")([fps, codec, bitrate, extra\_args, ...]) | Parameters:
|
| `bin_path`() | Return the binary path to the commandline tool used by a specific subclass. |
| `finish`() | Finish any processing for writing the movie. |
| `grab_frame`(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| `isAvailable`() | Return whether a MovieWriter subclass is actually available. |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| `setup`(fig, outfile[, dpi]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| `delay` | |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
| [`input_names`](#matplotlib.animation.ImageMagickWriter.input_names "matplotlib.animation.ImageMagickWriter.input_names") | |
| `output_args` | |
| `supported_formats` | |
input\_names*='-'*
| programming_docs |
matplotlib matplotlib.axis.Axis.get_tightbbox matplotlib.axis.Axis.get\_tightbbox
===================================
Axis.get\_tightbbox(*renderer=None*, *\**, *for\_layout\_only=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1237-L1286)
Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.
If *for\_layout\_only* is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained\_layout to ignore too-long labels when doing their layout.
matplotlib matplotlib.axes.Axes.get_xaxis matplotlib.axes.Axes.get\_xaxis
===============================
Axes.get\_xaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2162-L2171)
[*Discouraged*] Return the XAxis instance.
Discouraged
The use of this function is discouraged. You should instead directly access the attribute `ax.xaxis`.
matplotlib matplotlib.axis.Axis.get_minor_ticks matplotlib.axis.Axis.get\_minor\_ticks
======================================
Axis.get\_minor\_ticks(*numticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1540-L1551)
Return the list of minor [`Tick`](../axis_api#matplotlib.axis.Tick "matplotlib.axis.Tick")s.
matplotlib matplotlib.patches.FancyBboxPatch matplotlib.patches.FancyBboxPatch
=================================
*class*matplotlib.patches.FancyBboxPatch(*xy*, *width*, *height*, *boxstyle='round'*, *bbox\_transmuter=<deprecated parameter>*, *\**, *mutation\_scale=1*, *mutation\_aspect=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3838-L4119)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A fancy box around a rectangle with lower left at *xy* = (*x*, *y*) with specified width and height.
[`FancyBboxPatch`](#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") is similar to [`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle"), but it draws a fancy box around the rectangle. The transformation of the rectangle box to the fancy box is delegated to the style classes defined in [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle").
Parameters:
**xy**float, float
The lower left corner of the box.
**width**float
The width of the box.
**height**float
The height of the box.
**boxstyle**str or [`matplotlib.patches.BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle")
The style of the fancy box. This can either be a [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") instance or a string of the style name and optionally comma separated attributes (e.g. "Round, pad=0.2"). This string is passed to [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") to construct a [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") object. See there for a full documentation.
The following box styles are available:
| Class | Name | Attrs |
| --- | --- | --- |
| Square | `square` | pad=0.3 |
| Circle | `circle` | pad=0.3 |
| LArrow | `larrow` | pad=0.3 |
| RArrow | `rarrow` | pad=0.3 |
| DArrow | `darrow` | pad=0.3 |
| Round | `round` | pad=0.3, rounding\_size=None |
| Round4 | `round4` | pad=0.3, rounding\_size=None |
| Sawtooth | `sawtooth` | pad=0.3, tooth\_size=None |
| Roundtooth | `roundtooth` | pad=0.3, tooth\_size=None |
**mutation\_scale**float, default: 1
Scaling factor applied to the attributes of the box style (e.g. pad or rounding\_size).
**mutation\_aspect**float, default: 1
The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it. For example, this allows different horizontal and vertical padding.
Other Parameters:
**\*\*kwargs**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_bbox()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4116-L4119)
Return the [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
get\_boxstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3965-L3967)
Return the boxstyle object.
get\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4042-L4044)
Return the height of the rectangle.
get\_mutation\_aspect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3995-L3998)
Return the aspect ratio of the bbox mutation.
get\_mutation\_scale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3980-L3982)
Return the mutation scale.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4000-L4026)
Return the mutated path of the rectangle.
get\_width()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4038-L4040)
Return the width of the rectangle.
get\_x()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4030-L4032)
Return the left coord of the rectangle.
get\_y()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4034-L4036)
Return the bottom coord of the rectangle.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *bounds=<UNSET>*, *boxstyle=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *mutation\_aspect=<UNSET>*, *mutation\_scale=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](#matplotlib.patches.FancyBboxPatch.set_bounds "matplotlib.patches.FancyBboxPatch.set_bounds") | unknown |
| [`boxstyle`](#matplotlib.patches.FancyBboxPatch.set_boxstyle "matplotlib.patches.FancyBboxPatch.set_boxstyle") | [ 'square' | 'circle' | 'larrow' | 'rarrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ] |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](#matplotlib.patches.FancyBboxPatch.set_height "matplotlib.patches.FancyBboxPatch.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`mutation_aspect`](#matplotlib.patches.FancyBboxPatch.set_mutation_aspect "matplotlib.patches.FancyBboxPatch.set_mutation_aspect") | float |
| [`mutation_scale`](#matplotlib.patches.FancyBboxPatch.set_mutation_scale "matplotlib.patches.FancyBboxPatch.set_mutation_scale") | float |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.patches.FancyBboxPatch.set_width "matplotlib.patches.FancyBboxPatch.set_width") | float |
| [`x`](#matplotlib.patches.FancyBboxPatch.set_x "matplotlib.patches.FancyBboxPatch.set_x") | float |
| [`y`](#matplotlib.patches.FancyBboxPatch.set_y "matplotlib.patches.FancyBboxPatch.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_bounds(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4090-L4114)
Set the bounds of the rectangle.
Call signatures:
```
set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
```
Parameters:
**left, bottom**float
The coordinates of the bottom left corner of the rectangle.
**width, height**float
The width/height of the rectangle.
set\_boxstyle(*boxstyle=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3925-L3963)
Set the box style, possibly with further attributes.
Attributes from the previous box style are not reused.
Without argument (or with `boxstyle=None`), the available box styles are returned as a human-readable string.
Parameters:
**boxstyle**str or [`matplotlib.patches.BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle")
The style of the box: either a [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") instance, or a string, which is the style name and optionally comma separated attributes (e.g. "Round,pad=0.2"). Such a string is used to construct a [`BoxStyle`](matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") object, as documented in that class.
The following box styles are available:
| Class | Name | Attrs |
| --- | --- | --- |
| Square | `square` | pad=0.3 |
| Circle | `circle` | pad=0.3 |
| LArrow | `larrow` | pad=0.3 |
| RArrow | `rarrow` | pad=0.3 |
| DArrow | `darrow` | pad=0.3 |
| Round | `round` | pad=0.3, rounding\_size=None |
| Round4 | `round4` | pad=0.3, rounding\_size=None |
| Sawtooth | `sawtooth` | pad=0.3, tooth\_size=None |
| Roundtooth | `roundtooth` | pad=0.3, tooth\_size=None |
**\*\*kwargs**
Additional attributes for the box style. See the table above for supported parameters.
#### Examples
```
set_boxstyle("Round,pad=0.2")
set_boxstyle("round", pad=0.2)
```
set\_height(*h*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4079-L4088)
Set the rectangle height.
Parameters:
**h**float
set\_mutation\_aspect(*aspect*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3984-L3993)
Set the aspect ratio of the bbox mutation.
Parameters:
**aspect**float
set\_mutation\_scale(*scale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L3969-L3978)
Set the mutation scale.
Parameters:
**scale**float
set\_width(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4068-L4077)
Set the rectangle width.
Parameters:
**w**float
set\_x(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4046-L4055)
Set the left coord of the rectangle.
Parameters:
**x**float
set\_y(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L4057-L4066)
Set the bottom coord of the rectangle.
Parameters:
**y**float
Examples using `matplotlib.patches.FancyBboxPatch`
--------------------------------------------------
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
| programming_docs |
matplotlib matplotlib.axes.Axes.get_yaxis matplotlib.axes.Axes.get\_yaxis
===============================
Axes.get\_yaxis()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2173-L2182)
[*Discouraged*] Return the YAxis instance.
Discouraged
The use of this function is discouraged. You should instead directly access the attribute `ax.yaxis`.
matplotlib matplotlib.artist.Artist.get_rasterized matplotlib.artist.Artist.get\_rasterized
========================================
Artist.get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
matplotlib matplotlib.axis.Axis.set_units matplotlib.axis.Axis.set\_units
===============================
Axis.set\_units(*u*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1671-L1699)
Set the units for axis.
Parameters:
**u**units tag
#### Notes
The units of any shared axis will also be updated.
Examples using `matplotlib.axis.Axis.set_units`
-----------------------------------------------
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Group barchart with units](https://matplotlib.org/stable/gallery/units/bar_unit_demo.html#sphx-glr-gallery-units-bar-unit-demo-py)
Group barchart with units
[Unit handling](https://matplotlib.org/stable/gallery/units/units_scatter.html#sphx-glr-gallery-units-units-scatter-py)
Unit handling
matplotlib matplotlib.colors.ColorSequenceRegistry matplotlib.colors.ColorSequenceRegistry
=======================================
*class*matplotlib.colors.ColorSequenceRegistry[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L96-L197)
Bases: [`Mapping`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping "(in Python v3.10)")
Container for sequences of colors that are known to Matplotlib by name.
The universal registry instance is [`matplotlib.color_sequences`](../matplotlib_configuration_api#matplotlib.color_sequences "matplotlib.color_sequences"). There should be no need for users to instantiate [`ColorSequenceRegistry`](#matplotlib.colors.ColorSequenceRegistry "matplotlib.colors.ColorSequenceRegistry") themselves.
Read access uses a dict-like interface mapping names to lists of colors:
```
import matplotlib as mpl
cmap = mpl.color_sequences['tab10']
```
The returned lists are copies, so that their modification does not change the global definition of the color sequence.
Additional color sequences can be added via [`ColorSequenceRegistry.register`](#matplotlib.colors.ColorSequenceRegistry.register "matplotlib.colors.ColorSequenceRegistry.register"):
```
mpl.color_sequences.register('rgb', ['r', 'g', 'b'])
```
register(*name*, *color\_list*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L152-L184)
Register a new color sequence.
The color sequence registry stores a copy of the given *color\_list*, so that future changes to the original list do not affect the registered color sequence. Think of this as the registry taking a snapshot of *color\_list* at registration.
Parameters:
**name**str
The name for the color sequence.
**color\_list**list of colors
An iterable returning valid Matplotlib colors when iterating over. Note however that the returned color sequence will always be a list regardless of the input type.
unregister(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L186-L197)
Remove a sequence from the registry.
You cannot remove built-in color sequences.
If the name is not registered, returns with no error.
matplotlib matplotlib.axes.Axes.locator_params matplotlib.axes.Axes.locator\_params
====================================
Axes.locator\_params(*axis='both'*, *tight=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3316-L3355)
Control behavior of major tick locators.
Because the locator is involved in autoscaling, [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") is called automatically after the parameters are changed.
Parameters:
**axis**{'both', 'x', 'y'}, default: 'both'
The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three axes.)
**tight**bool or None, optional
Parameter passed to [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view"). Default is None, for no change.
Other Parameters:
**\*\*kwargs**
Remaining keyword arguments are passed to directly to the `set_params()` method of the locator. Supported keywords depend on the type of the locator. See for example [`set_params`](../ticker_api#matplotlib.ticker.MaxNLocator.set_params "matplotlib.ticker.MaxNLocator.set_params") for the [`ticker.MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator") used by default for linear.
#### Examples
When plotting small subplots, one might want to reduce the maximum number of ticks and use tight bounds, for example:
```
ax.locator_params(tight=True, nbins=4)
```
Examples using `matplotlib.axes.Axes.locator_params`
----------------------------------------------------
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.artist.Artist.get_transform matplotlib.artist.Artist.get\_transform
=======================================
Artist.get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
Examples using `matplotlib.artist.Artist.get_transform`
-------------------------------------------------------
[SVG Filter Line](https://matplotlib.org/stable/gallery/misc/svg_filter_line.html#sphx-glr-gallery-misc-svg-filter-line-py)
SVG Filter Line
matplotlib matplotlib.artist.Artist.get_figure matplotlib.artist.Artist.get\_figure
====================================
Artist.get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
matplotlib matplotlib.axes.Axes.set_navigate_mode matplotlib.axes.Axes.set\_navigate\_mode
========================================
Axes.set\_navigate\_mode(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4027-L4035)
Set the navigation toolbar button status.
Warning
This is not a user-API function.
matplotlib matplotlib.animation.PillowWriter matplotlib.animation.PillowWriter
=================================
*class*matplotlib.animation.PillowWriter(*fps=5*, *metadata=None*, *codec=None*, *bitrate=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L479-L499)
\_\_init\_\_(*fps=5*, *metadata=None*, *codec=None*, *bitrate=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L173-L179)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.PillowWriter.__init__ "matplotlib.animation.PillowWriter.__init__")([fps, metadata, codec, bitrate]) | |
| [`finish`](#matplotlib.animation.PillowWriter.finish "matplotlib.animation.PillowWriter.finish")() | Finish any processing for writing the movie. |
| [`grab_frame`](#matplotlib.animation.PillowWriter.grab_frame "matplotlib.animation.PillowWriter.grab_frame")(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| [`isAvailable`](#matplotlib.animation.PillowWriter.isAvailable "matplotlib.animation.PillowWriter.isAvailable")() | |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| [`setup`](#matplotlib.animation.PillowWriter.setup "matplotlib.animation.PillowWriter.setup")(fig, outfile[, dpi]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
finish()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L496-L499)
Finish any processing for writing the movie.
grab\_frame(*\*\*savefig\_kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L489-L494)
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *savefig\_kwargs* are passed on to the [`savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") call that saves the figure.
*classmethod*isAvailable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L481-L483)
setup(*fig*, *outfile*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L485-L487)
Setup for writing the movie file.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object that contains the information for frames.
**outfile**str
The filename of the resulting movie file.
**dpi**float, default: `fig.dpi`
The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file.
matplotlib matplotlib.axes.Axes.set matplotlib.axes.Axes.set
========================
Axes.set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.axes.Axes.set`
-----------------------------------------
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Simple Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py)
Simple Plot
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Creating multiple subplots using plt.subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-demo-py)
Creating multiple subplots using ``plt.subplots``
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Hexagonal binned plot](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html#sphx-glr-gallery-statistics-hexbin-demo-py)
Hexagonal binned plot
[Nested pie charts](https://matplotlib.org/stable/gallery/pie_and_polar_charts/nested_pie.html#sphx-glr-gallery-pie-and-polar-charts-nested-pie-py)
Nested pie charts
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Arrow Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/arrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-arrow-demo-py)
Arrow Demo
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Text Commands](https://matplotlib.org/stable/gallery/pyplots/text_commands.html#sphx-glr-gallery-pyplots-text-commands-py)
Text Commands
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Animated 3D random walk](https://matplotlib.org/stable/gallery/animation/random_walk.html#sphx-glr-gallery-animation-random-walk-py)
Animated 3D random walk
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Manual Contour](https://matplotlib.org/stable/gallery/misc/contour_manual.html#sphx-glr-gallery-misc-contour-manual-py)
Manual Contour
[Plotting with keywords](https://matplotlib.org/stable/gallery/misc/keyword_plotting.html#sphx-glr-gallery-misc-keyword-plotting-py)
Plotting with keywords
[3D box surface plot](https://matplotlib.org/stable/gallery/mplot3d/box3d.html#sphx-glr-gallery-mplot3d-box3d-py)
3D box surface plot
[Projecting contour profiles onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html#sphx-glr-gallery-mplot3d-contour3d-3-py)
Projecting contour profiles onto a graph
[Projecting filled contour onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contourf3d_2.html#sphx-glr-gallery-mplot3d-contourf3d-2-py)
Projecting filled contour onto a graph
[Generate polygons to fill under 3D line graph](https://matplotlib.org/stable/gallery/mplot3d/polys3d.html#sphx-glr-gallery-mplot3d-polys3d-py)
Generate polygons to fill under 3D line graph
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
[3D voxel / volumetric plot with rgb colors](https://matplotlib.org/stable/gallery/mplot3d/voxels_rgb.html#sphx-glr-gallery-mplot3d-voxels-rgb-py)
3D voxel / volumetric plot with rgb colors
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Connection styles for annotations](https://matplotlib.org/stable/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py)
Connection styles for annotations
[Nested GridSpecs](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec06.html#sphx-glr-gallery-userdemo-demo-gridspec06-py)
Nested GridSpecs
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Mouse Cursor](https://matplotlib.org/stable/gallery/widgets/mouse_cursor.html#sphx-glr-gallery-widgets-mouse-cursor-py)
Mouse Cursor
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[plot(x, y)](https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py)
plot(x, y)
[scatter(x, y)](https://matplotlib.org/stable/plot_types/basic/scatter_plot.html#sphx-glr-plot-types-basic-scatter-plot-py)
scatter(x, y)
[bar(x, height)](https://matplotlib.org/stable/plot_types/basic/bar.html#sphx-glr-plot-types-basic-bar-py)
bar(x, height)
[stem(x, y)](https://matplotlib.org/stable/plot_types/basic/stem.html#sphx-glr-plot-types-basic-stem-py)
stem(x, y)
[step(x, y)](https://matplotlib.org/stable/plot_types/basic/step.html#sphx-glr-plot-types-basic-step-py)
step(x, y)
[fill\_between(x, y1, y2)](https://matplotlib.org/stable/plot_types/basic/fill_between.html#sphx-glr-plot-types-basic-fill-between-py)
fill\_between(x, y1, y2)
[stackplot(x, y)](https://matplotlib.org/stable/plot_types/basic/stackplot.html#sphx-glr-plot-types-basic-stackplot-py)
stackplot(x, y)
[barbs(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/barbs.html#sphx-glr-plot-types-arrays-barbs-py)
barbs(X, Y, U, V)
[quiver(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/quiver.html#sphx-glr-plot-types-arrays-quiver-py)
quiver(X, Y, U, V)
[hist(x)](https://matplotlib.org/stable/plot_types/stats/hist_plot.html#sphx-glr-plot-types-stats-hist-plot-py)
hist(x)
[boxplot(X)](https://matplotlib.org/stable/plot_types/stats/boxplot_plot.html#sphx-glr-plot-types-stats-boxplot-plot-py)
boxplot(X)
[errorbar(x, y, yerr, xerr)](https://matplotlib.org/stable/plot_types/stats/errorbar_plot.html#sphx-glr-plot-types-stats-errorbar-plot-py)
errorbar(x, y, yerr, xerr)
[violinplot(D)](https://matplotlib.org/stable/plot_types/stats/violin.html#sphx-glr-plot-types-stats-violin-py)
violinplot(D)
[eventplot(D)](https://matplotlib.org/stable/plot_types/stats/eventplot.html#sphx-glr-plot-types-stats-eventplot-py)
eventplot(D)
[hist2d(x, y)](https://matplotlib.org/stable/plot_types/stats/hist2d.html#sphx-glr-plot-types-stats-hist2d-py)
hist2d(x, y)
[hexbin(x, y, C)](https://matplotlib.org/stable/plot_types/stats/hexbin.html#sphx-glr-plot-types-stats-hexbin-py)
hexbin(x, y, C)
[pie(x)](https://matplotlib.org/stable/plot_types/stats/pie.html#sphx-glr-plot-types-stats-pie-py)
pie(x)
[tricontour(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontour.html#sphx-glr-plot-types-unstructured-tricontour-py)
tricontour(x, y, z)
[tricontourf(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py)
tricontourf(x, y, z)
[tripcolor(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tripcolor.html#sphx-glr-plot-types-unstructured-tripcolor-py)
tripcolor(x, y, z)
[triplot(x, y)](https://matplotlib.org/stable/plot_types/unstructured/triplot.html#sphx-glr-plot-types-unstructured-triplot-py)
triplot(x, y)
| programming_docs |
matplotlib matplotlib.axes.Axes.axvline matplotlib.axes.Axes.axvline
============================
Axes.axvline(*x=0*, *ymin=0*, *ymax=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L767-L833)
Add a vertical line across the Axes.
Parameters:
**x**float, default: 0
x position in data coordinates of the vertical line.
**ymin**float, default: 0
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
**ymax**float, default: 1
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
Returns:
[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Other Parameters:
**\*\*kwargs**
Valid keyword arguments are [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties, with the exception of 'transform':
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`vlines`](matplotlib.axes.axes.vlines#matplotlib.axes.Axes.vlines "matplotlib.axes.Axes.vlines")
Add vertical lines in data coordinates.
[`axvspan`](matplotlib.axes.axes.axvspan#matplotlib.axes.Axes.axvspan "matplotlib.axes.Axes.axvspan")
Add a vertical span (rectangle) across the axis.
[`axline`](matplotlib.axes.axes.axline#matplotlib.axes.Axes.axline "matplotlib.axes.Axes.axline")
Add a line with an arbitrary slope.
#### Examples
* draw a thick red vline at *x* = 0 that spans the yrange:
```
>>> axvline(linewidth=4, color='r')
```
* draw a default vline at *x* = 1 that spans the yrange:
```
>>> axvline(x=1)
```
* draw a default vline at *x* = .5 that spans the middle half of the yrange:
```
>>> axvline(x=.5, ymin=0.25, ymax=0.75)
```
Examples using `matplotlib.axes.Axes.axvline`
---------------------------------------------
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib matplotlib.pyplot.imread matplotlib.pyplot.imread
========================
matplotlib.pyplot.imread(*fname*, *format=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2109-L2111)
Read an image from a file into an array.
Note
This function exists for historical reasons. It is recommended to use [`PIL.Image.open`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open "(in Pillow (PIL Fork) v9.2.0)") instead for loading images.
Parameters:
**fname**str or file-like
The image file to read: a filename, a URL or a file-like object opened in read-binary mode.
Passing a URL is deprecated. Please open the URL for reading and pass the result to Pillow, e.g. with `np.array(PIL.Image.open(urllib.request.urlopen(url)))`.
**format**str, optional
The image file format assumed for reading the data. The image is loaded as a PNG file if *format* is set to "png", if *fname* is a path or opened file with a ".png" extension, or if it is an URL. In all other cases, *format* is ignored and the format is auto-detected by [`PIL.Image.open`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open "(in Pillow (PIL Fork) v9.2.0)").
Returns:
[`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array "(in NumPy v1.23)")
The image data. The returned array has shape
* (M, N) for grayscale images.
* (M, N, 3) for RGB images.
* (M, N, 4) for RGBA images.
PNG images are returned as float arrays (0-1). All other formats are returned as int arrays, with a bit depth determined by the file's contents.
Examples using `matplotlib.pyplot.imread`
-----------------------------------------
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Convert texts to images](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_asarray.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-asarray-py)
Convert texts to images
[Ribbon Box](https://matplotlib.org/stable/gallery/misc/demo_ribbon_box.html#sphx-glr-gallery-misc-demo-ribbon-box-py)
Ribbon Box
matplotlib matplotlib.axis.YAxis.set_label_position matplotlib.axis.YAxis.set\_label\_position
==========================================
YAxis.set\_label\_position(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2481-L2494)
Set the label position (left or right)
Parameters:
**position**{'left', 'right'}
matplotlib matplotlib.artist.Artist.remove matplotlib.artist.Artist.remove
===============================
Artist.remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](../backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
Examples using `matplotlib.artist.Artist.remove`
------------------------------------------------
[Combining two subplots using subplots and GridSpec](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_and_subplots.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-and-subplots-py)
Combining two subplots using subplots and GridSpec
[Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html#sphx-glr-gallery-subplots-axes-and-figures-subfigures-py)
Figure subfigures
matplotlib matplotlib.artist.Artist.get_visible matplotlib.artist.Artist.get\_visible
=====================================
Artist.get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
Examples using `matplotlib.artist.Artist.get_visible`
-----------------------------------------------------
[Keypress event](https://matplotlib.org/stable/gallery/event_handling/keypress_demo.html#sphx-glr-gallery-event-handling-keypress-demo-py)
Keypress event
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
matplotlib matplotlib.patches.FancyArrow matplotlib.patches.FancyArrow
=============================
*class*matplotlib.patches.FancyArrow(*x*, *y*, *dx*, *dy*, *\**, *width=0.001*, *length\_includes\_head=False*, *head\_width=None*, *head\_length=None*, *shape='full'*, *overhang=0*, *head\_starts\_at\_zero=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1316-L1482)
Bases: [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Like Arrow, but lets you set head width and head height independently.
Parameters:
**x, y**float
The x and y coordinates of the arrow base.
**dx, dy**float
The length of the arrow along x and y direction.
**width**float, default: 0.001
Width of full arrow tail.
**length\_includes\_head**bool, default: False
True if head is to be counted in calculating the length.
**head\_width**float or None, default: 3\*width
Total width of the full arrow head.
**head\_length**float or None, default: 1.5\*head\_width
Length of arrow head.
**shape**{'full', 'left', 'right'}, default: 'full'
Draw the left-half, right-half, or full arrow.
**overhang**float, default: 0
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
**head\_starts\_at\_zero**bool, default: False
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
**\*\*kwargs**
[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *closed=<UNSET>*, *color=<UNSET>*, *data=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xy=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`closed`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_closed "matplotlib.patches.Polygon.set_closed") | bool |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`data`](#matplotlib.patches.FancyArrow.set_data "matplotlib.patches.FancyArrow.set_data") | unknown |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xy`](matplotlib.patches.polygon#matplotlib.patches.Polygon.set_xy "matplotlib.patches.Polygon.set_xy") | (N, 2) array-like |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_data(*\**, *x=None*, *y=None*, *dx=None*, *dy=None*, *width=None*, *head\_width=None*, *head\_length=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1382-L1420)
Set [`FancyArrow`](#matplotlib.patches.FancyArrow "matplotlib.patches.FancyArrow") x, y, dx, dy, width, head\_with, and head\_length. Values left as None will not be updated.
Parameters:
**x, y**float or None, default: None
The x and y coordinates of the arrow base.
**dx, dy**float or None, default: None
The length of the arrow along x and y direction.
**width**float or None, default: None
Width of full arrow tail.
**head\_width**float or None, default: None
Total width of the full arrow head.
**head\_length**float or None, default: None
Length of arrow head.
Examples using `matplotlib.patches.FancyArrow`
----------------------------------------------
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
| programming_docs |
matplotlib matplotlib.artist.Artist.get_snap matplotlib.artist.Artist.get\_snap
==================================
Artist.get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") for details.
matplotlib matplotlib.pyplot.rc_context matplotlib.pyplot.rc\_context
=============================
matplotlib.pyplot.rc\_context(*rc=None*, *fname=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L555-L557)
Return a context manager for temporarily changing rcParams.
The `[rcParams["backend"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=backend#matplotlibrc-sample)` will not be reset by the context manager.
Parameters:
**rc**dict
The rcParams to temporarily set.
**fname**str or path-like
A file with Matplotlib rc settings. If both *fname* and *rc* are given, settings from *rc* take precedence.
See also
[The matplotlibrc file](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files)
#### Examples
Passing explicit values via a dict:
```
with mpl.rc_context({'interactive': False}):
fig, ax = plt.subplots()
ax.plot(range(3), range(3))
fig.savefig('example.png')
plt.close(fig)
```
Loading settings from a file:
```
with mpl.rc_context(fname='print.rc'):
plt.plot(x, y) # uses 'print.rc'
```
Examples using `matplotlib.pyplot.rc_context`
---------------------------------------------
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
matplotlib matplotlib.pyplot.pie matplotlib.pyplot.pie
=====================
matplotlib.pyplot.pie(*x*, *explode=None*, *labels=None*, *colors=None*, *autopct=None*, *pctdistance=0.6*, *shadow=False*, *labeldistance=1.1*, *startangle=0*, *radius=1*, *counterclock=True*, *wedgeprops=None*, *textprops=None*, *center=(0, 0)*, *frame=False*, *rotatelabels=False*, *\**, *normalize=True*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2708-L2722)
Plot a pie chart.
Make a pie chart of array *x*. The fractional area of each wedge is given by `x/sum(x)`.
The wedges are plotted counterclockwise, by default starting from the x-axis.
Parameters:
**x**1D array-like
The wedge sizes.
**explode**array-like, default: None
If not *None*, is a `len(x)` array which specifies the fraction of the radius with which to offset each wedge.
**labels**list, default: None
A sequence of strings providing the labels for each wedge
**colors**array-like, default: None
A sequence of colors through which the pie chart will cycle. If *None*, will use the colors in the currently active cycle.
**autopct**None or str or callable, default: None
If not *None*, is a string or function used to label the wedges with their numeric value. The label will be placed inside the wedge. If it is a format string, the label will be `fmt % pct`. If it is a function, it will be called.
**pctdistance**float, default: 0.6
The ratio between the center of each pie slice and the start of the text generated by *autopct*. Ignored if *autopct* is *None*.
**shadow**bool, default: False
Draw a shadow beneath the pie.
**normalize**bool, default: True
When *True*, always make a full pie by normalizing x so that `sum(x) == 1`. *False* makes a partial pie if `sum(x) <= 1` and raises a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)") for `sum(x) > 1`.
**labeldistance**float or None, default: 1.1
The radial distance at which the pie labels are drawn. If set to `None`, label are not drawn, but are stored for use in `legend()`
**startangle**float, default: 0 degrees
The angle by which the start of the pie is rotated, counterclockwise from the x-axis.
**radius**float, default: 1
The radius of the pie.
**counterclock**bool, default: True
Specify fractions direction, clockwise or counterclockwise.
**wedgeprops**dict, default: None
Dict of arguments passed to the wedge objects making the pie. For example, you can pass in `wedgeprops = {'linewidth': 3}` to set the width of the wedge border lines equal to 3. For more details, look at the doc/arguments of the wedge object. By default `clip_on=False`.
**textprops**dict, default: None
Dict of arguments to pass to the text objects.
**center**(float, float), default: (0, 0)
The coordinates of the center of the chart.
**frame**bool, default: False
Plot Axes frame with the chart if true.
**rotatelabels**bool, default: False
Rotate each label to the angle of the corresponding slice if true.
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *explode*, *labels*, *colors*
Returns:
**patches**list
A sequence of [`matplotlib.patches.Wedge`](matplotlib.patches.wedge#matplotlib.patches.Wedge "matplotlib.patches.Wedge") instances
**texts**list
A list of the label [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instances.
**autotexts**list
A list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instances for the numeric labels. This will only be returned if the parameter *autopct* is not *None*.
#### Notes
The pie chart will probably look best if the figure and Axes are square, or the Axes aspect is equal. This method sets the aspect ratio of the axis to "equal". The Axes aspect ratio can be controlled with [`Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect").
matplotlib matplotlib.axes.Axes.ticklabel_format matplotlib.axes.Axes.ticklabel\_format
======================================
Axes.ticklabel\_format(*\**, *axis='both'*, *style=''*, *scilimits=None*, *useOffset=None*, *useLocale=None*, *useMathText=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3241-L3314)
Configure the [`ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") used by default for linear Axes.
If a parameter is not set, the corresponding property of the formatter is left unchanged.
Parameters:
**axis**{'x', 'y', 'both'}, default: 'both'
The axis to configure. Only major ticks are affected.
**style**{'sci', 'scientific', 'plain'}
Whether to use scientific notation. The formatter default is to use scientific notation.
**scilimits**pair of ints (m, n)
Scientific notation is used only for numbers outside the range 10m to 10n (and only if the formatter is configured to use scientific notation at all). Use (0, 0) to include all numbers. Use (m, m) where m != 0 to fix the order of magnitude to 10m. The formatter default is `[rcParams["axes.formatter.limits"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.limits#matplotlibrc-sample)` (default: `[-5, 6]`).
**useOffset**bool or float
If True, the offset is calculated as needed. If False, no offset is used. If a numeric value, it sets the offset. The formatter default is `[rcParams["axes.formatter.useoffset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.useoffset#matplotlibrc-sample)` (default: `True`).
**useLocale**bool
Whether to format the number using the current locale or using the C (English) locale. This affects e.g. the decimal separator. The formatter default is `[rcParams["axes.formatter.use\_locale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_locale#matplotlibrc-sample)` (default: `False`).
**useMathText**bool
Render the offset and scientific notation in mathtext. The formatter default is `[rcParams["axes.formatter.use\_mathtext"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#matplotlibrc-sample)` (default: `False`).
Raises:
AttributeError
If the current formatter is not a [`ScalarFormatter`](../ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter").
Examples using `matplotlib.axes.Axes.ticklabel_format`
------------------------------------------------------
[The default tick formatter](https://matplotlib.org/stable/gallery/ticks/scalarformatter.html#sphx-glr-gallery-ticks-scalarformatter-py)
The default tick formatter
matplotlib matplotlib.pyplot.minorticks_off matplotlib.pyplot.minorticks\_off
=================================
matplotlib.pyplot.minorticks\_off()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2659-L2661)
Remove minor ticks from the Axes.
matplotlib matplotlib.axes.Axes.set_xscale matplotlib.axes.Axes.set\_xscale
================================
Axes.set\_xscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the xaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](../scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](../scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](../scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](../scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](../scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](../scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](../scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
Examples using `matplotlib.axes.Axes.set_xscale`
------------------------------------------------
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Labeling ticks using engineering notation](https://matplotlib.org/stable/gallery/text_labels_and_annotations/engineering_formatter.html#sphx-glr-gallery-text-labels-and-annotations-engineering-formatter-py)
Labeling ticks using engineering notation
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
matplotlib matplotlib.axes.Axes.text matplotlib.axes.Axes.text
=========================
Axes.text(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L615-L681)
Add text to the Axes.
Add the text *s* to the Axes at location *x*, *y* in data coordinates.
Parameters:
**x, y**float
The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the *transform* parameter.
**s**str
The text.
**fontdict**dict, default: None
A dictionary to override the default text properties. If fontdict is None, the defaults are determined by [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams").
Returns:
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The created [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
#### Examples
Individual keyword arguments can be used to override any given parameter:
```
>>> text(x, y, s, fontsize=12)
```
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes:
```
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
... verticalalignment='center', transform=ax.transAxes)
```
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword *bbox*. *bbox* is a dictionary of [`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") properties. For example:
```
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
```
Examples using `matplotlib.axes.Axes.text`
------------------------------------------
[Marker reference](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html#sphx-glr-gallery-lines-bars-and-markers-marker-reference-py)
Marker reference
[BboxImage Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/demo_bboximage.html#sphx-glr-gallery-images-contours-and-fields-demo-bboximage-py)
BboxImage Demo
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Using accented text in Matplotlib](https://matplotlib.org/stable/gallery/text_labels_and_annotations/accented_text.html#sphx-glr-gallery-text-labels-and-annotations-accented-text-py)
Using accented text in Matplotlib
[Arrow Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/arrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-arrow-demo-py)
Arrow Demo
[Annotation arrow style reference](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fancyarrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-fancyarrow-demo-py)
Annotation arrow style reference
[Labelling subplots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/label_subplots.html#sphx-glr-gallery-text-labels-and-annotations-label-subplots-py)
Labelling subplots
[Mathtext](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_demo.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-demo-py)
Mathtext
[Math fontfamily](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_fontfamily_example.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-fontfamily-example-py)
Math fontfamily
[Multiline](https://matplotlib.org/stable/gallery/text_labels_and_annotations/multiline.html#sphx-glr-gallery-text-labels-and-annotations-multiline-py)
Multiline
[Placing text boxes](https://matplotlib.org/stable/gallery/text_labels_and_annotations/placing_text_boxes.html#sphx-glr-gallery-text-labels-and-annotations-placing-text-boxes-py)
Placing text boxes
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Text Rotation Relative To Line](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation_relative_to_line.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-relative-to-line-py)
Text Rotation Relative To Line
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Text watermark](https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html#sphx-glr-gallery-text-labels-and-annotations-watermark-text-py)
Text watermark
[Text Commands](https://matplotlib.org/stable/gallery/pyplots/text_commands.html#sphx-glr-gallery-pyplots-text-commands-py)
Text Commands
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html#sphx-glr-gallery-shapes-and-collections-hatch-style-reference-py)
Hatch style reference
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
 [The double pendulum problem](https://matplotlib.org/stable/gallery/animation/double_pendulum.html#sphx-glr-gallery-animation-double-pendulum-py)
The double pendulum problem
 [MATPLOTLIB UNCHAINED](https://matplotlib.org/stable/gallery/animation/unchained.html#sphx-glr-gallery-animation-unchained-py)
MATPLOTLIB \*\*UNCHAINED\*\*
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
[Pick Event Demo2](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo2.html#sphx-glr-gallery-event-handling-pick-event-demo2-py)
Pick Event Demo2
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html#sphx-glr-gallery-misc-rasterization-demo-py)
Rasterization for vector graphics
[Text annotations in 3D](https://matplotlib.org/stable/gallery/mplot3d/text3d.html#sphx-glr-gallery-mplot3d-text3d-py)
Text annotations in 3D
[Anscombe's quartet](https://matplotlib.org/stable/gallery/specialty_plots/anscombe.html#sphx-glr-gallery-specialty-plots-anscombe-py)
Anscombe's quartet
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
[Connection styles for annotations](https://matplotlib.org/stable/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py)
Connection styles for annotations
[Custom box styles](https://matplotlib.org/stable/gallery/userdemo/custom_boxstyle01.html#sphx-glr-gallery-userdemo-custom-boxstyle01-py)
Custom box styles
[PGF fonts](https://matplotlib.org/stable/gallery/userdemo/pgf_fonts.html#sphx-glr-gallery-userdemo-pgf-fonts-py)
PGF fonts
[PGF texsystem](https://matplotlib.org/stable/gallery/userdemo/pgf_texsystem.html#sphx-glr-gallery-userdemo-pgf-texsystem-py)
PGF texsystem
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Mouse Cursor](https://matplotlib.org/stable/gallery/widgets/mouse_cursor.html#sphx-glr-gallery-widgets-mouse-cursor-py)
Mouse Cursor
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
[Text properties and layout](https://matplotlib.org/stable/tutorials/text/text_props.html#sphx-glr-tutorials-text-text-props-py)
Text properties and layout
| programming_docs |
matplotlib matplotlib.colors.to_rgba matplotlib.colors.to\_rgba
==========================
matplotlib.colors.to\_rgba(*c*, *alpha=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L265-L304)
Convert *c* to an RGBA color.
Parameters:
**c**Matplotlib color or `np.ma.masked`
**alpha**float, optional
If *alpha* is given, force the alpha value of the returned RGBA tuple to *alpha*.
If None, the alpha value from *c* is used. If *c* does not have an alpha channel, then alpha defaults to 1.
*alpha* is ignored for the color value `"none"` (case-insensitive), which always maps to `(0, 0, 0, 0)`.
Returns:
tuple
Tuple of floats `(r, g, b, a)`, where each channel (red, green, blue, alpha) can assume values between 0 and 1.
Examples using `matplotlib.colors.to_rgba`
------------------------------------------
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html#sphx-glr-gallery-event-handling-lasso-demo-py)
Lasso Demo
[Ribbon Box](https://matplotlib.org/stable/gallery/misc/demo_ribbon_box.html#sphx-glr-gallery-misc-demo-ribbon-box-py)
Ribbon Box
matplotlib mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredAuxTransformBox
===================================================================
*class*mpl\_toolkits.axes\_grid1.anchored\_artists.AnchoredAuxTransformBox(*transform*, *loc*, *pad=0.4*, *borderpad=0.5*, *prop=None*, *frameon=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/anchored_artists.py#L72-L124)
Bases: [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox")
An anchored container with transformed coordinates.
Artists added to the *drawing\_area* are scaled according to the coordinates of the transformation used. The dimensions of this artist will scale to contain the artists added.
Parameters:
**transform**[`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transformation object for the coordinate system in use, i.e., `matplotlib.axes.Axes.transData`.
**loc**str
Location of this artist. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.4
Padding around the child objects, in fraction of the font size.
**borderpad**float, default: 0.5
Border padding, in fraction of the font size.
**prop**[`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"), optional
Font property used as a reference for paddings.
**frameon**bool, default: True
If True, draw a box around this artists.
**\*\*kwargs**
Keyword arguments forwarded to [`AnchoredOffsetbox`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
#### Examples
To display an ellipse in the upper left, with a width of 0.1 and height of 0.4 in data coordinates:
```
>>> box = AnchoredAuxTransformBox(ax.transData, loc='upper left')
>>> el = Ellipse((0, 0), width=0.1, height=0.4, angle=30)
>>> box.drawing_area.add_artist(el)
>>> ax.add_artist(box)
```
Attributes:
**drawing\_area**[`matplotlib.offsetbox.AuxTransformBox`](../offsetbox_api#matplotlib.offsetbox.AuxTransformBox "matplotlib.offsetbox.AuxTransformBox")
A container for artists to display.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](../offsetbox_api#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](../offsetbox_api#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox`
---------------------------------------------------------------------------------
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
matplotlib matplotlib.axis.XAxis.get_ticks_position matplotlib.axis.XAxis.get\_ticks\_position
==========================================
XAxis.get\_ticks\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2393-L2399)
Return the ticks position ("top", "bottom", "default", or "unknown").
matplotlib matplotlib.axes.SubplotBase matplotlib.axes.SubplotBase
===========================
*class*matplotlib.axes.SubplotBase(*fig*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_subplots.py#L7-L111)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Base class for subplots, which are [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instances with additional methods to facilitate generating and manipulating a set of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") within a figure.
Parameters:
**fig**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**\*args**tuple (*nrows*, *ncols*, *index*) or int
The array of subplots in the figure has dimensions `(nrows,
ncols)`, and *index* is the index of the subplot being created. *index* starts at 1 in the upper left corner and increases to the right.
If *nrows*, *ncols*, and *index* are all single digit numbers, then *args* can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
**\*\*kwargs**
Keyword arguments are passed to the Axes (sub)class constructor.
get\_gridspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_subplots.py#L47-L49)
Return the [`GridSpec`](matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") instance associated with the subplot.
get\_subplotspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_subplots.py#L38-L40)
Return the [`SubplotSpec`](matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") instance associated with the subplot.
label\_outer()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_subplots.py#L51-L60)
Only show "outer" labels and tick labels.
x-labels are only kept for subplots on the last row (or first row, if labels are on the top side); y-labels only for subplots on the first column (or last column, if labels are on the right side).
set\_subplotspec(*subplotspec*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_subplots.py#L42-L45)
Set the [`SubplotSpec`](matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec"). instance associated with the subplot.
matplotlib matplotlib.axes.Axes.get_default_bbox_extra_artists matplotlib.axes.Axes.get\_default\_bbox\_extra\_artists
=======================================================
Axes.get\_default\_bbox\_extra\_artists()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4339-L4369)
Return a default list of artists that are used for the bounding box calculation.
Artists are excluded either by not being visible or `artist.set_in_layout(False)`.
matplotlib mpl_toolkits.axes_grid1.axes_divider.HBoxDivider mpl\_toolkits.axes\_grid1.axes\_divider.HBoxDivider
===================================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.HBoxDivider(*fig*, *\*args*, *horizontal=None*, *vertical=None*, *aspect=None*, *anchor='C'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L612-L652)
Bases: [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider")
A [`SubplotDivider`](mpl_toolkits.axes_grid1.axes_divider.subplotdivider#mpl_toolkits.axes_grid1.axes_divider.SubplotDivider "mpl_toolkits.axes_grid1.axes_divider.SubplotDivider") for laying out axes horizontally, while ensuring that they have equal heights.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.py), [png](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.png))
Parameters:
**fig**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**\*args**tuple (*nrows*, *ncols*, *index*) or int
The array of subplots in the figure has dimensions `(nrows,
ncols)`, and *index* is the index of the subplot being created. *index* starts at 1 in the upper left corner and increases to the right.
If *nrows*, *ncols*, and *index* are all single digit numbers, then *args* can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
locate(*nx*, *ny*, *nx1=None*, *ny1=None*, *axes=None*, *renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L636-L652)
Parameters:
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
**ny, ny1**int
Same as *nx* and *nx1*, but for row positions.
**axes**
**renderer**
new\_locator(*nx*, *nx1=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L622-L634)
Create a new [`AxesLocator`](mpl_toolkits.axes_grid1.axes_divider.axeslocator#mpl_toolkits.axes_grid1.axes_divider.AxesLocator "mpl_toolkits.axes_grid1.axes_divider.AxesLocator") for the specified cell.
Parameters:
**nx, nx1**int
Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise location of columns spanning between *nx* to *nx1* (but excluding *nx1*-th column) is specified.
Examples using `mpl_toolkits.axes_grid1.axes_divider.HBoxDivider`
-----------------------------------------------------------------
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
matplotlib mpl_toolkits.axisartist.floating_axes mpl\_toolkits.axisartist.floating\_axes
=======================================
An experimental support for curvilinear grid.
Classes
-------
| | |
| --- | --- |
| [`ExtremeFinderFixed`](mpl_toolkits.axisartist.floating_axes.extremefinderfixed#mpl_toolkits.axisartist.floating_axes.ExtremeFinderFixed "mpl_toolkits.axisartist.floating_axes.ExtremeFinderFixed")(extremes) | This subclass always returns the same bounding box. |
| [`FixedAxisArtistHelper`](mpl_toolkits.axisartist.floating_axes.fixedaxisartisthelper#mpl_toolkits.axisartist.floating_axes.FixedAxisArtistHelper "mpl_toolkits.axisartist.floating_axes.FixedAxisArtistHelper")(grid\_helper, side[, ...]) | nth\_coord = along which coordinate value varies. |
| [`FloatingAxes`](mpl_toolkits.axisartist.floating_axes.floatingaxes#mpl_toolkits.axisartist.floating_axes.FloatingAxes "mpl_toolkits.axisartist.floating_axes.FloatingAxes") | alias of `FloatingAxesHostAxes` |
| [`FloatingAxesBase`](mpl_toolkits.axisartist.floating_axes.floatingaxesbase#mpl_toolkits.axisartist.floating_axes.FloatingAxesBase "mpl_toolkits.axisartist.floating_axes.FloatingAxesBase")(\*args, grid\_helper, \*\*kwargs) | |
| [`FloatingAxisArtistHelper`](mpl_toolkits.axisartist.floating_axes.floatingaxisartisthelper#mpl_toolkits.axisartist.floating_axes.FloatingAxisArtistHelper "mpl_toolkits.axisartist.floating_axes.FloatingAxisArtistHelper")(grid\_helper, ...[, ...]) | nth\_coord = along which coordinate value varies. |
| [`GridHelperCurveLinear`](mpl_toolkits.axisartist.floating_axes.gridhelpercurvelinear#mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear "mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear")(aux\_trans, extremes[, ...]) | aux\_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate. |
Functions
---------
| | |
| --- | --- |
| [`floatingaxes_class_factory`](mpl_toolkits.axisartist.floating_axes.floatingaxes_class_factory#mpl_toolkits.axisartist.floating_axes.floatingaxes_class_factory "mpl_toolkits.axisartist.floating_axes.floatingaxes_class_factory")(axes\_class) | |
matplotlib matplotlib.pyplot.angle_spectrum matplotlib.pyplot.angle\_spectrum
=================================
matplotlib.pyplot.angle\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2282-L2288)
Plot the angle spectrum.
Compute the angle spectrum (wrapped phase spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data.
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the angle spectrum in radians (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`magnitude_spectrum`](matplotlib.pyplot.magnitude_spectrum#matplotlib.pyplot.magnitude_spectrum "matplotlib.pyplot.magnitude_spectrum")
Plots the magnitudes of the corresponding frequencies.
[`phase_spectrum`](matplotlib.pyplot.phase_spectrum#matplotlib.pyplot.phase_spectrum "matplotlib.pyplot.phase_spectrum")
Plots the unwrapped version of this function.
[`specgram`](matplotlib.pyplot.specgram#matplotlib.pyplot.specgram "matplotlib.pyplot.specgram")
Can plot the angle spectrum of segments within the signal in a colormap.
| programming_docs |
matplotlib mpl_toolkits.axes_grid1.axes_size.SizeFromFunc mpl\_toolkits.axes\_grid1.axes\_size.SizeFromFunc
=================================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.SizeFromFunc(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L242-L254)
Bases: `_Base`
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
get\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L247-L254)
matplotlib matplotlib.axis.Axis.get_label matplotlib.axis.Axis.get\_label
===============================
Axis.get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1331-L1333)
Return the axis label as a Text instance.
Examples using `matplotlib.axis.Axis.get_label`
-----------------------------------------------
[Parasite Simple](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py)
Parasite Simple
matplotlib matplotlib.axis.Axis.set_label_text matplotlib.axis.Axis.set\_label\_text
=====================================
Axis.set\_label\_text(*label*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1705-L1724)
Set the text value of the axis label.
Parameters:
**label**str
Text string.
**fontdict**dict
Text properties.
**\*\*kwargs**
Merged into fontdict.
matplotlib matplotlib.pyplot.scatter matplotlib.pyplot.scatter
=========================
matplotlib.pyplot.scatter(*x*, *y*, *s=None*, *c=None*, *marker=None*, *cmap=None*, *norm=None*, *vmin=None*, *vmax=None*, *alpha=None*, *linewidths=None*, *\**, *edgecolors=None*, *plotnonfinite=False*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2773-L2784)
A scatter plot of *y* vs. *x* with varying marker size and/or color.
Parameters:
**x, y**float or array-like, shape (n, )
The data positions.
**s**float or array-like, shape (n, ), optional
The marker size in points\*\*2. Default is `rcParams['lines.markersize'] ** 2`.
**c**array-like or list of colors or color, optional
The marker colors. Possible values:
* A scalar or sequence of n numbers to be mapped to colors using *cmap* and *norm*.
* A 2D array in which the rows are RGB or RGBA.
* A sequence of colors of length n.
* A single color format string.
Note that *c* should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for all points, use a 2D array with a single row. Otherwise, value- matching will have precedence in case of a size matching with *x* and *y*.
If you wish to specify a single color for all points prefer the *color* keyword argument.
Defaults to [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"). In that case the marker color is determined by the value of *color*, *facecolor* or *facecolors*. In case those are not specified or [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), the marker color is determined by the next color of the `Axes`' current "shape and fill" color cycle. This cycle defaults to `[rcParams["axes.prop\_cycle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.prop_cycle#matplotlibrc-sample)` (default: `cycler('color', ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])`).
**marker**[`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle"), default: `[rcParams["scatter.marker"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=scatter.marker#matplotlibrc-sample)` (default: `'o'`)
The marker style. *marker* can be either an instance of the class or the text shorthand for a particular marker. See [`matplotlib.markers`](../markers_api#module-matplotlib.markers "matplotlib.markers") for more information about marker styles.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *c* is RGB(A).
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *c* is RGB(A).
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
This parameter is ignored if *c* is RGB(A).
**alpha**float, default: None
The alpha blending value, between 0 (transparent) and 1 (opaque).
**linewidths**float or array-like, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The linewidth of the marker edges. Note: The default *edgecolors* is 'face'. You may want to change this as well.
**edgecolors**{'face', 'none', *None*} or color or sequence of color, default: `[rcParams["scatter.edgecolors"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=scatter.edgecolors#matplotlibrc-sample)` (default: `'face'`)
The edge color of the marker. Possible values:
* 'face': The edge color will always be the same as the face color.
* 'none': No patch boundary will be drawn.
* A color or sequence of colors.
For non-filled markers, *edgecolors* is ignored. Instead, the color is determined like with 'face', i.e. from *c*, *colors*, or *facecolors*.
**plotnonfinite**bool, default: False
Whether to plot points with nonfinite *c* (i.e. `inf`, `-inf` or `nan`). If `True` the points are drawn with the *bad* colormap color (see [`Colormap.set_bad`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_bad "matplotlib.colors.Colormap.set_bad")).
Returns:
[`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *s*, *linewidths*, *edgecolors*, *c*, *facecolor*, *facecolors*, *color*
**\*\*kwargs**[`Collection`](../collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection") properties
See also
[`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot")
To plot scatter plots when markers are identical in size and color.
#### Notes
* The [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") function will be faster for scatterplots where markers don't vary in size or color.
* Any or all of *x*, *y*, *s*, and *c* may be masked arrays, in which case all masks will be combined and only unmasked points will be plotted.
* Fundamentally, scatter works with 1D arrays; *x*, *y*, *s*, and *c* may be input as N-D arrays, but within scatter they will be flattened. The exception is *c*, which will be flattened only if its size matches the size of *x* and *y*.
Examples using `matplotlib.pyplot.scatter`
------------------------------------------
[Scatter Masked](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_masked.html#sphx-glr-gallery-lines-bars-and-markers-scatter-masked-py)
Scatter Masked
[Scatter plot](https://matplotlib.org/stable/gallery/shapes_and_collections/scatter.html#sphx-glr-gallery-shapes-and-collections-scatter-py)
Scatter plot
[Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html#sphx-glr-gallery-misc-hyperlinks-sgskip-py)
Hyperlinks
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
matplotlib matplotlib.artist.Artist.set_clip_path matplotlib.artist.Artist.set\_clip\_path
========================================
Artist.set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](../transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](../transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
Examples using `matplotlib.artist.Artist.set_clip_path`
-------------------------------------------------------
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
matplotlib matplotlib.patches.StepPatch matplotlib.patches.StepPatch
============================
*class*matplotlib.patches.StepPatch(*values*, *edges*, *\**, *orientation='vertical'*, *baseline=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L960-L1065)
Bases: [`PathPatch`](matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch")
A path patch describing a stepwise constant function.
By default the path is not closed and starts and stops at baseline value.
Parameters:
**values**array-like
The step heights.
**edges**array-like
The edge positions, with `len(edges) == len(vals) + 1`, between which the curve takes on vals values.
**orientation**{'vertical', 'horizontal'}, default: 'vertical'
The direction of the steps. Vertical means that *values* are along the y-axis, and edges are along the x-axis.
**baseline**float, array-like or None, default: 0
The bottom value of the bounding edges or when `fill=True`, position of lower edge. If *fill* is True or an array is passed to *baseline*, a closed path is drawn.
**Other valid keyword arguments are:**
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_data()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1040-L1043)
Get [`StepPatch`](#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch") values, edges and baseline as namedtuple.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *data=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`data`](#matplotlib.patches.StepPatch.set_data "matplotlib.patches.StepPatch.set_data") | 1D array-like or None |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path`](matplotlib.patches.pathpatch#matplotlib.patches.PathPatch.set_path "matplotlib.patches.PathPatch.set_path") | unknown |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_data(*values=None*, *edges=None*, *baseline=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L1045-L1065)
Set [`StepPatch`](#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch") values, edges and baseline.
Parameters:
**values**1D array-like or None
Will not update values, if passing None
**edges**1D array-like, optional
**baseline**float, 1D array-like or None
Examples using `matplotlib.patches.StepPatch`
---------------------------------------------
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
| programming_docs |
matplotlib matplotlib.axes.Axes.cla matplotlib.axes.Axes.cla
========================
Axes.cla()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L1349-L1356)
Clear the Axes.
matplotlib mpl_toolkits.axisartist.axis_artist.AxisLabel mpl\_toolkits.axisartist.axis\_artist.AxisLabel
===============================================
*class*mpl\_toolkits.axisartist.axis\_artist.AxisLabel(*\*args*, *axis\_direction='bottom'*, *axis=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L275-L379)
Bases: [`AttributeCopier`](mpl_toolkits.axisartist.axis_artist.attributecopier#mpl_toolkits.axisartist.axis_artist.AttributeCopier "mpl_toolkits.axisartist.axis_artist.AttributeCopier"), [`LabelBase`](mpl_toolkits.axisartist.axis_artist.labelbase#mpl_toolkits.axisartist.axis_artist.LabelBase "mpl_toolkits.axisartist.axis_artist.LabelBase")
Axis Label. Derived from Text. The position of the text is updated in the fly, so changing text position has no effect. Otherwise, the properties can be changed as a normal Text.
To change the pad between ticklabels and axis label, use set\_pad.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L359-L366)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L356-L357)
Return the color of the text.
get\_pad()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L300-L306)
Return the internal pad in points.
See [`set_pad`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.set_pad "mpl_toolkits.axisartist.axis_artist.AxisLabel.set_pad") for more details.
get\_ref\_artist()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L308-L310)
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
get\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L312-L316)
Return the text string.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L368-L379)
Return the [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
Parameters:
**renderer**Renderer, optional
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling [`get_window_extent`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.get_window_extent "mpl_toolkits.axisartist.axis_artist.AxisLabel.get_window_extent") before the first draw. In practice, it is usually easier to trigger a draw first, e.g. by calling [`draw_without_rendering`](../figure_api#matplotlib.figure.Figure.draw_without_rendering "matplotlib.figure.Figure.draw_without_rendering") or `plt.show()`.
**dpi**float, optional
The dpi value for computing the bbox, defaults to `self.figure.dpi` (*not* the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *axis\_direction=<UNSET>*, *backgroundcolor=<UNSET>*, *bbox=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *default\_alignment=<UNSET>*, *default\_angle=<UNSET>*, *fontfamily=<UNSET>*, *fontproperties=<UNSET>*, *fontsize=<UNSET>*, *fontstretch=<UNSET>*, *fontstyle=<UNSET>*, *fontvariant=<UNSET>*, *fontweight=<UNSET>*, *gid=<UNSET>*, *horizontalalignment=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linespacing=<UNSET>*, *math\_fontfamily=<UNSET>*, *mouseover=<UNSET>*, *multialignment=<UNSET>*, *pad=<UNSET>*, *parse\_math=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *rotation=<UNSET>*, *rotation\_mode=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *transform\_rotates\_text=<UNSET>*, *url=<UNSET>*, *usetex=<UNSET>*, *verticalalignment=<UNSET>*, *visible=<UNSET>*, *wrap=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`axis_direction`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.set_axis_direction "mpl_toolkits.axisartist.axis_artist.AxisLabel.set_axis_direction") | unknown |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`default_alignment`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.set_default_alignment "mpl_toolkits.axisartist.axis_artist.AxisLabel.set_default_alignment") | unknown |
| [`default_angle`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.set_default_angle "mpl_toolkits.axisartist.axis_artist.AxisLabel.set_default_angle") | unknown |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`pad`](#mpl_toolkits.axisartist.axis_artist.AxisLabel.set_pad "mpl_toolkits.axisartist.axis_artist.AxisLabel.set_pad") | unknown |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_axis\_direction(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L336-L354)
Adjust the text angle and text alignment of axis label according to the matplotlib convention.
| property | left | bottom | right | top |
| --- | --- | --- | --- | --- |
| axislabel angle | 180 | 0 | 0 | 180 |
| axislabel va | center | top | center | bottom |
| axislabel ha | right | center | right | center |
Note that the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
set\_default\_alignment(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L323-L326)
set\_default\_angle(*d*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L333-L334)
set\_pad(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axis_artist.py#L291-L298)
Set the internal pad in points.
The actual pad will be the sum of the internal pad and the external pad (the latter is set automatically by the AxisArtist).
matplotlib matplotlib.artist.Artist.set_sketch_params matplotlib.artist.Artist.set\_sketch\_params
============================================
Artist.set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
matplotlib matplotlib.colors.get_named_colors_mapping matplotlib.colors.get\_named\_colors\_mapping
=============================================
matplotlib.colors.get\_named\_colors\_mapping()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L91-L93)
Return the global mapping of names to named colors.
matplotlib matplotlib.animation.MovieWriter matplotlib.animation.MovieWriter
================================
*class*matplotlib.animation.MovieWriter(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L236-L376)
Base class for writing movies.
This is a base class for MovieWriter subclasses that write a movie frame data to a pipe. You cannot instantiate this class directly. See examples for how to use its subclasses.
Attributes:
**frame\_format**str
The format used in writing frame data, defaults to 'rgba'.
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure to capture data from. This must be provided by the sub-classes.
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
\_\_init\_\_(*fps=5*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L263-L297)
Parameters:
**fps**int, default: 5
Movie frame rate (per second).
**codec**str or None, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`)
The codec to use.
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.MovieWriter.__init__ "matplotlib.animation.MovieWriter.__init__")([fps, codec, bitrate, extra\_args, ...]) | Parameters:
|
| [`bin_path`](#matplotlib.animation.MovieWriter.bin_path "matplotlib.animation.MovieWriter.bin_path")() | Return the binary path to the commandline tool used by a specific subclass. |
| [`finish`](#matplotlib.animation.MovieWriter.finish "matplotlib.animation.MovieWriter.finish")() | Finish any processing for writing the movie. |
| [`grab_frame`](#matplotlib.animation.MovieWriter.grab_frame "matplotlib.animation.MovieWriter.grab_frame")(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| [`isAvailable`](#matplotlib.animation.MovieWriter.isAvailable "matplotlib.animation.MovieWriter.isAvailable")() | Return whether a MovieWriter subclass is actually available. |
| `saving`(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| [`setup`](#matplotlib.animation.MovieWriter.setup "matplotlib.animation.MovieWriter.setup")(fig, outfile[, dpi]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| `frame_size` | A tuple `(width, height)` in pixels of a movie frame. |
| [`supported_formats`](#matplotlib.animation.MovieWriter.supported_formats "matplotlib.animation.MovieWriter.supported_formats") | |
*classmethod*bin\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L364-L371)
Return the binary path to the commandline tool used by a specific subclass. This is a class method so that the tool can be looked for before making a particular MovieWriter subclass available.
finish()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L332-L348)
Finish any processing for writing the movie.
grab\_frame(*\*\*savefig\_kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L350-L358)
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *savefig\_kwargs* are passed on to the [`savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") call that saves the figure.
*classmethod*isAvailable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L373-L376)
Return whether a MovieWriter subclass is actually available.
setup(*fig*, *outfile*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L312-L318)
Setup for writing the movie file.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object that contains the information for frames.
**outfile**str
The filename of the resulting movie file.
**dpi**float, default: `fig.dpi`
The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file.
supported\_formats*=['rgba']*
| programming_docs |
matplotlib matplotlib.axis.Axis.get_label_position matplotlib.axis.Axis.get\_label\_position
=========================================
Axis.get\_label\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2134-L2138)
Return the label position (top or bottom)
matplotlib matplotlib.axes.Axes.imshow matplotlib.axes.Axes.imshow
===========================
Axes.imshow(*X*, *cmap=None*, *norm=None*, *\**, *aspect=None*, *interpolation=None*, *alpha=None*, *vmin=None*, *vmax=None*, *origin=None*, *extent=None*, *interpolation\_stage=None*, *filternorm=True*, *filterrad=4.0*, *resample=None*, *url=None*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L5366-L5585)
Display data as an image, i.e., on a 2D regular raster.
The input may either be actual RGB(A) data, or 2D scalar data, which will be rendered as a pseudocolor image. For displaying a grayscale image set up the colormapping using the parameters `cmap='gray', vmin=0, vmax=255`.
The number of pixels used to render an image is set by the Axes size and the *dpi* of the figure. This can lead to aliasing artifacts when the image is resampled because the displayed image size will usually not match the size of *X* (see [Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html)). The resampling can be controlled via the *interpolation* parameter and/or `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`).
Parameters:
**X**array-like or PIL image
The image data. Supported array shapes are:
* (M, N): an image with scalar data. The values are mapped to colors using normalization and a colormap. See parameters *norm*, *cmap*, *vmin*, *vmax*.
* (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
* (M, N, 4): an image with RGBA values (0-1 float or 0-255 int), i.e. including transparency.
The first two dimensions (M, N) define the rows and columns of the image.
Out-of-range RGB(A) values are clipped.
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *X* is RGB(A).
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *X* is RGB(A).
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
This parameter is ignored if *X* is RGB(A).
**aspect**{'equal', 'auto'} or float, default: `[rcParams["image.aspect"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.aspect#matplotlibrc-sample)` (default: `'equal'`)
The aspect ratio of the Axes. This parameter is particularly relevant for images since it determines whether data pixels are square.
This parameter is a shortcut for explicitly calling [`Axes.set_aspect`](matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect"). See there for further details.
* 'equal': Ensures an aspect ratio of 1. Pixels will be square (unless pixel sizes are explicitly made non-square in data coordinates using *extent*).
* 'auto': The Axes is kept fixed and the aspect is adjusted so that the data fit in the Axes. In general, this will result in non-square pixels.
**interpolation**str, default: `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`)
The interpolation method used.
Supported values are 'none', 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'blackman'.
If *interpolation* is 'none', then no interpolation is performed on the Agg, ps, pdf and svg backends. Other backends will fall back to 'nearest'. Note that most SVG renderers perform interpolation at rendering and that the default interpolation method they implement may differ.
If *interpolation* is the default 'antialiased', then 'nearest' interpolation is used if the image is upsampled by more than a factor of three (i.e. the number of display pixels is at least three times the size of the data array). If the upsampling rate is smaller than 3, or the image is downsampled, then 'hanning' interpolation is used to act as an anti-aliasing filter, unless the image happens to be upsampled by exactly a factor of two or one.
See [Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html) for an overview of the supported interpolation methods, and [Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html) for a discussion of image antialiasing.
Some interpolation methods require an additional radius parameter, which can be set by *filterrad*. Additionally, the antigrain image resize filter is controlled by the parameter *filternorm*.
**interpolation\_stage**{'data', 'rgba'}, default: 'data'
If 'data', interpolation is carried out on the data provided by the user. If 'rgba', the interpolation is carried out after the colormapping has been applied (visual interpolation).
**alpha**float or array-like, optional
The alpha blending value, between 0 (transparent) and 1 (opaque). If *alpha* is an array, the alpha blending values are applied pixel by pixel, and *alpha* must have the same shape as *X*.
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Place the [0, 0] index of the array in the upper left or lower left corner of the Axes. The convention (the default) 'upper' is typically used for matrices and images.
Note that the vertical axis points upward for 'lower' but downward for 'upper'.
See the [origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html) tutorial for examples and a more detailed description.
**extent**floats (left, right, bottom, top), optional
The bounding box in data coordinates that the image will fill. The image is stretched individually along x and y to fill the box.
The default extent is determined by the following conditions. Pixels have unit size in data coordinates. Their centers are on integer coordinates, and their center coordinates range from 0 to columns-1 horizontally and from 0 to rows-1 vertically.
Note that the direction of the vertical axis and thus the default values for top and bottom depend on *origin*:
* For `origin == 'upper'` the default is `(-0.5, numcols-0.5, numrows-0.5, -0.5)`.
* For `origin == 'lower'` the default is `(-0.5, numcols-0.5, -0.5, numrows-0.5)`.
See the [origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html) tutorial for examples and a more detailed description.
**filternorm**bool, default: True
A parameter for the antigrain image resize filter (see the antigrain documentation). If *filternorm* is set, the filter normalizes integer values and corrects the rounding errors. It doesn't do anything with the source floating point values, it corrects only integers according to the rule of 1.0 which means that any sum of pixel weights must be equal to 1.0. So, the filter function must produce a graph of the proper shape.
**filterrad**float > 0, default: 4.0
The filter radius for filters that have a radius parameter, i.e. when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
**resample**bool, default: `[rcParams["image.resample"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.resample#matplotlibrc-sample)` (default: `True`)
When *True*, use a full resampling method. When *False*, only resample when the output image is larger than the input image.
**url**str, optional
Set the url of the created [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"). See [`Artist.set_url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url").
Returns:
[`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
Other Parameters:
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
**\*\*kwargs**[`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties
These parameters are passed on to the constructor of the [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") artist.
See also
[`matshow`](matplotlib.axes.axes.matshow#matplotlib.axes.Axes.matshow "matplotlib.axes.Axes.matshow")
Plot a matrix or an array as an image.
#### Notes
Unless *extent* is used, pixel centers will be located at integer coordinates. In other words: the origin will coincide with the center of pixel (0, 0).
There are two common representations for RGB images with an alpha channel:
* Straight (unassociated) alpha: R, G, and B channels represent the color of the pixel, disregarding its opacity.
* Premultiplied (associated) alpha: R, G, and B channels represent the color of the pixel, adjusted for its opacity by multiplication.
[`imshow`](matplotlib.pyplot.imshow#matplotlib.pyplot.imshow "matplotlib.pyplot.imshow") expects RGB images adopting the straight (unassociated) alpha representation.
Examples using `matplotlib.axes.Axes.imshow`
--------------------------------------------
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Barcode](https://matplotlib.org/stable/gallery/images_contours_and_fields/barcode_demo.html#sphx-glr-gallery-images-contours-and-fields-barcode-demo-py)
Barcode
[Interactive Adjustment of Colormap Range](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_interactive_adjustment.html#sphx-glr-gallery-images-contours-and-fields-colormap-interactive-adjustment-py)
Interactive Adjustment of Colormap Range
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html#sphx-glr-gallery-images-contours-and-fields-image-antialiasing-py)
Image antialiasing
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Blend transparency with color in 2D images](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_transparency_blend.html#sphx-glr-gallery-images-contours-and-fields-image-transparency-blend-py)
Blend transparency with color in 2D images
[Modifying the coordinate formatter](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_zcoord.html#sphx-glr-gallery-images-contours-and-fields-image-zcoord-py)
Modifying the coordinate formatter
[Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html#sphx-glr-gallery-images-contours-and-fields-interpolation-methods-py)
Interpolations for imshow
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Colorbar](https://matplotlib.org/stable/gallery/color/colorbar_basics.html#sphx-glr-gallery-color-colorbar-basics-py)
Colorbar
[Creating a colormap from a list of colors](https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-gallery-color-custom-cmap-py)
Creating a colormap from a list of colors
[Anchored Direction Arrow](https://matplotlib.org/stable/gallery/axes_grid1/demo_anchored_direction_arrows.html#sphx-glr-gallery-axes-grid1-demo-anchored-direction-arrows-py)
Anchored Direction Arrow
[Axes Grid2](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid2.html#sphx-glr-gallery-axes-grid1-demo-axes-grid2-py)
Axes Grid2
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Colorbar with AxesDivider](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-axes-divider-py)
Colorbar with `.AxesDivider`
[Controlling the position and size of colorbars with Inset Axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_inset_locator.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-inset-locator-py)
Controlling the position and size of colorbars with Inset Axes
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Simple ImageGrid](https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid.html#sphx-glr-gallery-axes-grid1-simple-axesgrid-py)
Simple ImageGrid
[Simple ImageGrid 2](https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid2.html#sphx-glr-gallery-axes-grid1-simple-axesgrid2-py)
Simple ImageGrid 2
[Simple Colorbar](https://matplotlib.org/stable/gallery/axes_grid1/simple_colorbar.html#sphx-glr-gallery-axes-grid1-simple-colorbar-py)
Simple Colorbar
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[pyplot animation](https://matplotlib.org/stable/gallery/animation/animation_demo.html#sphx-glr-gallery-animation-animation-demo-py)
pyplot animation
 [Animated image using a precomputed list of images](https://matplotlib.org/stable/gallery/animation/dynamic_image.html#sphx-glr-gallery-animation-dynamic-image-py)
Animated image using a precomputed list of images
[Image Slices Viewer](https://matplotlib.org/stable/gallery/event_handling/image_slices_viewer.html#sphx-glr-gallery-event-handling-image-slices-viewer-py)
Image Slices Viewer
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Viewlims](https://matplotlib.org/stable/gallery/event_handling/viewlims.html#sphx-glr-gallery-event-handling-viewlims-py)
Viewlims
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[MRI](https://matplotlib.org/stable/gallery/specialty_plots/mri_demo.html#sphx-glr-gallery-specialty-plots-mri-demo-py)
===
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Topographic hillshading](https://matplotlib.org/stable/gallery/specialty_plots/topographic_hillshading.html#sphx-glr-gallery-specialty-plots-topographic-hillshading-py)
Topographic hillshading
[Dropped spines](https://matplotlib.org/stable/gallery/spines/spines_dropped.html#sphx-glr-gallery-spines-spines-dropped-py)
Dropped spines
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
[imshow(Z)](https://matplotlib.org/stable/plot_types/arrays/imshow.html#sphx-glr-plot-types-arrays-imshow-py)
imshow(Z)
matplotlib matplotlib.axis.Axis.get_majorticklabels matplotlib.axis.Axis.get\_majorticklabels
=========================================
Axis.get\_majorticklabels()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1343-L1349)
Return this Axis' major tick labels, as a list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text").
| programming_docs |
matplotlib matplotlib.pyplot.new_figure_manager matplotlib.pyplot.new\_figure\_manager
======================================
matplotlib.pyplot.new\_figure\_manager(*num*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L344-L347)
Create a new figure manager instance.
matplotlib matplotlib.axes.Axes.twinx matplotlib.axes.Axes.twinx
==========================
Axes.twinx()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4472-L4500)
Create a twin Axes sharing the xaxis.
Create a new Axes with an invisible x-axis and an independent y-axis positioned opposite to the original one (i.e. at right). The x-axis autoscale setting will be inherited from the original Axes. To ensure that the tick marks of both y-axes align, see [`LinearLocator`](../ticker_api#matplotlib.ticker.LinearLocator "matplotlib.ticker.LinearLocator").
Returns:
Axes
The newly created Axes instance
#### Notes
For those who are 'picking' artists while using twinx, pick events are only called for the artists in the top-most Axes.
Examples using `matplotlib.axes.Axes.twinx`
-------------------------------------------
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html#sphx-glr-gallery-subplots-axes-and-figures-two-scales-py)
Plots with different scales
[Parasite Simple](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py)
Parasite Simple
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
matplotlib matplotlib.pyplot.semilogx matplotlib.pyplot.semilogx
==========================
matplotlib.pyplot.semilogx(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2788-L2790)
Make a plot with log scaling on the x axis.
Call signatures:
```
semilogx([x], y, [fmt], data=None, **kwargs)
semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
```
This is just a thin wrapper around [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") which additionally changes the x-axis to log scaling. All of the concepts and parameters of plot can be used here as well.
The additional parameters *base*, *subs*, and *nonpositive* control the x-axis properties. They are just forwarded to [`Axes.set_xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale").
Parameters:
**base**float, default: 10
Base of the x logarithm.
**subs**array-like, optional
The location of the minor xticks. If *None*, reasonable locations are automatically chosen depending on the number of decades in the plot. See [`Axes.set_xscale`](matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") for details.
**nonpositive**{'mask', 'clip'}, default: 'mask'
Non-positive values in x can be masked as invalid, or clipped to a very small positive number.
**\*\*kwargs**
All parameters supported by [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot").
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Objects representing the plotted data.
matplotlib matplotlib.axis.XAxis.tick_bottom matplotlib.axis.XAxis.tick\_bottom
==================================
XAxis.tick\_bottom()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2381-L2391)
Move ticks and ticklabels (if present) to the bottom of the Axes.
Examples using `matplotlib.axis.XAxis.tick_bottom`
--------------------------------------------------
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
matplotlib matplotlib.artist.Artist.get_clip_path matplotlib.artist.Artist.get\_clip\_path
========================================
Artist.get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
matplotlib mpl_toolkits.axisartist.angle_helper.FormatterDMS mpl\_toolkits.axisartist.angle\_helper.FormatterDMS
===================================================
*class*mpl\_toolkits.axisartist.angle\_helper.FormatterDMS[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L186-L287)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
\_\_call\_\_(*direction*, *factor*, *values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L220-L287)
Call self as a function.
deg\_mark*='^{\\circ}'*
fmt\_d*='$%d^{\\circ}$'*
fmt\_d\_m*='$%s%d^{\\circ}\\,%02d^{\\prime}$'*
fmt\_d\_m\_partial*='$%s%d^{\\circ}\\,%02d^{\\prime}\\,'*
fmt\_d\_ms*='$%s%d^{\\circ}\\,%02d.%s^{\\prime}$'*
fmt\_ds*='$%d.%s^{\\circ}$'*
fmt\_s\_partial*='%02d^{\\prime\\prime}$'*
fmt\_ss\_partial*='%02d.%s^{\\prime\\prime}$'*
min\_mark*='^{\\prime}'*
sec\_mark*='^{\\prime\\prime}'*
Examples using `mpl_toolkits.axisartist.angle_helper.FormatterDMS`
------------------------------------------------------------------
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Curvilinear grid demo](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid-py)
Curvilinear grid demo
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
[floating\_axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axis.html#sphx-glr-gallery-axisartist-demo-floating-axis-py)
floating\_axis demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
matplotlib matplotlib.pyplot.minorticks_on matplotlib.pyplot.minorticks\_on
================================
matplotlib.pyplot.minorticks\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2665-L2667)
Display minor ticks on the Axes.
Displaying minor ticks may reduce performance; you may turn them off using [`minorticks_off()`](matplotlib.pyplot.minorticks_off#matplotlib.pyplot.minorticks_off "matplotlib.pyplot.minorticks_off") if drawing speed is a problem.
matplotlib mpl_toolkits.axisartist.angle_helper.select_step mpl\_toolkits.axisartist.angle\_helper.select\_step
===================================================
mpl\_toolkits.axisartist.angle\_helper.select\_step(*v1*, *v2*, *nv*, *hour=False*, *include\_last=True*, *threshold\_factor=3600.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L79-L125)
matplotlib matplotlib.pyplot.subplot_tool matplotlib.pyplot.subplot\_tool
===============================
matplotlib.pyplot.subplot\_tool(*targetfig=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1637-L1654)
Launch a subplot tool window for a figure.
Returns:
[`matplotlib.widgets.SubplotTool`](../widgets_api#matplotlib.widgets.SubplotTool "matplotlib.widgets.SubplotTool")
matplotlib matplotlib.axes.Axes.add_image matplotlib.axes.Axes.add\_image
===============================
Axes.add\_image(*image*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2313-L2324)
Add an [`AxesImage`](../image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") to the Axes; return the image.
Examples using `matplotlib.axes.Axes.add_image`
-----------------------------------------------
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
matplotlib mpl_toolkits.axes_grid1.axes_size.MaxWidth mpl\_toolkits.axes\_grid1.axes\_size.MaxWidth
=============================================
*class*mpl\_toolkits.axes\_grid1.axes\_size.MaxWidth(*artist\_list*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_size.py#L167-L173)
Bases: [`MaxExtent`](mpl_toolkits.axes_grid1.axes_size.maxextent#mpl_toolkits.axes_grid1.axes_size.MaxExtent "mpl_toolkits.axes_grid1.axes_size.MaxExtent")
Size whose absolute part is the largest width of the given *artist\_list*.
matplotlib matplotlib.pyplot.legend matplotlib.pyplot.legend
========================
matplotlib.pyplot.legend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2624-L2626)
Place a legend on the Axes.
Call signatures:
```
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
ax.legend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
ax.legend()
```
Note
Specific artists can be excluded from the automatic legend element selection by using a label starting with an underscore, "\_". A string starting with an underscore is the default label for all artists, so calling [`Axes.legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
ax.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax.plot([1, 2, 3], label='label1')
line2, = ax.plot([1, 2, 3], label='label2')
ax.legend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on an Axes, call this function with an iterable of strings, one for each legend item. For example:
```
ax.plot([1, 2, 3])
ax.plot([5, 6, 7])
ax.legend(['First line', 'Second line'])
```
Parameters:
**handles**sequence of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](../legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
#### Examples
([Source code](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend.py), [png](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_00_00.png))
Examples using `matplotlib.pyplot.legend`
-----------------------------------------
[Errorbar limit selection](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_limits_simple.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-limits-simple-py)
Errorbar limit selection
[Plotting masked and NaN values](https://matplotlib.org/stable/gallery/lines_bars_and_markers/masked_demo.html#sphx-glr-gallery-lines-bars-and-markers-masked-demo-py)
Plotting masked and NaN values
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py)
Step Demo
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[The Sankey class](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics.html#sphx-glr-gallery-specialty-plots-sankey-basics-py)
The Sankey class
[SVG Histogram](https://matplotlib.org/stable/gallery/user_interfaces/svg_histogram_sgskip.html#sphx-glr-gallery-user-interfaces-svg-histogram-sgskip-py)
SVG Histogram
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
| programming_docs |
matplotlib matplotlib.artist.Artist.get_alpha matplotlib.artist.Artist.get\_alpha
===================================
Artist.get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
matplotlib matplotlib.colors.to_hex matplotlib.colors.to\_hex
=========================
matplotlib.colors.to\_hex(*c*, *keep\_alpha=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L499-L518)
Convert *c* to a hex color.
Parameters:
**c**[color](https://matplotlib.org/stable/tutorials/colors/colors.html) or [`numpy.ma.masked`](https://numpy.org/doc/stable/reference/maskedarray.baseclass.html#numpy.ma.masked "(in NumPy v1.23)")
**keep\_alpha**bool, default: False
If False, use the `#rrggbb` format, otherwise use `#rrggbbaa`.
Returns:
str
`#rrggbb` or `#rrggbbaa` hex color string
matplotlib matplotlib.patches.RegularPolygon matplotlib.patches.RegularPolygon
=================================
*class*matplotlib.patches.RegularPolygon(*xy*, *numVertices*, *\**, *radius=5*, *orientation=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L882-L929)
Bases: [`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A regular polygon patch.
Parameters:
**xy**(float, float)
The center position.
**numVertices**int
The number of vertices.
**radius**float
The distance from the center to each of the vertices.
**orientation**float
The polygon rotation angle (in radians).
**\*\*kwargs**
[`Patch`](matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | unknown |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_patch\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L925-L929)
Return the [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L922-L923)
Return the path of this patch.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`capstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fill`](matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.patches.RegularPolygon`
--------------------------------------------------
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
matplotlib matplotlib.animation.Animation matplotlib.animation.Animation
==============================
*class*matplotlib.animation.Animation(*fig*, *event\_source=None*, *blit=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L817-L1354)
A base class for Animations.
This class is not usable as is, and should be subclassed to provide needed behavior.
Note
You must store the created Animation in a variable that lives as long as the animation should run. Otherwise, the Animation object will be garbage-collected and the animation stops.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object used to get needed events, such as draw or resize.
**event\_source**object, optional
A class that can run a callback when desired events are generated, as well as be stopped and started.
Examples include timers (see [`TimedAnimation`](matplotlib.animation.timedanimation#matplotlib.animation.TimedAnimation "matplotlib.animation.TimedAnimation")) and file system notifications.
**blit**bool, default: False
Whether blitting is used to optimize drawing.
See also
[`FuncAnimation`](matplotlib.animation.funcanimation#matplotlib.animation.FuncAnimation "matplotlib.animation.FuncAnimation"), [`ArtistAnimation`](matplotlib.animation.artistanimation#matplotlib.animation.ArtistAnimation "matplotlib.animation.ArtistAnimation")
\_\_init\_\_(*fig*, *event\_source=None*, *blit=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L850-L875)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.Animation.__init__ "matplotlib.animation.Animation.__init__")(fig[, event\_source, blit]) | |
| [`new_frame_seq`](#matplotlib.animation.Animation.new_frame_seq "matplotlib.animation.Animation.new_frame_seq")() | Return a new sequence of frame information. |
| [`new_saved_frame_seq`](#matplotlib.animation.Animation.new_saved_frame_seq "matplotlib.animation.Animation.new_saved_frame_seq")() | Return a new sequence of saved/cached frame information. |
| [`pause`](#matplotlib.animation.Animation.pause "matplotlib.animation.Animation.pause")() | Pause the animation. |
| [`resume`](#matplotlib.animation.Animation.resume "matplotlib.animation.Animation.resume")() | Resume the animation. |
| [`save`](#matplotlib.animation.Animation.save "matplotlib.animation.Animation.save")(filename[, writer, fps, dpi, codec, ...]) | Save the animation as a movie file by drawing every frame. |
| [`to_html5_video`](#matplotlib.animation.Animation.to_html5_video "matplotlib.animation.Animation.to_html5_video")([embed\_limit]) | Convert the animation to an HTML5 `<video>` tag. |
| [`to_jshtml`](#matplotlib.animation.Animation.to_jshtml "matplotlib.animation.Animation.to_jshtml")([fps, embed\_frames, default\_mode]) | Generate HTML representation of the animation. |
new\_frame\_seq()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1102-L1105)
Return a new sequence of frame information.
new\_saved\_frame\_seq()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1107-L1110)
Return a new sequence of saved/cached frame information.
pause()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1342-L1347)
Pause the animation.
resume()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1349-L1354)
Resume the animation.
save(*filename*, *writer=None*, *fps=None*, *dpi=None*, *codec=None*, *bitrate=None*, *extra\_args=None*, *metadata=None*, *extra\_anim=None*, *savefig\_kwargs=None*, *\**, *progress\_callback=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L914-L1085)
Save the animation as a movie file by drawing every frame.
Parameters:
**filename**str
The output filename, e.g., `mymovie.mp4`.
**writer**[`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") or str, default: `[rcParams["animation.writer"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.writer#matplotlibrc-sample)` (default: `'ffmpeg'`)
A [`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") instance to use or a key that identifies a class to use, such as 'ffmpeg'.
**fps**int, optional
Movie frame rate (per second). If not set, the frame rate from the animation's frame interval.
**dpi**float, default: `[rcParams["savefig.dpi"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.dpi#matplotlibrc-sample)` (default: `'figure'`)
Controls the dots per inch for the movie frames. Together with the figure's size in inches, this controls the size of the movie.
**codec**str, default: `[rcParams["animation.codec"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.codec#matplotlibrc-sample)` (default: `'h264'`).
The video codec to use. Not all codecs are supported by a given [`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter").
**bitrate**int, default: `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`)
The bitrate of the movie, in kilobits per second. Higher values means higher quality movies, but increase the file size. A value of -1 lets the underlying movie encoder select the bitrate.
**extra\_args**list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. The default, None, means to use `[rcParams["animation.[name-of-encoder]\_args"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.%5Bname-of-encoder%5D_args#matplotlibrc-sample)` for the builtin writers.
**metadata**dict[str, str], default: {}
Dictionary of keys and values for metadata to include in the output file. Some keys that may be of use include: title, artist, genre, subject, copyright, srcform, comment.
**extra\_anim**list, default: []
Additional [`Animation`](#matplotlib.animation.Animation "matplotlib.animation.Animation") objects that should be included in the saved movie file. These need to be from the same [`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance. Also, animation frames will just be simply combined, so there should be a 1:1 correspondence between the frames from the different animations.
**savefig\_kwargs**dict, default: {}
Keyword arguments passed to each [`savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") call used to save the individual frames.
**progress\_callback**function, optional
A callback function that will be called for every frame to notify the saving progress. It must have the signature
```
def func(current_frame: int, total_frames: int) -> Any
```
where *current\_frame* is the current frame number and *total\_frames* is the total number of frames to be saved. *total\_frames* is set to None, if the total number of frames can not be determined. Return values may exist but are ignored.
Example code to write the progress to stdout:
```
progress_callback = lambda i, n: print(f'Saving frame {i} of {n}')
```
#### Notes
*fps*, *codec*, *bitrate*, *extra\_args* and *metadata* are used to construct a [`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter") instance and can only be passed if *writer* is a string. If they are passed as non-*None* and *writer* is a [`MovieWriter`](matplotlib.animation.moviewriter#matplotlib.animation.MovieWriter "matplotlib.animation.MovieWriter"), a [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "(in Python v3.10)") will be raised.
to\_html5\_video(*embed\_limit=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1218-L1295)
Convert the animation to an HTML5 `<video>` tag.
This saves the animation as an h264 video, encoded in base64 directly into the HTML5 video tag. This respects `[rcParams["animation.writer"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.writer#matplotlibrc-sample)` (default: `'ffmpeg'`) and `[rcParams["animation.bitrate"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.bitrate#matplotlibrc-sample)` (default: `-1`). This also makes use of the `interval` to control the speed, and uses the `repeat` parameter to decide whether to loop.
Parameters:
**embed\_limit**float, optional
Limit, in MB, of the returned animation. No animation is created if the limit is exceeded. Defaults to `[rcParams["animation.embed\_limit"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=animation.embed_limit#matplotlibrc-sample)` (default: `20.0`) = 20.0.
Returns:
str
An HTML5 video tag with the animation embedded as base64 encoded h264 video. If the *embed\_limit* is exceeded, this returns the string "Video too large to embed."
to\_jshtml(*fps=None*, *embed\_frames=True*, *default\_mode=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1297-L1332)
Generate HTML representation of the animation.
Parameters:
**fps**int, optional
Movie frame rate (per second). If not set, the frame rate from the animation's frame interval.
**embed\_frames**bool, optional
**default\_mode**str, optional
What to do when the animation ends. Must be one of `{'loop',
'once', 'reflect'}`. Defaults to `'loop'` if `self.repeat` is True, otherwise `'once'`.
| programming_docs |
matplotlib matplotlib.axes.Axes.convert_xunits matplotlib.axes.Axes.convert\_xunits
====================================
Axes.convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
matplotlib mpl_toolkits.axisartist.axis_artist mpl\_toolkits.axisartist.axis\_artist
=====================================
The [`axis_artist`](#module-mpl_toolkits.axisartist.axis_artist "mpl_toolkits.axisartist.axis_artist") module implements custom artists to draw axis elements (axis lines and labels, tick lines and labels, grid lines).
Axis lines and labels and tick lines and labels are managed by the [`AxisArtist`](mpl_toolkits.axisartist.axis_artist.axisartist#mpl_toolkits.axisartist.axis_artist.AxisArtist "mpl_toolkits.axisartist.axis_artist.AxisArtist") class; grid lines are managed by the [`GridlinesCollection`](mpl_toolkits.axisartist.axis_artist.gridlinescollection#mpl_toolkits.axisartist.axis_artist.GridlinesCollection "mpl_toolkits.axisartist.axis_artist.GridlinesCollection") class.
There is one [`AxisArtist`](mpl_toolkits.axisartist.axis_artist.axisartist#mpl_toolkits.axisartist.axis_artist.AxisArtist "mpl_toolkits.axisartist.axis_artist.AxisArtist") per Axis; it can be accessed through the `axis` dictionary of the parent Axes (which should be a `mpl_toolkits.axislines.Axes`), e.g. `ax.axis["bottom"]`.
Children of the AxisArtist are accessed as attributes: `.line` and `.label` for the axis line and label, `.major_ticks`, `.major_ticklabels`, `.minor_ticks`, `.minor_ticklabels` for the tick lines and labels (e.g. `ax.axis["bottom"].line`).
Children properties (colors, fonts, line widths, etc.) can be set using setters, e.g.
```
# Make the major ticks of the bottom axis red.
ax.axis["bottom"].major_ticks.set_color("red")
```
However, things like the locations of ticks, and their ticklabels need to be changed from the side of the grid\_helper.
axis\_direction
---------------
[`AxisArtist`](mpl_toolkits.axisartist.axis_artist.axisartist#mpl_toolkits.axisartist.axis_artist.AxisArtist "mpl_toolkits.axisartist.axis_artist.AxisArtist"), [`AxisLabel`](mpl_toolkits.axisartist.axis_artist.axislabel#mpl_toolkits.axisartist.axis_artist.AxisLabel "mpl_toolkits.axisartist.axis_artist.AxisLabel"), [`TickLabels`](mpl_toolkits.axisartist.axis_artist.ticklabels#mpl_toolkits.axisartist.axis_artist.TickLabels "mpl_toolkits.axisartist.axis_artist.TickLabels") have an *axis\_direction* attribute, which adjusts the location, angle, etc. The *axis\_direction* must be one of "left", "right", "bottom", "top", and follows the Matplotlib convention for rectangular axis.
For example, for the *bottom* axis (the left and right is relative to the direction of the increasing coordinate),
* ticklabels and axislabel are on the right
* ticklabels and axislabel have text angle of 0
* ticklabels are baseline, center-aligned
* axislabel is top, center-aligned
The text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
| Parameter | left | bottom | right | top |
| --- | --- | --- | --- | --- |
| ticklabels location | left | right | right | left |
| axislabel location | left | right | right | left |
| ticklabels angle | 90 | 0 | -90 | 180 |
| axislabel angle | 180 | 0 | 0 | 180 |
| ticklabel va | center | baseline | center | baseline |
| axislabel va | center | top | center | bottom |
| ticklabel ha | right | center | right | center |
| axislabel ha | right | center | right | center |
Ticks are by default direct opposite side of the ticklabels. To make ticks to the same side of the ticklabels,
```
ax.axis["bottom"].major_ticks.set_tick_out(True)
```
The following attributes can be customized (use the `set_xxx` methods):
* [`Ticks`](mpl_toolkits.axisartist.axis_artist.ticks#mpl_toolkits.axisartist.axis_artist.Ticks "mpl_toolkits.axisartist.axis_artist.Ticks"): ticksize, tick\_out
* [`TickLabels`](mpl_toolkits.axisartist.axis_artist.ticklabels#mpl_toolkits.axisartist.axis_artist.TickLabels "mpl_toolkits.axisartist.axis_artist.TickLabels"): pad
* [`AxisLabel`](mpl_toolkits.axisartist.axis_artist.axislabel#mpl_toolkits.axisartist.axis_artist.AxisLabel "mpl_toolkits.axisartist.axis_artist.AxisLabel"): pad
Classes
-------
| | |
| --- | --- |
| [`AttributeCopier`](mpl_toolkits.axisartist.axis_artist.attributecopier#mpl_toolkits.axisartist.axis_artist.AttributeCopier "mpl_toolkits.axisartist.axis_artist.AttributeCopier")() | |
| [`AxisArtist`](mpl_toolkits.axisartist.axis_artist.axisartist#mpl_toolkits.axisartist.axis_artist.AxisArtist "mpl_toolkits.axisartist.axis_artist.AxisArtist")(axes, helper[, offset, ...]) | An artist which draws axis (a line along which the n-th axes coord is constant) line, ticks, ticklabels, and axis label. |
| [`AxisLabel`](mpl_toolkits.axisartist.axis_artist.axislabel#mpl_toolkits.axisartist.axis_artist.AxisLabel "mpl_toolkits.axisartist.axis_artist.AxisLabel")(\*args[, axis\_direction, axis]) | Axis Label. |
| [`GridlinesCollection`](mpl_toolkits.axisartist.axis_artist.gridlinescollection#mpl_toolkits.axisartist.axis_artist.GridlinesCollection "mpl_toolkits.axisartist.axis_artist.GridlinesCollection")(\*args[, which, axis]) | Parameters:
|
| [`LabelBase`](mpl_toolkits.axisartist.axis_artist.labelbase#mpl_toolkits.axisartist.axis_artist.LabelBase "mpl_toolkits.axisartist.axis_artist.LabelBase")(\*args, \*\*kwargs) | A base class for AxisLabel and TickLabels. |
| [`TickLabels`](mpl_toolkits.axisartist.axis_artist.ticklabels#mpl_toolkits.axisartist.axis_artist.TickLabels "mpl_toolkits.axisartist.axis_artist.TickLabels")(\*[, axis\_direction]) | Tick Labels. |
| [`Ticks`](mpl_toolkits.axisartist.axis_artist.ticks#mpl_toolkits.axisartist.axis_artist.Ticks "mpl_toolkits.axisartist.axis_artist.Ticks")(ticksize[, tick\_out, axis]) | Ticks are derived from Line2D, and note that ticks themselves are markers. |
matplotlib matplotlib.axis.Axis.get_minor_formatter matplotlib.axis.Axis.get\_minor\_formatter
==========================================
Axis.get\_minor\_formatter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1523-L1525)
Get the formatter of the minor ticker.
matplotlib matplotlib.artist.Artist.set_visible matplotlib.artist.Artist.set\_visible
=====================================
Artist.set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
Examples using `matplotlib.artist.Artist.set_visible`
-----------------------------------------------------
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Keypress event](https://matplotlib.org/stable/gallery/event_handling/keypress_demo.html#sphx-glr-gallery-event-handling-keypress-demo-py)
Keypress event
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
[Spines](https://matplotlib.org/stable/gallery/spines/spines.html#sphx-glr-gallery-spines-spines-py)
Spines
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
[Dropped spines](https://matplotlib.org/stable/gallery/spines/spines_dropped.html#sphx-glr-gallery-spines-spines-dropped-py)
Dropped spines
[Nested GridSpecs](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec06.html#sphx-glr-gallery-userdemo-demo-gridspec06-py)
Nested GridSpecs
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
matplotlib matplotlib.axes.Axes.add_child_axes matplotlib.axes.Axes.add\_child\_axes
=====================================
Axes.add\_child\_axes(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2261-L2277)
Add an `AxesBase` to the Axes' children; return the child Axes.
This is the lowlevel version. See [`axes.Axes.inset_axes`](matplotlib.axes.axes.inset_axes#matplotlib.axes.Axes.inset_axes "matplotlib.axes.Axes.inset_axes").
matplotlib matplotlib.colors.Normalize matplotlib.colors.Normalize
===========================
*class*matplotlib.colors.Normalize(*vmin=None*, *vmax=None*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1202-L1384)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A class which, when called, linearly normalizes data into the `[0.0, 1.0]` interval.
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1310-L1354)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
autoscale(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1368-L1372)
Set *vmin*, *vmax* to min, max of *A*.
autoscale\_None(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1374-L1380)
If vmin or vmax are not set, use the min/max of *A* to set them.
*property*clip
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1356-L1366)
*static*process\_value(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1275-L1308)
Homogenize the input *value* for easy and efficient normalization.
*value* can be a scalar or sequence.
Returns:
**result**masked array
Masked array with the same shape as *value*.
**is\_scalar**bool
Whether *value* is a scalar.
#### Notes
Float dtypes are preserved; integer types with two bytes or smaller are converted to np.float32, and larger types are converted to np.float64. Preserving float32 when possible, and using in-place operations, greatly improves speed for large arrays.
scaled()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1382-L1384)
Return whether vmin and vmax are set.
*property*vmax
*property*vmin
Examples using `matplotlib.colors.Normalize`
--------------------------------------------
[Multicolored lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multicolored_line.html#sphx-glr-gallery-lines-bars-and-markers-multicolored-line-py)
Multicolored lines
[Mapping marker properties to multivariate data](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html#sphx-glr-gallery-lines-bars-and-markers-multivariate-marker-plot-py)
Mapping marker properties to multivariate data
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Colormap Normalizations SymLogNorm](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations_symlognorm.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-symlognorm-py)
Colormap Normalizations SymLogNorm
[Contour Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_image.html#sphx-glr-gallery-images-contours-and-fields-contour-image-py)
Contour Image
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Blend transparency with color in 2D images](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_transparency_blend.html#sphx-glr-gallery-images-contours-and-fields-image-transparency-blend-py)
Blend transparency with color in 2D images
[Multi Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/multi_image.html#sphx-glr-gallery-images-contours-and-fields-multi-image-py)
Multi Image
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
[pcolormesh](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-levels-py)
pcolormesh
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Time Series Histogram](https://matplotlib.org/stable/gallery/statistics/time_series_histogram.html#sphx-glr-gallery-statistics-time-series-histogram-py)
Time Series Histogram
[Axes Grid2](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid2.html#sphx-glr-gallery-axes-grid1-demo-axes-grid2-py)
Axes Grid2
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[Exploring normalizations](https://matplotlib.org/stable/gallery/scales/power_norm.html#sphx-glr-gallery-scales-power-norm-py)
Exploring normalizations
[Hillshading](https://matplotlib.org/stable/gallery/specialty_plots/advanced_hillshading.html#sphx-glr-gallery-specialty-plots-advanced-hillshading-py)
Hillshading
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
matplotlib mpl_toolkits.axisartist.grid_helper_curvelinear.FixedAxisArtistHelper mpl\_toolkits.axisartist.grid\_helper\_curvelinear.FixedAxisArtistHelper
========================================================================
*class*mpl\_toolkits.axisartist.grid\_helper\_curvelinear.FixedAxisArtistHelper(*grid\_helper*, *side*, *nth\_coord\_ticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L19-L65)
Bases: [`Fixed`](mpl_toolkits.axisartist.axislines.axisartisthelper#mpl_toolkits.axisartist.axislines.AxisArtistHelper.Fixed "mpl_toolkits.axisartist.axislines.AxisArtistHelper.Fixed")
Helper class for a fixed axis.
nth\_coord = along which coordinate value varies.
nth\_coord = 0 -> x axis, nth\_coord = 1 -> y axis
change\_tick\_coord(*coord\_number=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L42-L49)
[*Deprecated*]
#### Notes
Deprecated since version 3.5:
get\_tick\_iterators(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L54-L65)
tick\_loc, tick\_angle, tick\_label
get\_tick\_transform(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L51-L52)
update\_lim(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L39-L40)
matplotlib matplotlib.axes.Axes.get_xscale matplotlib.axes.Axes.get\_xscale
================================
Axes.get\_xscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Return the xaxis' scale (as a str).
matplotlib matplotlib.axes.Axes.get_xaxis_text2_transform matplotlib.axes.Axes.get\_xaxis\_text2\_transform
=================================================
Axes.get\_xaxis\_text2\_transform(*pad\_points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L925-L949)
Returns:
**transform**Transform
The transform used for drawing secondary x-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](../axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
matplotlib matplotlib.artist.Artist.sticky_edges matplotlib.artist.Artist.sticky\_edges
======================================
*property*Artist.sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
| programming_docs |
matplotlib matplotlib.axes.Axes.minorticks_on matplotlib.axes.Axes.minorticks\_on
===================================
Axes.minorticks\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3967-L3984)
Display minor ticks on the Axes.
Displaying minor ticks may reduce performance; you may turn them off using [`minorticks_off()`](matplotlib.axes.axes.minorticks_off#matplotlib.axes.Axes.minorticks_off "matplotlib.axes.Axes.minorticks_off") if drawing speed is a problem.
Examples using `matplotlib.axes.Axes.minorticks_on`
---------------------------------------------------
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
matplotlib matplotlib.axes.Axes.table matplotlib.axes.Axes.table
==========================
Axes.table(*cellText=None*, *cellColours=None*, *cellLoc='right'*, *colWidths=None*, *rowLabels=None*, *rowColours=None*, *rowLoc='left'*, *colLabels=None*, *colColours=None*, *colLoc='center'*, *loc='bottom'*, *bbox=None*, *edges='closed'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L650-L827)
Add a table to an [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
At least one of *cellText* or *cellColours* must be specified. These parameters must be 2D lists, in which the outer lists define the rows and the inner list define the column values per row. Each row must have the same number of elements.
The table can optionally have row and column headers, which are configured using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*, *colLoc* respectively.
For finer grained control over tables, use the [`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table") class and add it to the axes with [`Axes.add_table`](matplotlib.axes.axes.add_table#matplotlib.axes.Axes.add_table "matplotlib.axes.Axes.add_table").
Parameters:
**cellText**2D list of str, optional
The texts to place into the table cells.
*Note*: Line breaks in the strings are currently not accounted for and will result in the text exceeding the cell boundaries.
**cellColours**2D list of colors, optional
The background colors of the cells.
**cellLoc**{'left', 'center', 'right'}, default: 'right'
The alignment of the text within the cells.
**colWidths**list of float, optional
The column widths in units of the axes. If not given, all columns will have a width of *1 / ncols*.
**rowLabels**list of str, optional
The text of the row header cells.
**rowColours**list of colors, optional
The colors of the row header cells.
**rowLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the row header cells.
**colLabels**list of str, optional
The text of the column header cells.
**colColours**list of colors, optional
The colors of the column header cells.
**colLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the column header cells.
**loc**str, optional
The position of the cell with respect to *ax*. This must be one of the [`codes`](../table_api#matplotlib.table.Table.codes "matplotlib.table.Table.codes").
**bbox**[`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), optional
A bounding box to draw the table into. If this is not *None*, this overrides *loc*.
**edges**substring of 'BRTL' or {'open', 'closed', 'horizontal', 'vertical'}
The cell edges to be drawn with a line. See also [`visible_edges`](../table_api#matplotlib.table.Cell.visible_edges "matplotlib.table.Cell.visible_edges").
Returns:
[`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table")
The created table.
Other Parameters:
**\*\*kwargs**
[`Table`](../table_api#matplotlib.table.Table "matplotlib.table.Table") properties.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontsize`](../table_api#matplotlib.table.Table.set_fontsize "matplotlib.table.Table.set_fontsize") | float |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib matplotlib.artist.Artist.have_units matplotlib.artist.Artist.have\_units
====================================
Artist.have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
matplotlib mpl_toolkits.axisartist.angle_helper.FormatterHMS mpl\_toolkits.axisartist.angle\_helper.FormatterHMS
===================================================
*class*mpl\_toolkits.axisartist.angle\_helper.FormatterHMS[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L290-L307)
Bases: [`FormatterDMS`](mpl_toolkits.axisartist.angle_helper.formatterdms#mpl_toolkits.axisartist.angle_helper.FormatterDMS "mpl_toolkits.axisartist.angle_helper.FormatterDMS")
\_\_call\_\_(*direction*, *factor*, *values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L306-L307)
Call self as a function.
deg\_mark*='^\\mathrm{h}'*
fmt\_d*='$%d^\\mathrm{h}$'*
fmt\_d\_m*='$%s%d^\\mathrm{h}\\,%02d^\\mathrm{m}$'*
fmt\_d\_m\_partial*='$%s%d^\\mathrm{h}\\,%02d^\\mathrm{m}\\,'*
fmt\_d\_ms*='$%s%d^\\mathrm{h}\\,%02d.%s^\\mathrm{m}$'*
fmt\_ds*='$%d.%s^\\mathrm{h}$'*
fmt\_s\_partial*='%02d^\\mathrm{s}$'*
fmt\_ss\_partial*='%02d.%s^\\mathrm{s}$'*
min\_mark*='^\\mathrm{m}'*
sec\_mark*='^\\mathrm{s}'*
Examples using `mpl_toolkits.axisartist.angle_helper.FormatterHMS`
------------------------------------------------------------------
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
matplotlib matplotlib.axis.Axis.set_ticks matplotlib.axis.Axis.set\_ticks
===============================
Axis.set\_ticks(*ticks*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1996-L2033)
Set this Axis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
Parameters:
**ticks**list of floats
List of tick locations. The axis [`Locator`](../ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") is replaced by a [`FixedLocator`](../ticker_api#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator").
Some tick formatters will not label arbitrary tick positions; e.g. log formatters only label decade ticks by default. In such a case you can set a formatter explicitly on the axis using [`Axis.set_major_formatter`](matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") or provide formatted *labels* yourself.
**labels**list of str, optional
List of tick labels. If not set, the labels are generated with the axis tick [`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter").
**minor**bool, default: False
If `False`, set the major ticks; if `True`, the minor ticks.
**\*\*kwargs**
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels. These take effect only if you pass *labels*. In other cases, please use [`tick_params`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
#### Notes
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
Examples using `matplotlib.axis.Axis.set_ticks`
-----------------------------------------------
[Spine Placement](https://matplotlib.org/stable/gallery/spines/spine_placement_demo.html#sphx-glr-gallery-spines-spine-placement-demo-py)
Spine Placement
matplotlib matplotlib.pyplot.hlines matplotlib.pyplot.hlines
========================
matplotlib.pyplot.hlines(*y*, *xmin*, *xmax*, *colors=None*, *linestyles='solid'*, *label=''*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2594-L2601)
Plot horizontal lines at each *y* from *xmin* to *xmax*.
Parameters:
**y**float or array-like
y-indexes where to plot the lines.
**xmin, xmax**float or array-like
Respective beginning and end of each line. If scalars are provided, all lines will have the same length.
**colors**list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
**linestyles**{'solid', 'dashed', 'dashdot', 'dotted'}, optional
**label**str, default: ''
Returns:
[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*y*, *xmin*, *xmax*, *colors*
**\*\*kwargs**[`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") properties.
See also
[`vlines`](matplotlib.pyplot.vlines#matplotlib.pyplot.vlines "matplotlib.pyplot.vlines")
vertical lines
[`axhline`](matplotlib.pyplot.axhline#matplotlib.pyplot.axhline "matplotlib.pyplot.axhline")
horizontal line across the Axes
matplotlib mpl_toolkits.axisartist.angle_helper.LocatorHM mpl\_toolkits.axisartist.angle\_helper.LocatorHM
================================================
*class*mpl\_toolkits.axisartist.angle\_helper.LocatorHM(*nbins*, *include\_last=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L157-L160)
Bases: [`LocatorBase`](mpl_toolkits.axisartist.angle_helper.locatorbase#mpl_toolkits.axisartist.angle_helper.LocatorBase "mpl_toolkits.axisartist.angle_helper.LocatorBase")
\_\_call\_\_(*v1*, *v2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L158-L160)
Call self as a function.
matplotlib matplotlib.pyplot.box matplotlib.pyplot.box
=====================
matplotlib.pyplot.box(*on=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1657-L1675)
Turn the axes box on or off on the current axes.
Parameters:
**on**bool or None
The new [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") box state. If `None`, toggle the state.
See also
[`matplotlib.axes.Axes.set_frame_on()`](matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on")
[`matplotlib.axes.Axes.get_frame_on()`](matplotlib.axes.axes.get_frame_on#matplotlib.axes.Axes.get_frame_on "matplotlib.axes.Axes.get_frame_on")
matplotlib matplotlib.axes.Axes.tricontourf matplotlib.axes.Axes.tricontourf
================================
Axes.tricontourf(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tricontour.py#L244-L267)
Draw contour regions on an unstructured triangular grid.
Call signatures:
```
tricontourf(triangulation, Z, [levels], ...)
tricontourf(x, y, Z, [levels], *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters. If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly.
It is possible to pass *triangles* positionally, i.e. `tricontourf(x, y, triangles, Z, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"), optional
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**Z**array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet")
Other Parameters:
**colors**color string or sequence of colors, optional
The colors of the levels, i.e., the contour regions.
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it is repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `tricontourf`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call to [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed") is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") because it internally calls [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed").
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**hatches**list[str], optional
A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
#### Notes
[`tricontourf`](#matplotlib.axes.Axes.tricontourf "matplotlib.axes.Axes.tricontourf") fills intervals that are closed at the top; that is, for boundaries *z1* and *z2*, the filled region is:
```
z1 < Z <= z2
```
except for the lowest interval, which is closed on both sides (i.e. it includes the lowest value).
Examples using `matplotlib.axes.Axes.tricontourf`
-------------------------------------------------
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Tricontour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_demo.html#sphx-glr-gallery-images-contours-and-fields-tricontour-demo-py)
Tricontour Demo
[Tricontour Smooth User](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_user.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-user-py)
Tricontour Smooth User
[Triangular 3D filled contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontourf3d.html#sphx-glr-gallery-mplot3d-tricontourf3d-py)
Triangular 3D filled contour plot
[tricontourf(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py)
tricontourf(x, y, z)
| programming_docs |
matplotlib matplotlib.pyplot.errorbar matplotlib.pyplot.errorbar
==========================
matplotlib.pyplot.errorbar(*x*, *y*, *yerr=None*, *xerr=None*, *fmt=''*, *ecolor=None*, *elinewidth=None*, *capsize=None*, *barsabove=False*, *lolims=False*, *uplims=False*, *xlolims=False*, *xuplims=False*, *errorevery=1*, *capthick=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2474-L2485)
Plot y versus x as lines and/or markers with attached errorbars.
*x*, *y* define the data locations, *xerr*, *yerr* define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt='none' to draw errorbars without any data markers.
Parameters:
**x, y**float or array-like
The data positions.
**xerr, yerr**float or array-like, shape(N,) or shape(2, N), optional
The errorbar sizes:
* scalar: Symmetric +/- values for all data points.
* shape(N,): Symmetric +/-values for each data point.
* shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.
* *None*: No errorbar.
All values must be >= 0.
See [Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html) for an example on the usage of `xerr` and `yerr`.
**fmt**str, default: ''
The format for the data points / data lines. See [`plot`](matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot") for details.
Use 'none' (case insensitive) to plot errorbars without any data markers.
**ecolor**color, default: None
The color of the errorbar lines. If None, use the color of the line connecting the markers.
**elinewidth**float, default: None
The linewidth of the errorbar lines. If None, the linewidth of the current style is used.
**capsize**float, default: `[rcParams["errorbar.capsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=errorbar.capsize#matplotlibrc-sample)` (default: `0.0`)
The length of the error bar caps in points.
**capthick**float, default: None
An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if *mew* or *markeredgewidth* are given, then they will over-ride *capthick*. This may change in future releases.
**barsabove**bool, default: False
If True, will plot the errorbars above the plot symbols. Default is below.
**lolims, uplims, xlolims, xuplims**bool, default: False
These arguments can be used to indicate that a value gives only upper/lower limits. In that case a caret symbol is used to indicate this. *lims*-arguments may be scalars, or array-likes of the same length as *xerr* and *yerr*. To use limits with inverted axes, [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") or [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") must be called before [`errorbar()`](#matplotlib.pyplot.errorbar "matplotlib.pyplot.errorbar"). Note the tricky parameter names: setting e.g. *lolims* to True means that the y-value is a *lower* limit of the True value, so, only an *upward*-pointing arrow will be drawn!
**errorevery**int or (int, int), default: 1
draws error bars on a subset of the data. *errorevery* =N draws error bars on the points (x[::N], y[::N]). *errorevery* =(start, N) draws error bars on the points (x[start::N], y[start::N]). e.g. errorevery=(6, 3) adds error bars to the data at (x[6], x[9], x[12], x[15], ...). Used to avoid overlapping error bars when two series share x-axis values.
Returns:
[`ErrorbarContainer`](../container_api#matplotlib.container.ErrorbarContainer "matplotlib.container.ErrorbarContainer")
The container contains:
* plotline: [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instance of x, y plot markers and/or line.
* caplines: A tuple of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances of the error bar caps.
* barlinecols: A tuple of [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") with the horizontal and vertical error ranges.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *xerr*, *yerr*
**\*\*kwargs**
All other keyword arguments are passed on to the [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") call drawing the markers. For example, this code makes big red squares with thick green edges:
```
x, y, yerr = rand(3, 10)
errorbar(x, y, yerr, marker='s', mfc='red',
mec='green', ms=20, mew=4)
```
where *mfc*, *mec*, *ms* and *mew* are aliases for the longer property names, *markerfacecolor*, *markeredgecolor*, *markersize* and *markeredgewidth*.
Valid kwargs for the marker properties are:
* *dashes*
* *dash\_capstyle*
* *dash\_joinstyle*
* *drawstyle*
* *fillstyle*
* *linestyle*
* *marker*
* *markeredgecolor*
* *markeredgewidth*
* *markerfacecolor*
* *markerfacecoloralt*
* *markersize*
* *markevery*
* *solid\_capstyle*
* *solid\_joinstyle*
Refer to the corresponding [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") property for more details:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.pyplot.errorbar`
-------------------------------------------
[Errorbar limit selection](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_limits_simple.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-limits-simple-py)
Errorbar limit selection
matplotlib matplotlib.axes.Axes.get_xlim matplotlib.axes.Axes.get\_xlim
==============================
Axes.get\_xlim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3576-L3596)
Return the x-axis view limits.
Returns:
**left, right**(float, float)
The current x-axis limits in data coordinates.
See also
[`Axes.set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim")
[`set_xbound`](matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound"), [`get_xbound`](matplotlib.axes.axes.get_xbound#matplotlib.axes.Axes.get_xbound "matplotlib.axes.Axes.get_xbound")
[`invert_xaxis`](matplotlib.axes.axes.invert_xaxis#matplotlib.axes.Axes.invert_xaxis "matplotlib.axes.Axes.invert_xaxis"), [`xaxis_inverted`](matplotlib.axes.axes.xaxis_inverted#matplotlib.axes.Axes.xaxis_inverted "matplotlib.axes.Axes.xaxis_inverted")
#### Notes
The x-axis may be inverted, in which case the *left* value will be greater than the *right* value.
Examples using `matplotlib.axes.Axes.get_xlim`
----------------------------------------------
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
matplotlib matplotlib.axes.Axes.get_frame_on matplotlib.axes.Axes.get\_frame\_on
===================================
Axes.get\_frame\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3134-L3136)
Get whether the Axes rectangle patch is drawn.
matplotlib matplotlib.artist.Artist.set_figure matplotlib.artist.Artist.set\_figure
====================================
Artist.set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
matplotlib matplotlib.axis.Axis.set_default_intervals matplotlib.axis.Axis.set\_default\_intervals
============================================
Axis.set\_default\_intervals()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1076-L1088)
Set the default limits for the axis data and view interval if they have not been not mutated yet.
matplotlib matplotlib.axis.Axis.get_offset_text matplotlib.axis.Axis.get\_offset\_text
======================================
Axis.get\_offset\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1335-L1337)
Return the axis offsetText as a Text instance.
matplotlib matplotlib.axes.Axes.semilogy matplotlib.axes.Axes.semilogy
=============================
Axes.semilogy(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L1854-L1898)
Make a plot with log scaling on the y axis.
Call signatures:
```
semilogy([x], y, [fmt], data=None, **kwargs)
semilogy([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
```
This is just a thin wrapper around [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") which additionally changes the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well.
The additional parameters *base*, *subs*, and *nonpositive* control the y-axis properties. They are just forwarded to [`Axes.set_yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale").
Parameters:
**base**float, default: 10
Base of the y logarithm.
**subs**array-like, optional
The location of the minor yticks. If *None*, reasonable locations are automatically chosen depending on the number of decades in the plot. See [`Axes.set_yscale`](matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") for details.
**nonpositive**{'mask', 'clip'}, default: 'mask'
Non-positive values in y can be masked as invalid, or clipped to a very small positive number.
**\*\*kwargs**
All parameters supported by [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Objects representing the plotted data.
Examples using `matplotlib.axes.Axes.semilogy`
----------------------------------------------
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
matplotlib matplotlib.pyplot.fill matplotlib.pyplot.fill
======================
matplotlib.pyplot.fill(*\*args*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2502-L2506)
Plot filled polygons.
Parameters:
**\*args**sequence of x, y, [color]
Each polygon is defined by the lists of *x* and *y* positions of its nodes, optionally followed by a *color* specifier. See [`matplotlib.colors`](../colors_api#module-matplotlib.colors "matplotlib.colors") for supported color specifiers. The standard color cycle is used for polygons without a color specifier.
You can plot multiple polygons by providing multiple *x*, *y*, *[color]* groups.
For example, each of the following is legal:
```
ax.fill(x, y) # a polygon with default color
ax.fill(x, y, "b") # a blue polygon
ax.fill(x, y, x2, y2) # two polygons
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
```
**data**indexable object, optional
An object with labelled data. If given, provide the label names to plot in *x* and *y*, e.g.:
```
ax.fill("time", "signal",
data={"time": [0, 1, 2], "signal": [0, 1, 0]})
```
Returns:
list of [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")
Other Parameters:
**\*\*kwargs**[`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties
#### Notes
Use [`fill_between()`](matplotlib.pyplot.fill_between#matplotlib.pyplot.fill_between "matplotlib.pyplot.fill_between") if you would like to fill the region between two curves.
Examples using `matplotlib.pyplot.fill`
---------------------------------------
[Filled polygon](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py)
Filled polygon
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
[Fill Spiral](https://matplotlib.org/stable/gallery/misc/fill_spiral.html#sphx-glr-gallery-misc-fill-spiral-py)
Fill Spiral
| programming_docs |
matplotlib matplotlib.axes.Axes.contains_point matplotlib.axes.Axes.contains\_point
====================================
Axes.contains\_point(*point*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L4332-L4337)
Return whether *point* (pair of pixel coordinates) is inside the Axes patch.
matplotlib matplotlib.artist.Artist.set_zorder matplotlib.artist.Artist.set\_zorder
====================================
Artist.set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
Examples using `matplotlib.artist.Artist.set_zorder`
----------------------------------------------------
[SVG Filter Pie](https://matplotlib.org/stable/gallery/misc/svg_filter_pie.html#sphx-glr-gallery-misc-svg-filter-pie-py)
SVG Filter Pie
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
matplotlib matplotlib.lines.Line2D matplotlib.lines.Line2D
=======================
*class*matplotlib.lines.Line2D(*xdata*, *ydata*, *\**, *linewidth=None*, *linestyle=None*, *color=None*, *gapcolor=None*, *marker=None*, *markersize=None*, *markeredgewidth=None*, *markeredgecolor=None*, *markerfacecolor=None*, *markerfacecoloralt='none'*, *fillstyle=None*, *antialiased=None*, *dash\_capstyle=None*, *solid\_capstyle=None*, *dash\_joinstyle=None*, *solid\_joinstyle=None*, *pickradius=5*, *drawstyle=None*, *markevery=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L204-L1447)
Bases: [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. Additionally, the drawing of the solid line is influenced by the drawstyle, e.g., one can create "stepped" lines in various styles.
Create a [`Line2D`](#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instance with *x* and *y* data in sequences of *xdata*, *ydata*.
Additional keyword arguments are [`Line2D`](#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See [`set_linestyle()`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a description of the line styles, [`set_marker()`](#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") for a description of the markers, and [`set_drawstyle()`](#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") for a description of the draw styles.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L414-L482)
Test whether *mouseevent* occurred on the line.
An event is deemed to have occurred "on" the line if it is less than `self.pickradius` (default: 5 points) away from it. Use [`get_pickradius`](#matplotlib.lines.Line2D.get_pickradius "matplotlib.lines.Line2D.get_pickradius") or [`set_pickradius`](#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") to get or set the pick radius.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](../backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
A dictionary `{'ind': pointlist}`, where *pointlist* is a list of points of the line that are within the pickradius around the event position.
TODO: sort returned indices by distance
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L731-L881)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](../backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
drawStyleKeys*=['default', 'steps-mid', 'steps-pre', 'steps-post', 'steps']*
drawStyles*={'default': '\_draw\_lines', 'steps': '\_draw\_steps\_pre', 'steps-mid': '\_draw\_steps\_mid', 'steps-post': '\_draw\_steps\_post', 'steps-pre': '\_draw\_steps\_pre'}*
fillStyles*=('full', 'left', 'right', 'bottom', 'top', 'none')*
filled\_markers*=('o', 'v', '^', '<', '>', '8', 's', 'p', '\*', 'h', 'H', 'D', 'd', 'P', 'X')*
get\_aa()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L883-L885)
Alias for [`get_antialiased`](#matplotlib.lines.Line2D.get_antialiased "matplotlib.lines.Line2D.get_antialiased").
get\_antialiased()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L883-L885)
Return whether antialiased rendering is used.
get\_bbox()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L620-L624)
Get the bounding box of this line.
get\_c()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L887-L893)
Alias for [`get_color`](#matplotlib.lines.Line2D.get_color "matplotlib.lines.Line2D.get_color").
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L887-L893)
Return the line color.
See also [`set_color`](#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color").
get\_dash\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1422-L1428)
Return the [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for dashed lines.
See also [`set_dash_capstyle`](#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle").
get\_dash\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1374-L1380)
Return the [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for dashed lines.
See also [`set_dash_joinstyle`](#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle").
get\_data(*orig=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L994-L1000)
Return the line data as an `(xdata, ydata)` pair.
If *orig* is *True*, return the original data.
get\_drawstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L895-L901)
Return the drawstyle.
See also [`set_drawstyle`](#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle").
get\_ds()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L895-L901)
Alias for [`get_drawstyle`](#matplotlib.lines.Line2D.get_drawstyle "matplotlib.lines.Line2D.get_drawstyle").
get\_fillstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L510-L516)
Return the marker fill style.
See also [`set_fillstyle`](#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle").
get\_gapcolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L903-L909)
Return the line gapcolor.
See also [`set_gapcolor`](#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor").
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L911-L917)
Return the linestyle.
See also [`set_linestyle`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L919-L925)
Return the linewidth in points.
See also [`set_linewidth`](#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L911-L917)
Alias for [`get_linestyle`](#matplotlib.lines.Line2D.get_linestyle "matplotlib.lines.Line2D.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L919-L925)
Alias for [`get_linewidth`](#matplotlib.lines.Line2D.get_linewidth "matplotlib.lines.Line2D.get_linewidth").
get\_marker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L927-L933)
Return the line marker.
See also [`set_marker`](#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker").
get\_markeredgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L935-L951)
Return the marker edge color.
See also [`set_markeredgecolor`](#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor").
get\_markeredgewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L953-L959)
Return the marker edge width in points.
See also [`set_markeredgewidth`](#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth").
get\_markerfacecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L970-L976)
Return the marker face color.
See also [`set_markerfacecolor`](#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor").
get\_markerfacecoloralt()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L978-L984)
Return the alternate marker face color.
See also [`set_markerfacecoloralt`](#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt").
get\_markersize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L986-L992)
Return the marker size in points.
See also [`set_markersize`](#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize").
get\_markevery()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L597-L603)
Return the markevery setting for marker subsampling.
See also [`set_markevery`](#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery").
get\_mec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L935-L951)
Alias for [`get_markeredgecolor`](#matplotlib.lines.Line2D.get_markeredgecolor "matplotlib.lines.Line2D.get_markeredgecolor").
get\_mew()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L953-L959)
Alias for [`get_markeredgewidth`](#matplotlib.lines.Line2D.get_markeredgewidth "matplotlib.lines.Line2D.get_markeredgewidth").
get\_mfc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L970-L976)
Alias for [`get_markerfacecolor`](#matplotlib.lines.Line2D.get_markerfacecolor "matplotlib.lines.Line2D.get_markerfacecolor").
get\_mfcalt()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L978-L984)
Alias for [`get_markerfacecoloralt`](#matplotlib.lines.Line2D.get_markerfacecoloralt "matplotlib.lines.Line2D.get_markerfacecoloralt").
get\_ms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L986-L992)
Alias for [`get_markersize`](#matplotlib.lines.Line2D.get_markersize "matplotlib.lines.Line2D.get_markersize").
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1028-L1032)
Return the [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") associated with this line.
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L484-L490)
Return the pick radius used for containment tests.
See [`contains`](#matplotlib.lines.Line2D.contains "matplotlib.lines.Line2D.contains") for more details.
get\_solid\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1430-L1436)
Return the [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for solid lines.
See also [`set_solid_capstyle`](#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle").
get\_solid\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1382-L1388)
Return the [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for solid lines.
See also [`set_solid_joinstyle`](#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle").
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L626-L635)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_xdata(*orig=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1002-L1013)
Return the xdata.
If *orig* is *True*, return the original data, else the processed data.
get\_xydata()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1034-L1040)
Return the *xy* data as a Nx2 numpy array.
get\_ydata(*orig=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1015-L1026)
Return the ydata.
If *orig* is *True*, return the original data, else the processed data.
is\_dashed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1438-L1447)
Return whether line has a dashed linestyle.
A custom linestyle is assumed to be dashed, we do not inspect the `onoffseq` directly.
See also [`set_linestyle`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle").
lineStyles*={'': '\_draw\_nothing', ' ': '\_draw\_nothing', '-': '\_draw\_solid', '--': '\_draw\_dashed', '-.': '\_draw\_dash\_dot', ':': '\_draw\_dotted', 'None': '\_draw\_nothing'}*
markers*={'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle\_down', '^': 'triangle\_up', '<': 'triangle\_left', '>': 'triangle\_right', '1': 'tri\_down', '2': 'tri\_up', '3': 'tri\_left', '4': 'tri\_right', '8': 'octagon', 's': 'square', 'p': 'pentagon', '\*': 'star', 'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 'D': 'diamond', 'd': 'thin\_diamond', '|': 'vline', '\_': 'hline', 'P': 'plus\_filled', 'X': 'x\_filled', 0: 'tickleft', 1: 'tickright', 2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 10: 'caretupbase', 11: 'caretdownbase', 'None': 'nothing', 'none': 'nothing', ' ': 'nothing', '': 'nothing'}*
*property*pickradius
Return the pick radius used for containment tests.
See [`contains`](#matplotlib.lines.Line2D.contains "matplotlib.lines.Line2D.contains") for more details.
recache(*always=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L656-L697)
recache\_always()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L653-L654)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *dash\_capstyle=<UNSET>*, *dash\_joinstyle=<UNSET>*, *dashes=<UNSET>*, *data=<UNSET>*, *drawstyle=<UNSET>*, *fillstyle=<UNSET>*, *gapcolor=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *marker=<UNSET>*, *markeredgecolor=<UNSET>*, *markeredgewidth=<UNSET>*, *markerfacecolor=<UNSET>*, *markerfacecoloralt=<UNSET>*, *markersize=<UNSET>*, *markevery=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *solid\_capstyle=<UNSET>*, *solid\_joinstyle=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xdata=<UNSET>*, *ydata=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") | color |
| [`dash_capstyle`](#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") | float |
| [`marker`](#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") | color |
| [`markeredgewidth`](#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") | float |
| [`markerfacecolor`](#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") | color |
| [`markerfacecoloralt`](#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") | color |
| [`markersize`](#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") | float |
| [`markevery`](#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1042-L1052)
Alias for [`set_antialiased`](#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased").
set\_antialiased(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1042-L1052)
Set whether to use antialiased rendering.
Parameters:
**b**bool
set\_c(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1054-L1064)
Alias for [`set_color`](#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color").
set\_color(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1054-L1064)
Set the color of the line.
Parameters:
**color**color
set\_dash\_capstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1390-L1404)
How to draw the end caps if the line is [`is_dashed`](#matplotlib.lines.Line2D.is_dashed "matplotlib.lines.Line2D.is_dashed").
The default capstyle is `[rcParams["lines.dash\_capstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.dash_capstyle#matplotlibrc-sample)` (default: `<CapStyle.butt: 'butt'>`).
Parameters:
**s**[`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_dash\_joinstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1342-L1356)
How to join segments of the line if it [`is_dashed`](#matplotlib.lines.Line2D.is_dashed "matplotlib.lines.Line2D.is_dashed").
The default joinstyle is `[rcParams["lines.dash\_joinstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.dash_joinstyle#matplotlibrc-sample)` (default: `<JoinStyle.round: 'round'>`).
Parameters:
**s**[`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_dashes(*seq*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1295-L1317)
Set the dash sequence.
The dash sequence is a sequence of floats of even length describing the length of dashes and spaces in points.
For example, (5, 2, 1, 2) describes a sequence of 5 point and 1 point dashes separated by 2 point spaces.
See also [`set_gapcolor`](#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor"), which allows those spaces to be filled with a color.
Parameters:
**seq**sequence of floats (on/off ink in points) or (None, None)
If *seq* is empty or `(None, None)`, the linestyle will be set to solid.
set\_data(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L637-L651)
Set the x and y data.
Parameters:
**\*args**(2, N) array or two 1D arrays
set\_drawstyle(*drawstyle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1066-L1099)
Set the drawstyle of the plot.
The drawstyle determines how the points are connected.
Parameters:
**drawstyle**{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
For 'default', the points are connected with straight lines.
The steps variants connect the points with step-like lines, i.e. horizontal lines with vertical steps. They differ in the location of the step:
* 'steps-pre': The step is at the beginning of the line segment, i.e. the line will be at the y-value of point to the right.
* 'steps-mid': The step is halfway between the points.
* 'steps-post: The step is at the end of the line segment, i.e. the line will be at the y-value of the point to the left.
* 'steps' is equal to 'steps-pre' and is maintained for backward-compatibility.
For examples see [Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html).
set\_ds(*drawstyle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1066-L1099)
Alias for [`set_drawstyle`](#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle").
set\_fillstyle(*fs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L518-L536)
Set the marker fill style.
Parameters:
**fs**{'full', 'left', 'right', 'bottom', 'top', 'none'}
Possible values:
* 'full': Fill the whole marker with the *markerfacecolor*.
* 'left', 'right', 'bottom', 'top': Fill the marker half at the given side with the *markerfacecolor*. The other half of the marker is filled with *markerfacecoloralt*.
* 'none': No filling.
For examples see [Marker fill styles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html#marker-fill-styles).
set\_gapcolor(*gapcolor*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1101-L1122)
Set a color to fill the gaps in the dashed line style.
Note
Striped lines are created by drawing two interleaved dashed lines. There can be overlaps between those two, which may result in artifacts when using transparency.
This functionality is experimental and may change.
Parameters:
**gapcolor**color or None
The color with which to fill the gaps. If None, the gaps are unfilled.
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1139-L1182)
Set the linestyle of the line.
Parameters:
**ls**{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
Possible values:
* A string:
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
| `'none'`, `'None'`, `' '`, or `''` | draw nothing |
* Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq)
```
where `onoffseq` is an even length tuple of on and off ink in points. See also [`set_dashes()`](#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes").
For examples see [Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html).
set\_linewidth(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1124-L1137)
Set the line width in points.
Parameters:
**w**float
Line width, in points.
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1139-L1182)
Alias for [`set_linestyle`](#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle").
set\_lw(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1124-L1137)
Alias for [`set_linewidth`](#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth").
set\_marker(*marker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1184-L1196)
Set the line marker.
Parameters:
**marker**marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle")
See [`markers`](../markers_api#module-matplotlib.markers "matplotlib.markers") for full description of possible arguments.
set\_markeredgecolor(*ec*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1212-L1220)
Set the marker edge color.
Parameters:
**ec**color
set\_markeredgewidth(*ew*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1242-L1255)
Set the marker edge width in points.
Parameters:
**ew**float
Marker edge width, in points.
set\_markerfacecolor(*fc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1222-L1230)
Set the marker face color.
Parameters:
**fc**color
set\_markerfacecoloralt(*fc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1232-L1240)
Set the alternate marker face color.
Parameters:
**fc**color
set\_markersize(*sz*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1257-L1269)
Set the marker size in points.
Parameters:
**sz**float
Marker size, in points.
set\_markevery(*every*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L538-L595)
Set the markevery property to subsample the plot when using markers.
e.g., if `every=5`, every 5-th marker will be plotted.
Parameters:
**every**None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
Which markers to plot.
* `every=None`: every point will be plotted.
* `every=N`: every N-th marker will be plotted starting with marker 0.
* `every=(start, N)`: every N-th marker, starting at index *start*, will be plotted.
* `every=slice(start, end, N)`: every N-th marker, starting at index *start*, up to but not including index *end*, will be plotted.
* `every=[i, j, m, ...]`: only markers at the given indices will be plotted.
* `every=[True, False, True, ...]`: only positions that are True will be plotted. The list must have the same length as the data points.
* `every=0.1`, (i.e. a float): markers will be spaced at approximately equal visual distances along the line; the distance along the line between markers is determined by multiplying the display-coordinate distance of the axes bounding-box diagonal by the value of *every*.
* `every=(0.5, 0.1)` (i.e. a length-2 tuple of float): similar to `every=0.1` but the first marker will be offset along the line by 0.5 multiplied by the display-coordinate-diagonal-distance along the line.
For examples see [Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html).
#### Notes
Setting *markevery* will still only draw markers at actual data points. While the float argument form aims for uniform visual spacing, it has to coerce from the ideal spacing to the nearest available data point. Depending on the number and distribution of data points, the result may still not look evenly spaced.
When using a start offset to specify the first marker, the offset will be from the first data point which may be different from the first the visible data point if the plot is zoomed in.
If zooming in on a plot when using float arguments then the actual data points that have markers will change because the distance between markers is always determined from the display-coordinates axes-bounding-box-diagonal regardless of the actual axes data limits.
set\_mec(*ec*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1212-L1220)
Alias for [`set_markeredgecolor`](#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor").
set\_mew(*ew*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1242-L1255)
Alias for [`set_markeredgewidth`](#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth").
set\_mfc(*fc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1222-L1230)
Alias for [`set_markerfacecolor`](#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor").
set\_mfcalt(*fc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1232-L1240)
Alias for [`set_markerfacecoloralt`](#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt").
set\_ms(*sz*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1257-L1269)
Alias for [`set_markersize`](#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize").
set\_picker(*p*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L605-L618)
Set the event picker details for the line.
Parameters:
**p**float or callable[[Artist, Event], tuple[bool, dict]]
If a float, it is used as the pick radius in points.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L492-L506)
Set the pick radius used for containment tests.
See [`contains`](#matplotlib.lines.Line2D.contains "matplotlib.lines.Line2D.contains") for more details.
Parameters:
**pickradius**float
Pick radius, in points.
set\_solid\_capstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1406-L1420)
How to draw the end caps if the line is solid (not [`is_dashed`](#matplotlib.lines.Line2D.is_dashed "matplotlib.lines.Line2D.is_dashed"))
The default capstyle is `[rcParams["lines.solid\_capstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.solid_capstyle#matplotlibrc-sample)` (default: `<CapStyle.projecting: 'projecting'>`).
Parameters:
**s**[`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_solid\_joinstyle(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1358-L1372)
How to join segments if the line is solid (not [`is_dashed`](#matplotlib.lines.Line2D.is_dashed "matplotlib.lines.Line2D.is_dashed")).
The default joinstyle is `[rcParams["lines.solid\_joinstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.solid_joinstyle#matplotlibrc-sample)` (default: `<JoinStyle.round: 'round'>`).
Parameters:
**s**[`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L720-L724)
Set the artist transform.
Parameters:
**t**[`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_xdata(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1271-L1281)
Set the data array for x.
Parameters:
**x**1D array
set\_ydata(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1283-L1293)
Set the data array for y.
Parameters:
**y**1D array
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/lines.py#L1319-L1340)
Copy properties from *other* to self.
zorder*=2*
Examples using `matplotlib.lines.Line2D`
----------------------------------------
[Customizing dashed line styles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/line_demo_dash_control.html#sphx-glr-gallery-lines-bars-and-markers-line-demo-dash-control-py)
Customizing dashed line styles
[Stem Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stem_plot.html#sphx-glr-gallery-lines-bars-and-markers-stem-plot-py)
Stem Plot
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[Annotation arrow style reference](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fancyarrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-fancyarrow-demo-py)
Annotation arrow style reference
[Figure legend demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/figlegend_demo.html#sphx-glr-gallery-text-labels-and-annotations-figlegend-demo-py)
Figure legend demo
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[Artist within an artist](https://matplotlib.org/stable/gallery/text_labels_and_annotations/line_with_text.html#sphx-glr-gallery-text-labels-and-annotations-line-with-text-py)
Artist within an artist
[Annotating a plot](https://matplotlib.org/stable/gallery/pyplots/annotation_basic.html#sphx-glr-gallery-pyplots-annotation-basic-py)
Annotating a plot
[Annotation Polar](https://matplotlib.org/stable/gallery/pyplots/annotation_polar.html#sphx-glr-gallery-pyplots-annotation-polar-py)
Annotation Polar
[Simple axes labels](https://matplotlib.org/stable/gallery/pyplots/fig_axes_labels_simple.html#sphx-glr-gallery-pyplots-fig-axes-labels-simple-py)
Simple axes labels
[Adding lines to figures](https://matplotlib.org/stable/gallery/pyplots/fig_x.html#sphx-glr-gallery-pyplots-fig-x-py)
Adding lines to figures
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[Parasite Simple](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py)
Parasite Simple
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
 [The double pendulum problem](https://matplotlib.org/stable/gallery/animation/double_pendulum.html#sphx-glr-gallery-animation-double-pendulum-py)
The double pendulum problem
[Animated line plot](https://matplotlib.org/stable/gallery/animation/simple_anim.html#sphx-glr-gallery-animation-simple-anim-py)
Animated line plot
[Oscilloscope](https://matplotlib.org/stable/gallery/animation/strip_chart.html#sphx-glr-gallery-animation-strip-chart-py)
Oscilloscope
 [MATPLOTLIB UNCHAINED](https://matplotlib.org/stable/gallery/animation/unchained.html#sphx-glr-gallery-animation-unchained-py)
MATPLOTLIB \*\*UNCHAINED\*\*
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Pick Event Demo2](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo2.html#sphx-glr-gallery-event-handling-pick-event-demo2-py)
Pick Event Demo2
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Resampling Data](https://matplotlib.org/stable/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py)
Resampling Data
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[SVG Filter Line](https://matplotlib.org/stable/gallery/misc/svg_filter_line.html#sphx-glr-gallery-misc-svg-filter-line-py)
SVG Filter Line
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Custom tick formatter for time series](https://matplotlib.org/stable/gallery/ticks/date_index_formatter.html#sphx-glr-gallery-ticks-date-index-formatter-py)
Custom tick formatter for time series
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Simple Legend02](https://matplotlib.org/stable/gallery/userdemo/simple_legend02.html#sphx-glr-gallery-userdemo-simple-legend02-py)
Simple Legend02
[Annotated Cursor](https://matplotlib.org/stable/gallery/widgets/annotated_cursor.html#sphx-glr-gallery-widgets-annotated-cursor-py)
Annotated Cursor
[Buttons](https://matplotlib.org/stable/gallery/widgets/buttons.html#sphx-glr-gallery-widgets-buttons-py)
Buttons
[Check Buttons](https://matplotlib.org/stable/gallery/widgets/check_buttons.html#sphx-glr-gallery-widgets-check-buttons-py)
Check Buttons
[Radio Buttons](https://matplotlib.org/stable/gallery/widgets/radio_buttons.html#sphx-glr-gallery-widgets-radio-buttons-py)
Radio Buttons
[Thresholding an Image with RangeSlider](https://matplotlib.org/stable/gallery/widgets/range_slider.html#sphx-glr-gallery-widgets-range-slider-py)
Thresholding an Image with RangeSlider
[Slider](https://matplotlib.org/stable/gallery/widgets/slider_demo.html#sphx-glr-gallery-widgets-slider-demo-py)
Slider
[Snapping Sliders to Discrete Values](https://matplotlib.org/stable/gallery/widgets/slider_snap_demo.html#sphx-glr-gallery-widgets-slider-snap-demo-py)
Snapping Sliders to Discrete Values
[Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html#sphx-glr-gallery-widgets-span-selector-py)
Span Selector
[Textbox](https://matplotlib.org/stable/gallery/widgets/textbox.html#sphx-glr-gallery-widgets-textbox-py)
Textbox
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html#sphx-glr-tutorials-advanced-blitting-py)
Faster rendering by using blitting
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
| programming_docs |
matplotlib matplotlib.axes.Axes.has_data matplotlib.axes.Axes.has\_data
==============================
Axes.has\_data()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2214-L2224)
Return whether any artists have been added to the Axes.
This should not be used to determine whether the *dataLim* need to be updated, and may not actually be useful for anything.
matplotlib matplotlib.pyplot.boxplot matplotlib.pyplot.boxplot
=========================
matplotlib.pyplot.boxplot(*x*, *notch=None*, *sym=None*, *vert=None*, *whis=None*, *positions=None*, *widths=None*, *patch\_artist=None*, *bootstrap=None*, *usermedians=None*, *conf\_intervals=None*, *meanline=None*, *showmeans=None*, *showcaps=None*, *showbox=None*, *showfliers=None*, *boxprops=None*, *labels=None*, *flierprops=None*, *medianprops=None*, *meanprops=None*, *capprops=None*, *whiskerprops=None*, *manage\_ticks=True*, *autorange=False*, *zorder=None*, *capwidths=None*, *\**, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2389-L2410)
Draw a box and whisker plot.
The box extends from the first quartile (Q1) to the third quartile (Q3) of the data, with a line at the median. The whiskers extend from the box by 1.5x the inter-quartile range (IQR). Flier points are those past the end of the whiskers. See <https://en.wikipedia.org/wiki/Box_plot> for reference.
```
Q1-1.5IQR Q1 median Q3 Q3+1.5IQR
|-----:-----|
o |--------| : |--------| o o
|-----:-----|
flier <-----------> fliers
IQR
```
Parameters:
**x**Array or a sequence of vectors.
The input data. If a 2D array, a boxplot is drawn for each column in *x*. If a sequence of 1D arrays, a boxplot is drawn for each array in *x*.
**notch**bool, default: False
Whether to draw a notched boxplot ([`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)")), or a rectangular boxplot ([`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)")). The notches represent the confidence interval (CI) around the median. The documentation for *bootstrap* describes how the locations of the notches are computed by default, but their locations may also be overridden by setting the *conf\_intervals* parameter.
Note
In cases where the values of the CI are less than the lower quartile or greater than the upper quartile, the notches will extend beyond the box, giving it a distinctive "flipped" appearance. This is expected behavior and consistent with other statistical visualization packages.
**sym**str, optional
The default symbol for flier points. An empty string ('') hides the fliers. If [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), then the fliers default to 'b+'. More control is provided by the *flierprops* parameter.
**vert**bool, default: True
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), draws vertical boxes. If [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)"), draw horizontal boxes.
**whis**float or (float, float), default: 1.5
The position of the whiskers.
If a float, the lower whisker is at the lowest datum above `Q1 - whis*(Q3-Q1)`, and the upper whisker at the highest datum below `Q3 + whis*(Q3-Q1)`, where Q1 and Q3 are the first and third quartiles. The default value of `whis = 1.5` corresponds to Tukey's original definition of boxplots.
If a pair of floats, they indicate the percentiles at which to draw the whiskers (e.g., (5, 95)). In particular, setting this to (0, 100) results in whiskers covering the whole range of the data.
In the edge case where `Q1 == Q3`, *whis* is automatically set to (0, 100) (cover the whole range of the data) if *autorange* is True.
Beyond the whiskers, data are considered outliers and are plotted as individual points.
**bootstrap**int, optional
Specifies whether to bootstrap the confidence intervals around the median for notched boxplots. If *bootstrap* is None, no bootstrapping is performed, and notches are calculated using a Gaussian-based asymptotic approximation (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and Kendall and Stuart, 1967). Otherwise, bootstrap specifies the number of times to bootstrap the median to determine its 95% confidence intervals. Values between 1000 and 10000 are recommended.
**usermedians**1D array-like, optional
A 1D array-like of length `len(x)`. Each entry that is not [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)") forces the value of the median for the corresponding dataset. For entries that are [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), the medians are computed by Matplotlib as normal.
**conf\_intervals**array-like, optional
A 2D array-like of shape `(len(x), 2)`. Each entry that is not None forces the location of the corresponding notch (which is only drawn if *notch* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)")). For entries that are [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), the notches are computed by the method specified by the other parameters (e.g., *bootstrap*).
**positions**array-like, optional
The positions of the boxes. The ticks and limits are automatically set to match the positions. Defaults to `range(1, N+1)` where N is the number of boxes to be drawn.
**widths**float or array-like
The widths of the boxes. The default is 0.5, or `0.15*(distance
between extreme positions)`, if that is smaller.
**patch\_artist**bool, default: False
If [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)") produces boxes with the Line2D artist. Otherwise, boxes are drawn with Patch artists.
**labels**sequence, optional
Labels for each dataset (one per dataset).
**manage\_ticks**bool, default: True
If True, the tick locations and labels will be adjusted to match the boxplot positions.
**autorange**bool, default: False
When [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") and the data are distributed such that the 25th and 75th percentiles are equal, *whis* is set to (0, 100) such that the whisker ends are at the minimum and maximum of the data.
**meanline**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") (and *showmeans* is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)")), will try to render the mean as a line spanning the full width of the box according to *meanprops* (see below). Not recommended if *shownotches* is also True. Otherwise, means will be shown as points.
**zorder**float, default: `Line2D.zorder = 2`
The zorder of the boxplot.
Returns:
dict
A dictionary mapping each component of the boxplot to a list of the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances created. That dictionary has the following keys (assuming vertical boxplots):
* `boxes`: the main body of the boxplot showing the quartiles and the median's confidence intervals if enabled.
* `medians`: horizontal lines at the median of each box.
* `whiskers`: the vertical lines extending to the most extreme, non-outlier data points.
* `caps`: the horizontal lines at the ends of the whiskers.
* `fliers`: points representing data that extend beyond the whiskers (fliers).
* `means`: points or lines representing the means.
Other Parameters:
**showcaps**bool, default: True
Show the caps on the ends of whiskers.
**showbox**bool, default: True
Show the central box.
**showfliers**bool, default: True
Show the outliers beyond the caps.
**showmeans**bool, default: False
Show the arithmetic means.
**capprops**dict, default: None
The style of the caps.
**capwidths**float or array, default: None
The widths of the caps.
**boxprops**dict, default: None
The style of the box.
**whiskerprops**dict, default: None
The style of the whiskers.
**flierprops**dict, default: None
The style of the fliers.
**medianprops**dict, default: None
The style of the median.
**meanprops**dict, default: None
The style of the mean.
**data**indexable object, optional
If given, all parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception).
See also
[`violinplot`](matplotlib.pyplot.violinplot#matplotlib.pyplot.violinplot "matplotlib.pyplot.violinplot")
Draw an estimate of the probability density function.
matplotlib matplotlib.pyplot.sca matplotlib.pyplot.sca
=====================
matplotlib.pyplot.sca(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1065-L1070)
Set the current Axes to *ax* and the current Figure to the parent of *ax*.
matplotlib matplotlib.axis.Axis.get_gridlines matplotlib.axis.Axis.get\_gridlines
===================================
Axis.get\_gridlines()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1325-L1329)
Return this Axis' grid lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
matplotlib matplotlib.axis.XAxis.get_text_heights matplotlib.axis.XAxis.get\_text\_heights
========================================
XAxis.get\_text\_heights(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2306-L2327)
[*Deprecated*] Return how much space should be reserved for text above and below the Axes, as a pair of floats.
#### Notes
Deprecated since version 3.6.
matplotlib matplotlib.axis.YAxis.get_text_widths matplotlib.axis.YAxis.get\_text\_widths
=======================================
YAxis.get\_text\_widths(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2564-L2581)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib mpl_toolkits.axes_grid1.parasite_axes.host_subplot mpl\_toolkits.axes\_grid1.parasite\_axes.host\_subplot
======================================================
mpl\_toolkits.axes\_grid1.parasite\_axes.host\_subplot(*\*args*, *axes\_class=<class 'mpl\_toolkits.axes\_grid1.mpl\_axes.Axes'>*, *figure=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py#L263-L282)
Create a subplot that can act as a host to parasitic axes.
Parameters:
**figure**[`matplotlib.figure.Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
Figure to which the subplot will be added. Defaults to the current figure [`pyplot.gcf()`](matplotlib.pyplot.gcf#matplotlib.pyplot.gcf "matplotlib.pyplot.gcf").
**\*args, \*\*kwargs**
Will be passed on to the underlying `Axes` object creation.
matplotlib mpl_toolkits.axisartist.axislines mpl\_toolkits.axisartist.axislines
==================================
Axislines includes modified implementation of the Axes class. The biggest difference is that the artists responsible for drawing the axis spine, ticks, ticklabels and axis labels are separated out from Matplotlib's Axis class. Originally, this change was motivated to support curvilinear grid. Here are a few reasons that I came up with a new axes class:
* "top" and "bottom" x-axis (or "left" and "right" y-axis) can have different ticks (tick locations and labels). This is not possible with the current Matplotlib, although some twin axes trick can help.
* Curvilinear grid.
* angled ticks.
In the new axes class, xaxis and yaxis is set to not visible by default, and new set of artist (AxisArtist) are defined to draw axis line, ticks, ticklabels and axis label. Axes.axis attribute serves as a dictionary of these artists, i.e., ax.axis["left"] is a AxisArtist instance responsible to draw left y-axis. The default Axes.axis contains "bottom", "left", "top" and "right".
AxisArtist can be considered as a container artist and has following children artists which will draw ticks, labels, etc.
* line
* major\_ticks, major\_ticklabels
* minor\_ticks, minor\_ticklabels
* offsetText
* label
Note that these are separate artists from [`matplotlib.axis.Axis`](../axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis"), thus most tick-related functions in Matplotlib won't work. For example, color and markerwidth of the `ax.axis["bottom"].major_ticks` will follow those of Axes.xaxis unless explicitly specified.
In addition to AxisArtist, the Axes will have *gridlines* attribute, which obviously draws grid lines. The gridlines needs to be separated from the axis as some gridlines can never pass any axis.
Classes
-------
| | |
| --- | --- |
| [`Axes`](mpl_toolkits.axisartist.axislines.axes#mpl_toolkits.axisartist.axislines.Axes "mpl_toolkits.axisartist.axislines.Axes")(\*args[, grid\_helper]) | Build an Axes in a figure. |
| [`AxesZero`](mpl_toolkits.axisartist.axislines.axeszero#mpl_toolkits.axisartist.axislines.AxesZero "mpl_toolkits.axisartist.axislines.AxesZero")(\*args[, grid\_helper]) | Build an Axes in a figure. |
| [`AxisArtistHelper`](mpl_toolkits.axisartist.axislines.axisartisthelper#mpl_toolkits.axisartist.axislines.AxisArtistHelper "mpl_toolkits.axisartist.axislines.AxisArtistHelper")() | AxisArtistHelper should define following method with given APIs. Note that the first axes argument will be axes attribute of the caller artist.::. |
| [`AxisArtistHelperRectlinear`](mpl_toolkits.axisartist.axislines.axisartisthelperrectlinear#mpl_toolkits.axisartist.axislines.AxisArtistHelperRectlinear "mpl_toolkits.axisartist.axislines.AxisArtistHelperRectlinear")() | |
| [`GridHelperBase`](mpl_toolkits.axisartist.axislines.gridhelperbase#mpl_toolkits.axisartist.axislines.GridHelperBase "mpl_toolkits.axisartist.axislines.GridHelperBase")() | |
| [`GridHelperRectlinear`](mpl_toolkits.axisartist.axislines.gridhelperrectlinear#mpl_toolkits.axisartist.axislines.GridHelperRectlinear "mpl_toolkits.axisartist.axislines.GridHelperRectlinear")(axes) | |
matplotlib matplotlib.artist.Artist.set_path_effects matplotlib.artist.Artist.set\_path\_effects
===========================================
Artist.set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
Examples using `matplotlib.artist.Artist.set_path_effects`
----------------------------------------------------------
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Path effects guide](https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py)
Path effects guide
matplotlib matplotlib.axes.Axes.findobj matplotlib.axes.Axes.findobj
============================
Axes.findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
matplotlib mpl_toolkits.axisartist.floating_axes.FixedAxisArtistHelper mpl\_toolkits.axisartist.floating\_axes.FixedAxisArtistHelper
=============================================================
*class*mpl\_toolkits.axisartist.floating\_axes.FixedAxisArtistHelper(*grid\_helper*, *side*, *nth\_coord\_ticks=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py#L30-L134)
Bases: [`FloatingAxisArtistHelper`](mpl_toolkits.axisartist.grid_helper_curvelinear.floatingaxisartisthelper#mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper "mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper")
nth\_coord = along which coordinate value varies.
nth\_coord = 0 -> x axis, nth\_coord = 1 -> y axis
get\_line(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py#L127-L134)
get\_tick\_iterators(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py#L51-L125)
tick\_loc, tick\_angle, tick\_label, (optionally) tick\_label
update\_lim(*axes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/floating_axes.py#L47-L49)
matplotlib mpl_toolkits.axisartist.axes_grid.ImageGrid mpl\_toolkits.axisartist.axes\_grid.ImageGrid
=============================================
*class*mpl\_toolkits.axisartist.axes\_grid.ImageGrid(*fig*, *rect*, *nrows\_ncols*, *ngrids=None*, *direction='row'*, *axes\_pad=0.02*, *\**, *share\_all=False*, *aspect=True*, *label\_mode='L'*, *cbar\_mode=None*, *cbar\_location='right'*, *cbar\_pad=None*, *cbar\_size='5%'*, *cbar\_set\_cax=True*, *axes\_class=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/axes_grid.py#L15-L16)
Bases: [`ImageGrid`](mpl_toolkits.axes_grid1.axes_grid.imagegrid#mpl_toolkits.axes_grid1.axes_grid.ImageGrid "mpl_toolkits.axes_grid1.axes_grid.ImageGrid")
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The parent figure.
**rect**(float, float, float, float) or int
The axes position, as a `(left, bottom, width, height)` tuple or as a three-digit subplot position code (e.g., "121").
**nrows\_ncols**(int, int)
Number of rows and columns in the grid.
**ngrids**int or None, default: None
If not None, only the first *ngrids* axes in the grid are created.
**direction**{"row", "column"}, default: "row"
Whether axes are created in row-major ("row by row") or column-major order ("column by column"). This also affects the order in which axes are accessed using indexing (`grid[index]`).
**axes\_pad**float or (float, float), default: 0.02in
Padding or (horizontal padding, vertical padding) between axes, in inches.
**share\_all**bool, default: False
Whether all axes share their x- and y-axis.
**aspect**bool, default: True
Whether the axes aspect ratio follows the aspect ratio of the data limits.
**label\_mode**{"L", "1", "all"}, default: "L"
Determines which axes will get tick labels:
* "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels.
* "1": Only the bottom left axes is labelled.
* "all": all axes are labelled.
**cbar\_mode**{"each", "single", "edge", None}, default: None
Whether to create a colorbar for "each" axes, a "single" colorbar for the entire grid, colorbars only for axes on the "edge" determined by *cbar\_location*, or no colorbars. The colorbars are stored in the `cbar_axes` attribute.
**cbar\_location**{"left", "right", "bottom", "top"}, default: "right"
**cbar\_pad**float, default: None
Padding between the image axes and the colorbar axes.
**cbar\_size**size specification (see `Size.from_any`), default: "5%"
Colorbar size.
**cbar\_set\_cax**bool, default: True
If True, each axes in the grid has a *cax* attribute that is bound to associated *cbar\_axes*.
**axes\_class**subclass of [`matplotlib.axes.Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), default: None
| programming_docs |
matplotlib matplotlib.pyplot.locator_params matplotlib.pyplot.locator\_params
=================================
matplotlib.pyplot.locator\_params(*axis='both'*, *tight=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2630-L2632)
Control behavior of major tick locators.
Because the locator is involved in autoscaling, [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view") is called automatically after the parameters are changed.
Parameters:
**axis**{'both', 'x', 'y'}, default: 'both'
The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three axes.)
**tight**bool or None, optional
Parameter passed to [`autoscale_view`](matplotlib.axes.axes.autoscale_view#matplotlib.axes.Axes.autoscale_view "matplotlib.axes.Axes.autoscale_view"). Default is None, for no change.
Other Parameters:
**\*\*kwargs**
Remaining keyword arguments are passed to directly to the `set_params()` method of the locator. Supported keywords depend on the type of the locator. See for example [`set_params`](../ticker_api#matplotlib.ticker.MaxNLocator.set_params "matplotlib.ticker.MaxNLocator.set_params") for the [`ticker.MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator") used by default for linear.
#### Examples
When plotting small subplots, one might want to reduce the maximum number of ticks and use tight bounds, for example:
```
ax.locator_params(tight=True, nbins=4)
```
matplotlib matplotlib.axes.Axes.remove_callback matplotlib.axes.Axes.remove\_callback
=====================================
Axes.remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](matplotlib.axes.axes.add_callback#matplotlib.axes.Axes.add_callback "matplotlib.axes.Axes.add_callback")
matplotlib matplotlib.pyplot.set_loglevel matplotlib.pyplot.set\_loglevel
===============================
matplotlib.pyplot.set\_loglevel(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L172-L174)
Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet.
Typically, one should call `set_loglevel("info")` or `set_loglevel("debug")` to get additional debugging information.
Parameters:
**level**{"notset", "debug", "info", "warning", "error", "critical"}
The log level of the handler.
#### Notes
The first time this function is called, an additional handler is attached to Matplotlib's root handler; this handler is reused every time and this function simply manipulates the logger and handler's level.
matplotlib matplotlib.pyplot.show matplotlib.pyplot.show
======================
matplotlib.pyplot.show(*\**, *block=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L364-L409)
Display all open figures.
Parameters:
**block**bool, optional
Whether to wait for all figures to be closed before returning.
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") block and run the GUI main loop until all figure windows are closed.
If [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)") ensure that all figure windows are displayed and return immediately. In this case, you are responsible for ensuring that the event loop is running to have responsive figures.
Defaults to True in non-interactive mode and to False in interactive mode (see [`pyplot.isinteractive`](matplotlib.pyplot.isinteractive#matplotlib.pyplot.isinteractive "matplotlib.pyplot.isinteractive")).
See also
[`ion`](matplotlib.pyplot.ion#matplotlib.pyplot.ion "matplotlib.pyplot.ion")
Enable interactive mode, which shows / updates the figure after every plotting command, so that calling `show()` is not necessary.
[`ioff`](matplotlib.pyplot.ioff#matplotlib.pyplot.ioff "matplotlib.pyplot.ioff")
Disable interactive mode.
[`savefig`](matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig")
Save the figure to an image file instead of showing it on screen.
#### Notes
**Saving figures to file and showing a window at the same time**
If you want an image file as well as a user interface window, use [`pyplot.savefig`](matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig") before [`pyplot.show`](#matplotlib.pyplot.show "matplotlib.pyplot.show"). At the end of (a blocking) `show()` the figure is closed and thus unregistered from pyplot. Calling [`pyplot.savefig`](matplotlib.pyplot.savefig#matplotlib.pyplot.savefig "matplotlib.pyplot.savefig") afterwards would save a new and thus empty figure. This limitation of command order does not apply if the show is non-blocking or if you keep a reference to the figure and use [`Figure.savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
**Auto-show in jupyter notebooks**
The jupyter backends (activated via `%matplotlib inline`, `%matplotlib notebook`, or `%matplotlib widget`), call `show()` at the end of every cell by default. Thus, you usually don't have to call it explicitly there.
Examples using `matplotlib.pyplot.show`
---------------------------------------
[Bar color demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_colors.html#sphx-glr-gallery-lines-bars-and-markers-bar-colors-py)
Bar color demo
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Stacked bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html#sphx-glr-gallery-lines-bars-and-markers-bar-stacked-py)
Stacked bar chart
[Grouped bar chart with labels](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html#sphx-glr-gallery-lines-bars-and-markers-barchart-py)
Grouped bar chart with labels
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[CapStyle](https://matplotlib.org/stable/gallery/lines_bars_and_markers/capstyle.html#sphx-glr-gallery-lines-bars-and-markers-capstyle-py)
CapStyle
[Plotting categorical variables](https://matplotlib.org/stable/gallery/lines_bars_and_markers/categorical_variables.html#sphx-glr-gallery-lines-bars-and-markers-categorical-variables-py)
Plotting categorical variables
[Plotting the coherence of two signals](https://matplotlib.org/stable/gallery/lines_bars_and_markers/cohere.html#sphx-glr-gallery-lines-bars-and-markers-cohere-py)
Plotting the coherence of two signals
[CSD Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/csd_demo.html#sphx-glr-gallery-lines-bars-and-markers-csd-demo-py)
CSD Demo
[Curve with error band](https://matplotlib.org/stable/gallery/lines_bars_and_markers/curve_error_band.html#sphx-glr-gallery-lines-bars-and-markers-curve-error-band-py)
Curve with error band
[Errorbar limit selection](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_limits_simple.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-limits-simple-py)
Errorbar limit selection
[Errorbar subsampling](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_subsample.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-subsample-py)
Errorbar subsampling
[EventCollection Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventcollection-demo-py)
EventCollection Demo
[Eventplot Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventplot-demo-py)
Eventplot Demo
[Filled polygon](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill.html#sphx-glr-gallery-lines-bars-and-markers-fill-py)
Filled polygon
[Fill Between and Alpha](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_alpha.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-alpha-py)
Fill Between and Alpha
[Fill Betweenx Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_betweenx_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-betweenx-demo-py)
Fill Betweenx Demo
[Hatch-filled histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/filled_step.html#sphx-glr-gallery-lines-bars-and-markers-filled-step-py)
Hatch-filled histograms
[Bar chart with gradients](https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py)
Bar chart with gradients
[Hat graph](https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py)
Hat graph
[Discrete distribution as horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/horizontal_barchart_distribution.html#sphx-glr-gallery-lines-bars-and-markers-horizontal-barchart-distribution-py)
Discrete distribution as horizontal bar chart
[JoinStyle](https://matplotlib.org/stable/gallery/lines_bars_and_markers/joinstyle.html#sphx-glr-gallery-lines-bars-and-markers-joinstyle-py)
JoinStyle
[Customizing dashed line styles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/line_demo_dash_control.html#sphx-glr-gallery-lines-bars-and-markers-line-demo-dash-control-py)
Customizing dashed line styles
[Lines with a ticked patheffect](https://matplotlib.org/stable/gallery/lines_bars_and_markers/lines_with_ticks_demo.html#sphx-glr-gallery-lines-bars-and-markers-lines-with-ticks-demo-py)
Lines with a ticked patheffect
[Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html#sphx-glr-gallery-lines-bars-and-markers-linestyles-py)
Linestyles
[Marker reference](https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html#sphx-glr-gallery-lines-bars-and-markers-marker-reference-py)
Marker reference
[Markevery Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/markevery_demo.html#sphx-glr-gallery-lines-bars-and-markers-markevery-demo-py)
Markevery Demo
[Plotting masked and NaN values](https://matplotlib.org/stable/gallery/lines_bars_and_markers/masked_demo.html#sphx-glr-gallery-lines-bars-and-markers-masked-demo-py)
Plotting masked and NaN values
[Multicolored lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multicolored_line.html#sphx-glr-gallery-lines-bars-and-markers-multicolored-line-py)
Multicolored lines
[Mapping marker properties to multivariate data](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html#sphx-glr-gallery-lines-bars-and-markers-multivariate-marker-plot-py)
Mapping marker properties to multivariate data
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Scatter plots with custom symbols](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_custom_symbol.html#sphx-glr-gallery-lines-bars-and-markers-scatter-custom-symbol-py)
Scatter plots with custom symbols
[Scatter Demo2](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_demo2.html#sphx-glr-gallery-lines-bars-and-markers-scatter-demo2-py)
Scatter Demo2
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Scatter Masked](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_masked.html#sphx-glr-gallery-lines-bars-and-markers-scatter-masked-py)
Scatter Masked
[Marker examples](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_star_poly.html#sphx-glr-gallery-lines-bars-and-markers-scatter-star-poly-py)
Marker examples
[Scatter plots with a legend](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#sphx-glr-gallery-lines-bars-and-markers-scatter-with-legend-py)
Scatter plots with a legend
[Simple Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html#sphx-glr-gallery-lines-bars-and-markers-simple-plot-py)
Simple Plot
[Using span\_where](https://matplotlib.org/stable/gallery/lines_bars_and_markers/span_regions.html#sphx-glr-gallery-lines-bars-and-markers-span-regions-py)
Using span\_where
[Spectrum Representations](https://matplotlib.org/stable/gallery/lines_bars_and_markers/spectrum_demo.html#sphx-glr-gallery-lines-bars-and-markers-spectrum-demo-py)
Spectrum Representations
[Stackplots and streamgraphs](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#sphx-glr-gallery-lines-bars-and-markers-stackplot-demo-py)
Stackplots and streamgraphs
[Stairs Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html#sphx-glr-gallery-lines-bars-and-markers-stairs-demo-py)
Stairs Demo
[Stem Plot](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stem_plot.html#sphx-glr-gallery-lines-bars-and-markers-stem-plot-py)
Stem Plot
[Step Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/step_demo.html#sphx-glr-gallery-lines-bars-and-markers-step-demo-py)
Step Demo
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[hlines and vlines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/vline_hline_demo.html#sphx-glr-gallery-lines-bars-and-markers-vline-hline-demo-py)
hlines and vlines
[Cross- and Auto-Correlation Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/xcorr_acorr_demo.html#sphx-glr-gallery-lines-bars-and-markers-xcorr-acorr-demo-py)
Cross- and Auto-Correlation Demo
[Affine transform of an image](https://matplotlib.org/stable/gallery/images_contours_and_fields/affine_image.html#sphx-glr-gallery-images-contours-and-fields-affine-image-py)
Affine transform of an image
[Wind Barbs](https://matplotlib.org/stable/gallery/images_contours_and_fields/barb_demo.html#sphx-glr-gallery-images-contours-and-fields-barb-demo-py)
Wind Barbs
[Barcode](https://matplotlib.org/stable/gallery/images_contours_and_fields/barcode_demo.html#sphx-glr-gallery-images-contours-and-fields-barcode-demo-py)
Barcode
[Interactive Adjustment of Colormap Range](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_interactive_adjustment.html#sphx-glr-gallery-images-contours-and-fields-colormap-interactive-adjustment-py)
Interactive Adjustment of Colormap Range
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Colormap Normalizations SymLogNorm](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations_symlognorm.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-symlognorm-py)
Colormap Normalizations SymLogNorm
[Contour Corner Mask](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_corner_mask.html#sphx-glr-gallery-images-contours-and-fields-contour-corner-mask-py)
Contour Corner Mask
[Contour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-demo-py)
Contour Demo
[Contour Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_image.html#sphx-glr-gallery-images-contours-and-fields-contour-image-py)
Contour Image
[Contour Label Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contour_label_demo.html#sphx-glr-gallery-images-contours-and-fields-contour-label-demo-py)
Contour Label Demo
[Contourf Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_demo.html#sphx-glr-gallery-images-contours-and-fields-contourf-demo-py)
Contourf Demo
[Contourf Hatching](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_hatching.html#sphx-glr-gallery-images-contours-and-fields-contourf-hatching-py)
Contourf Hatching
[Contourf and log color scale](https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_log.html#sphx-glr-gallery-images-contours-and-fields-contourf-log-py)
Contourf and log color scale
[Contouring the solution space of optimizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/contours_in_optimization_demo.html#sphx-glr-gallery-images-contours-and-fields-contours-in-optimization-demo-py)
Contouring the solution space of optimizations
[BboxImage Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/demo_bboximage.html#sphx-glr-gallery-images-contours-and-fields-demo-bboximage-py)
BboxImage Demo
[Figimage Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/figimage_demo.html#sphx-glr-gallery-images-contours-and-fields-figimage-demo-py)
Figimage Demo
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image antialiasing](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_antialiasing.html#sphx-glr-gallery-images-contours-and-fields-image-antialiasing-py)
Image antialiasing
[Clipping images with patches](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_clip_path.html#sphx-glr-gallery-images-contours-and-fields-image-clip-path-py)
Clipping images with patches
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Image Nonuniform](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_nonuniform.html#sphx-glr-gallery-images-contours-and-fields-image-nonuniform-py)
Image Nonuniform
[Blend transparency with color in 2D images](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_transparency_blend.html#sphx-glr-gallery-images-contours-and-fields-image-transparency-blend-py)
Blend transparency with color in 2D images
[Modifying the coordinate formatter](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_zcoord.html#sphx-glr-gallery-images-contours-and-fields-image-zcoord-py)
Modifying the coordinate formatter
[Interpolations for imshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html#sphx-glr-gallery-images-contours-and-fields-interpolation-methods-py)
Interpolations for imshow
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Layer Images](https://matplotlib.org/stable/gallery/images_contours_and_fields/layer_images.html#sphx-glr-gallery-images-contours-and-fields-layer-images-py)
Layer Images
[Matshow](https://matplotlib.org/stable/gallery/images_contours_and_fields/matshow.html#sphx-glr-gallery-images-contours-and-fields-matshow-py)
Matshow
[Multi Image](https://matplotlib.org/stable/gallery/images_contours_and_fields/multi_image.html#sphx-glr-gallery-images-contours-and-fields-multi-image-py)
Multi Image
[Pcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-pcolor-demo-py)
Pcolor Demo
[pcolormesh grids and shading](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_grids.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-grids-py)
pcolormesh grids and shading
[pcolormesh](https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html#sphx-glr-gallery-images-contours-and-fields-pcolormesh-levels-py)
pcolormesh
[Streamplot](https://matplotlib.org/stable/gallery/images_contours_and_fields/plot_streamplot.html#sphx-glr-gallery-images-contours-and-fields-plot-streamplot-py)
Streamplot
[QuadMesh Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quadmesh_demo.html#sphx-glr-gallery-images-contours-and-fields-quadmesh-demo-py)
QuadMesh Demo
[Advanced quiver and quiverkey functions](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-demo-py)
Advanced quiver and quiverkey functions
[Quiver Simple Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html#sphx-glr-gallery-images-contours-and-fields-quiver-simple-demo-py)
Quiver Simple Demo
[Shading example](https://matplotlib.org/stable/gallery/images_contours_and_fields/shading_example.html#sphx-glr-gallery-images-contours-and-fields-shading-example-py)
Shading example
[Spectrogram Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/specgram_demo.html#sphx-glr-gallery-images-contours-and-fields-specgram-demo-py)
Spectrogram Demo
[Spy Demos](https://matplotlib.org/stable/gallery/images_contours_and_fields/spy_demos.html#sphx-glr-gallery-images-contours-and-fields-spy-demos-py)
Spy Demos
[Tricontour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_demo.html#sphx-glr-gallery-images-contours-and-fields-tricontour-demo-py)
Tricontour Demo
[Tricontour Smooth Delaunay](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_delaunay.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-delaunay-py)
Tricontour Smooth Delaunay
[Tricontour Smooth User](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_user.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-user-py)
Tricontour Smooth User
[Trigradient Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/trigradient_demo.html#sphx-glr-gallery-images-contours-and-fields-trigradient-demo-py)
Trigradient Demo
[Triinterp Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/triinterp_demo.html#sphx-glr-gallery-images-contours-and-fields-triinterp-demo-py)
Triinterp Demo
[Tripcolor Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tripcolor_demo.html#sphx-glr-gallery-images-contours-and-fields-tripcolor-demo-py)
Tripcolor Demo
[Triplot Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/triplot_demo.html#sphx-glr-gallery-images-contours-and-fields-triplot-demo-py)
Triplot Demo
[Watermark image](https://matplotlib.org/stable/gallery/images_contours_and_fields/watermark_image.html#sphx-glr-gallery-images-contours-and-fields-watermark-image-py)
Watermark image
[Aligning Labels](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/align_labels_demo.html#sphx-glr-gallery-subplots-axes-and-figures-align-labels-demo-py)
Aligning Labels
[Axes box aspect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_box_aspect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-box-aspect-py)
Axes box aspect
[Axes Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axes-demo-py)
Axes Demo
[Controlling view limits using margins and sticky\_edges](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_margins.html#sphx-glr-gallery-subplots-axes-and-figures-axes-margins-py)
Controlling view limits using margins and sticky\_edges
[Axes Props](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_props.html#sphx-glr-gallery-subplots-axes-and-figures-axes-props-py)
Axes Props
[Axes Zoom Effect](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_zoom_effect.html#sphx-glr-gallery-subplots-axes-and-figures-axes-zoom-effect-py)
Axes Zoom Effect
[axhspan Demo](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axhspan_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axhspan-demo-py)
axhspan Demo
[Equal axis aspect ratio](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axis_equal_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axis-equal-demo-py)
Equal axis aspect ratio
[Axis Label Position](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axis_labels_demo.html#sphx-glr-gallery-subplots-axes-and-figures-axis-labels-demo-py)
Axis Label Position
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Placing Colorbars](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/colorbar_placement.html#sphx-glr-gallery-subplots-axes-and-figures-colorbar-placement-py)
Placing Colorbars
[Resizing axes with constrained layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_constrained_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-constrained-layout-py)
Resizing axes with constrained layout
[Resizing axes with tight layout](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/demo_tight_layout.html#sphx-glr-gallery-subplots-axes-and-figures-demo-tight-layout-py)
Resizing axes with tight layout
[Different scales on the same axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/fahrenheit_celsius_scales.html#sphx-glr-gallery-subplots-axes-and-figures-fahrenheit-celsius-scales-py)
Different scales on the same axes
[Figure size in different units](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_size_units.html#sphx-glr-gallery-subplots-axes-and-figures-figure-size-units-py)
Figure size in different units
[Figure labels: suptitle, supxlabel, supylabel](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_title.html#sphx-glr-gallery-subplots-axes-and-figures-figure-title-py)
Figure labels: suptitle, supxlabel, supylabel
[Creating adjacent subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/ganged_plots.html#sphx-glr-gallery-subplots-axes-and-figures-ganged-plots-py)
Creating adjacent subplots
[Geographic Projections](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py)
Geographic Projections
[Combining two subplots using subplots and GridSpec](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_and_subplots.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-and-subplots-py)
Combining two subplots using subplots and GridSpec
[Using Gridspec to make multi-column/row subplot layouts](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_multicolumn.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-multicolumn-py)
Using Gridspec to make multi-column/row subplot layouts
[Nested Gridspecs](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/gridspec_nested.html#sphx-glr-gallery-subplots-axes-and-figures-gridspec-nested-py)
Nested Gridspecs
[Invert Axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/invert_axes.html#sphx-glr-gallery-subplots-axes-and-figures-invert-axes-py)
Invert Axes
[Managing multiple figures in pyplot](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/multiple_figs_demo.html#sphx-glr-gallery-subplots-axes-and-figures-multiple-figs-demo-py)
Managing multiple figures in pyplot
[Secondary Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py)
Secondary Axis
[Sharing axis limits and views](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/share_axis_lims_views.html#sphx-glr-gallery-subplots-axes-and-figures-share-axis-lims-views-py)
Sharing axis limits and views
[Shared Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/shared_axis_demo.html#sphx-glr-gallery-subplots-axes-and-figures-shared-axis-demo-py)
Shared Axis
[Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html#sphx-glr-gallery-subplots-axes-and-figures-subfigures-py)
Figure subfigures
[Multiple subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplot.html#sphx-glr-gallery-subplots-axes-and-figures-subplot-py)
Multiple subplots
[Subplots spacings and margins](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_adjust.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-adjust-py)
Subplots spacings and margins
[Creating multiple subplots using plt.subplots](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html#sphx-glr-gallery-subplots-axes-and-figures-subplots-demo-py)
Creating multiple subplots using ``plt.subplots``
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html#sphx-glr-gallery-subplots-axes-and-figures-two-scales-py)
Plots with different scales
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Percentiles as horizontal bar chart](https://matplotlib.org/stable/gallery/statistics/barchart_demo.html#sphx-glr-gallery-statistics-barchart-demo-py)
Percentiles as horizontal bar chart
[Artist customization in box plots](https://matplotlib.org/stable/gallery/statistics/boxplot.html#sphx-glr-gallery-statistics-boxplot-py)
Artist customization in box plots
[Box plots with custom fill colors](https://matplotlib.org/stable/gallery/statistics/boxplot_color.html#sphx-glr-gallery-statistics-boxplot-color-py)
Box plots with custom fill colors
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Box plot vs. violin plot comparison](https://matplotlib.org/stable/gallery/statistics/boxplot_vs_violin.html#sphx-glr-gallery-statistics-boxplot-vs-violin-py)
Box plot vs. violin plot comparison
[Boxplot drawer function](https://matplotlib.org/stable/gallery/statistics/bxp.html#sphx-glr-gallery-statistics-bxp-py)
Boxplot drawer function
[Plot a confidence ellipse of a two-dimensional dataset](https://matplotlib.org/stable/gallery/statistics/confidence_ellipse.html#sphx-glr-gallery-statistics-confidence-ellipse-py)
Plot a confidence ellipse of a two-dimensional dataset
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
[Errorbar function](https://matplotlib.org/stable/gallery/statistics/errorbar.html#sphx-glr-gallery-statistics-errorbar-py)
Errorbar function
[Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html#sphx-glr-gallery-statistics-errorbar-features-py)
Different ways of specifying error bars
[Including upper and lower limits in error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_limits.html#sphx-glr-gallery-statistics-errorbar-limits-py)
Including upper and lower limits in error bars
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Hexagonal binned plot](https://matplotlib.org/stable/gallery/statistics/hexbin_demo.html#sphx-glr-gallery-statistics-hexbin-demo-py)
Hexagonal binned plot
[Histograms](https://matplotlib.org/stable/gallery/statistics/hist.html#sphx-glr-gallery-statistics-hist-py)
Histograms
[Using histograms to plot a cumulative distribution](https://matplotlib.org/stable/gallery/statistics/histogram_cumulative.html#sphx-glr-gallery-statistics-histogram-cumulative-py)
Using histograms to plot a cumulative distribution
[Some features of the histogram (hist) function](https://matplotlib.org/stable/gallery/statistics/histogram_features.html#sphx-glr-gallery-statistics-histogram-features-py)
Some features of the histogram (hist) function
[Demo of the histogram function's different histtype settings](https://matplotlib.org/stable/gallery/statistics/histogram_histtypes.html#sphx-glr-gallery-statistics-histogram-histtypes-py)
Demo of the histogram function's different ``histtype`` settings
[The histogram (hist) function with multiple data sets](https://matplotlib.org/stable/gallery/statistics/histogram_multihist.html#sphx-glr-gallery-statistics-histogram-multihist-py)
The histogram (hist) function with multiple data sets
[Producing multiple histograms side by side](https://matplotlib.org/stable/gallery/statistics/multiple_histograms_side_by_side.html#sphx-glr-gallery-statistics-multiple-histograms-side-by-side-py)
Producing multiple histograms side by side
[Time Series Histogram](https://matplotlib.org/stable/gallery/statistics/time_series_histogram.html#sphx-glr-gallery-statistics-time-series-histogram-py)
Time Series Histogram
[Violin plot basics](https://matplotlib.org/stable/gallery/statistics/violinplot.html#sphx-glr-gallery-statistics-violinplot-py)
Violin plot basics
[Basic pie chart](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_features.html#sphx-glr-gallery-pie-and-polar-charts-pie-features-py)
Basic pie chart
[Pie Demo2](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_demo2.html#sphx-glr-gallery-pie-and-polar-charts-pie-demo2-py)
Pie Demo2
[Bar of pie](https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py)
Bar of pie
[Nested pie charts](https://matplotlib.org/stable/gallery/pie_and_polar_charts/nested_pie.html#sphx-glr-gallery-pie-and-polar-charts-nested-pie-py)
Nested pie charts
[Labeling a pie and a donut](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py)
Labeling a pie and a donut
[Bar chart on polar axis](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_bar.html#sphx-glr-gallery-pie-and-polar-charts-polar-bar-py)
Bar chart on polar axis
[Polar plot](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_demo.html#sphx-glr-gallery-pie-and-polar-charts-polar-demo-py)
Polar plot
[Polar Legend](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_legend.html#sphx-glr-gallery-pie-and-polar-charts-polar-legend-py)
Polar Legend
[Scatter plot on polar axis](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_scatter.html#sphx-glr-gallery-pie-and-polar-charts-polar-scatter-py)
Scatter plot on polar axis
[Using accented text in Matplotlib](https://matplotlib.org/stable/gallery/text_labels_and_annotations/accented_text.html#sphx-glr-gallery-text-labels-and-annotations-accented-text-py)
Using accented text in Matplotlib
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Arrow Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/arrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-arrow-demo-py)
Arrow Demo
[Auto-wrapping text](https://matplotlib.org/stable/gallery/text_labels_and_annotations/autowrap.html#sphx-glr-gallery-text-labels-and-annotations-autowrap-py)
Auto-wrapping text
[Composing Custom Legends](https://matplotlib.org/stable/gallery/text_labels_and_annotations/custom_legends.html#sphx-glr-gallery-text-labels-and-annotations-custom-legends-py)
Composing Custom Legends
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py)
AnnotationBbox demo
[Using a text as a Path](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_path.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-path-py)
Using a text as a Path
[Text Rotation Mode](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_text_rotation_mode.html#sphx-glr-gallery-text-labels-and-annotations-demo-text-rotation-mode-py)
Text Rotation Mode
[The difference between \dfrac and \frac](https://matplotlib.org/stable/gallery/text_labels_and_annotations/dfrac_demo.html#sphx-glr-gallery-text-labels-and-annotations-dfrac-demo-py)
The difference between \\dfrac and \\frac
[Labeling ticks using engineering notation](https://matplotlib.org/stable/gallery/text_labels_and_annotations/engineering_formatter.html#sphx-glr-gallery-text-labels-and-annotations-engineering-formatter-py)
Labeling ticks using engineering notation
[Annotation arrow style reference](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fancyarrow_demo.html#sphx-glr-gallery-text-labels-and-annotations-fancyarrow-demo-py)
Annotation arrow style reference
[Styling text boxes](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fancytextbox_demo.html#sphx-glr-gallery-text-labels-and-annotations-fancytextbox-demo-py)
Styling text boxes
[Figure legend demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/figlegend_demo.html#sphx-glr-gallery-text-labels-and-annotations-figlegend-demo-py)
Figure legend demo
[Configuring the font family](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_family_rc.html#sphx-glr-gallery-text-labels-and-annotations-font-family-rc-py)
Configuring the font family
[Using a ttf font file in Matplotlib](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_file.html#sphx-glr-gallery-text-labels-and-annotations-font-file-py)
Using a ttf font file in Matplotlib
[Font table](https://matplotlib.org/stable/gallery/text_labels_and_annotations/font_table.html#sphx-glr-gallery-text-labels-and-annotations-font-table-py)
Font table
[Fonts demo (object-oriented style)](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fonts_demo.html#sphx-glr-gallery-text-labels-and-annotations-fonts-demo-py)
Fonts demo (object-oriented style)
[Fonts demo (keyword arguments)](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fonts_demo_kw.html#sphx-glr-gallery-text-labels-and-annotations-fonts-demo-kw-py)
Fonts demo (keyword arguments)
[Labelling subplots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/label_subplots.html#sphx-glr-gallery-text-labels-and-annotations-label-subplots-py)
Labelling subplots
[Legend using pre-defined labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend.html#sphx-glr-gallery-text-labels-and-annotations-legend-py)
Legend using pre-defined labels
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[Artist within an artist](https://matplotlib.org/stable/gallery/text_labels_and_annotations/line_with_text.html#sphx-glr-gallery-text-labels-and-annotations-line-with-text-py)
Artist within an artist
[Convert texts to images](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_asarray.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-asarray-py)
Convert texts to images
[Mathtext](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_demo.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-demo-py)
Mathtext
[Mathtext Examples](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_examples.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-examples-py)
Mathtext Examples
[Math fontfamily](https://matplotlib.org/stable/gallery/text_labels_and_annotations/mathtext_fontfamily_example.html#sphx-glr-gallery-text-labels-and-annotations-mathtext-fontfamily-example-py)
Math fontfamily
[Multiline](https://matplotlib.org/stable/gallery/text_labels_and_annotations/multiline.html#sphx-glr-gallery-text-labels-and-annotations-multiline-py)
Multiline
[Placing text boxes](https://matplotlib.org/stable/gallery/text_labels_and_annotations/placing_text_boxes.html#sphx-glr-gallery-text-labels-and-annotations-placing-text-boxes-py)
Placing text boxes
[Rainbow text](https://matplotlib.org/stable/gallery/text_labels_and_annotations/rainbow_text.html#sphx-glr-gallery-text-labels-and-annotations-rainbow-text-py)
Rainbow text
[STIX Fonts](https://matplotlib.org/stable/gallery/text_labels_and_annotations/stix_fonts_demo.html#sphx-glr-gallery-text-labels-and-annotations-stix-fonts-demo-py)
STIX Fonts
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html#sphx-glr-gallery-text-labels-and-annotations-text-alignment-py)
Text alignment
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Default text rotation demonstration](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-py)
Default text rotation demonstration
[Text Rotation Relative To Line](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_rotation_relative_to_line.html#sphx-glr-gallery-text-labels-and-annotations-text-rotation-relative-to-line-py)
Text Rotation Relative To Line
[Title positioning](https://matplotlib.org/stable/gallery/text_labels_and_annotations/titles_demo.html#sphx-glr-gallery-text-labels-and-annotations-titles-demo-py)
Title positioning
[Unicode minus](https://matplotlib.org/stable/gallery/text_labels_and_annotations/unicode_minus.html#sphx-glr-gallery-text-labels-and-annotations-unicode-minus-py)
Unicode minus
[Usetex Baseline Test](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_baseline_test.html#sphx-glr-gallery-text-labels-and-annotations-usetex-baseline-test-py)
Usetex Baseline Test
[Usetex Fonteffects](https://matplotlib.org/stable/gallery/text_labels_and_annotations/usetex_fonteffects.html#sphx-glr-gallery-text-labels-and-annotations-usetex-fonteffects-py)
Usetex Fonteffects
[Text watermark](https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html#sphx-glr-gallery-text-labels-and-annotations-watermark-text-py)
Text watermark
[Align y-labels](https://matplotlib.org/stable/gallery/pyplots/align_ylabels.html#sphx-glr-gallery-pyplots-align-ylabels-py)
Align y-labels
[Annotate Transform](https://matplotlib.org/stable/gallery/pyplots/annotate_transform.html#sphx-glr-gallery-pyplots-annotate-transform-py)
Annotate Transform
[Annotating a plot](https://matplotlib.org/stable/gallery/pyplots/annotation_basic.html#sphx-glr-gallery-pyplots-annotation-basic-py)
Annotating a plot
[Annotation Polar](https://matplotlib.org/stable/gallery/pyplots/annotation_polar.html#sphx-glr-gallery-pyplots-annotation-polar-py)
Annotation Polar
[Programmatically controlling subplot adjustment](https://matplotlib.org/stable/gallery/pyplots/auto_subplots_adjust.html#sphx-glr-gallery-pyplots-auto-subplots-adjust-py)
Programmatically controlling subplot adjustment
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Boxplot Demo](https://matplotlib.org/stable/gallery/pyplots/boxplot_demo_pyplot.html#sphx-glr-gallery-pyplots-boxplot-demo-pyplot-py)
Boxplot Demo
[Dollar Ticks](https://matplotlib.org/stable/gallery/pyplots/dollar_ticks.html#sphx-glr-gallery-pyplots-dollar-ticks-py)
Dollar Ticks
[Fig Axes Customize Simple](https://matplotlib.org/stable/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py)
Fig Axes Customize Simple
[Simple axes labels](https://matplotlib.org/stable/gallery/pyplots/fig_axes_labels_simple.html#sphx-glr-gallery-pyplots-fig-axes-labels-simple-py)
Simple axes labels
[Adding lines to figures](https://matplotlib.org/stable/gallery/pyplots/fig_x.html#sphx-glr-gallery-pyplots-fig-x-py)
Adding lines to figures
[plot() format string](https://matplotlib.org/stable/gallery/pyplots/pyplot_formatstr.html#sphx-glr-gallery-pyplots-pyplot-formatstr-py)
plot() format string
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Simple](https://matplotlib.org/stable/gallery/pyplots/pyplot_simple.html#sphx-glr-gallery-pyplots-pyplot-simple-py)
Pyplot Simple
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Pyplot Three](https://matplotlib.org/stable/gallery/pyplots/pyplot_three.html#sphx-glr-gallery-pyplots-pyplot-three-py)
Pyplot Three
[Pyplot Two Subplots](https://matplotlib.org/stable/gallery/pyplots/pyplot_two_subplots.html#sphx-glr-gallery-pyplots-pyplot-two-subplots-py)
Pyplot Two Subplots
[Text Commands](https://matplotlib.org/stable/gallery/pyplots/text_commands.html#sphx-glr-gallery-pyplots-text-commands-py)
Text Commands
[Text Layout](https://matplotlib.org/stable/gallery/pyplots/text_layout.html#sphx-glr-gallery-pyplots-text-layout-py)
Text Layout
[Color Demo](https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-gallery-color-color-demo-py)
Color Demo
[Color by y-value](https://matplotlib.org/stable/gallery/color/color_by_yvalue.html#sphx-glr-gallery-color-color-by-yvalue-py)
Color by y-value
[Colors in the default property cycle](https://matplotlib.org/stable/gallery/color/color_cycle_default.html#sphx-glr-gallery-color-color-cycle-default-py)
Colors in the default property cycle
[Colorbar](https://matplotlib.org/stable/gallery/color/colorbar_basics.html#sphx-glr-gallery-color-colorbar-basics-py)
Colorbar
[Colormap reference](https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-gallery-color-colormap-reference-py)
Colormap reference
[Creating a colormap from a list of colors](https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-gallery-color-custom-cmap-py)
Creating a colormap from a list of colors
[List of named colors](https://matplotlib.org/stable/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py)
List of named colors
[Arrow guide](https://matplotlib.org/stable/gallery/shapes_and_collections/arrow_guide.html#sphx-glr-gallery-shapes-and-collections-arrow-guide-py)
Arrow guide
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
[Compound path](https://matplotlib.org/stable/gallery/shapes_and_collections/compound_path.html#sphx-glr-gallery-shapes-and-collections-compound-path-py)
Compound path
[Dolphins](https://matplotlib.org/stable/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py)
Dolphins
[Mmh Donuts!!!](https://matplotlib.org/stable/gallery/shapes_and_collections/donut.html#sphx-glr-gallery-shapes-and-collections-donut-py)
Mmh Donuts!!!
[Ellipse Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_collection.html#sphx-glr-gallery-shapes-and-collections-ellipse-collection-py)
Ellipse Collection
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
[Drawing fancy boxes](https://matplotlib.org/stable/gallery/shapes_and_collections/fancybox_demo.html#sphx-glr-gallery-shapes-and-collections-fancybox-demo-py)
Drawing fancy boxes
[Hatch demo](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_demo.html#sphx-glr-gallery-shapes-and-collections-hatch-demo-py)
Hatch demo
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[PathPatch object](https://matplotlib.org/stable/gallery/shapes_and_collections/path_patch.html#sphx-glr-gallery-shapes-and-collections-path-patch-py)
PathPatch object
[Bezier Curve](https://matplotlib.org/stable/gallery/shapes_and_collections/quad_bezier.html#sphx-glr-gallery-shapes-and-collections-quad-bezier-py)
Bezier Curve
[Scatter plot](https://matplotlib.org/stable/gallery/shapes_and_collections/scatter.html#sphx-glr-gallery-shapes-and-collections-scatter-py)
Scatter plot
[Bayesian Methods for Hackers style sheet](https://matplotlib.org/stable/gallery/style_sheets/bmh.html#sphx-glr-gallery-style-sheets-bmh-py)
Bayesian Methods for Hackers style sheet
[Dark background style sheet](https://matplotlib.org/stable/gallery/style_sheets/dark_background.html#sphx-glr-gallery-style-sheets-dark-background-py)
Dark background style sheet
[FiveThirtyEight style sheet](https://matplotlib.org/stable/gallery/style_sheets/fivethirtyeight.html#sphx-glr-gallery-style-sheets-fivethirtyeight-py)
FiveThirtyEight style sheet
[ggplot style sheet](https://matplotlib.org/stable/gallery/style_sheets/ggplot.html#sphx-glr-gallery-style-sheets-ggplot-py)
ggplot style sheet
[Grayscale style sheet](https://matplotlib.org/stable/gallery/style_sheets/grayscale.html#sphx-glr-gallery-style-sheets-grayscale-py)
Grayscale style sheet
[Solarized Light stylesheet](https://matplotlib.org/stable/gallery/style_sheets/plot_solarizedlight2.html#sphx-glr-gallery-style-sheets-plot-solarizedlight2-py)
Solarized Light stylesheet
[Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py)
Style sheets reference
[Anchored Direction Arrow](https://matplotlib.org/stable/gallery/axes_grid1/demo_anchored_direction_arrows.html#sphx-glr-gallery-axes-grid1-demo-anchored-direction-arrows-py)
Anchored Direction Arrow
[Axes Divider](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-divider-py)
Axes Divider
[Demo Axes Grid](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid.html#sphx-glr-gallery-axes-grid1-demo-axes-grid-py)
Demo Axes Grid
[Axes Grid2](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid2.html#sphx-glr-gallery-axes-grid1-demo-axes-grid2-py)
Axes Grid2
[HBoxDivider demo](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-gallery-axes-grid1-demo-axes-hbox-divider-py)
`.HBoxDivider` demo
[Showing RGB channels using RGBAxes](https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html#sphx-glr-gallery-axes-grid1-demo-axes-rgb-py)
Showing RGB channels using RGBAxes
[Adding a colorbar to inset axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html#sphx-glr-gallery-axes-grid1-demo-colorbar-of-inset-axes-py)
Adding a colorbar to inset axes
[Colorbar with AxesDivider](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-axes-divider-py)
Colorbar with `.AxesDivider`
[Controlling the position and size of colorbars with Inset Axes](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_inset_locator.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-inset-locator-py)
Controlling the position and size of colorbars with Inset Axes
[Per-row or per-column colorbars](https://matplotlib.org/stable/gallery/axes_grid1/demo_edge_colorbar.html#sphx-glr-gallery-axes-grid1-demo-edge-colorbar-py)
Per-row or per-column colorbars
[Axes with a fixed physical size](https://matplotlib.org/stable/gallery/axes_grid1/demo_fixed_size_axes.html#sphx-glr-gallery-axes-grid1-demo-fixed-size-axes-py)
Axes with a fixed physical size
[Setting a fixed aspect on ImageGrid cells](https://matplotlib.org/stable/gallery/axes_grid1/demo_imagegrid_aspect.html#sphx-glr-gallery-axes-grid1-demo-imagegrid-aspect-py)
Setting a fixed aspect on ImageGrid cells
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Make room for ylabel using axes\_grid](https://matplotlib.org/stable/gallery/axes_grid1/make_room_for_ylabel_using_axesgrid.html#sphx-glr-gallery-axes-grid1-make-room-for-ylabel-using-axesgrid-py)
Make room for ylabel using axes\_grid
[Parasite Simple](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py)
Parasite Simple
[Parasite Simple2](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-gallery-axes-grid1-parasite-simple2-py)
Parasite Simple2
[Scatter Histogram (Locatable Axes)](https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-gallery-axes-grid1-scatter-hist-locatable-axes-py)
Scatter Histogram (Locatable Axes)
[Simple Anchored Artists](https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-gallery-axes-grid1-simple-anchored-artists-py)
Simple Anchored Artists
[Simple Axes Divider 1](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider1.html#sphx-glr-gallery-axes-grid1-simple-axes-divider1-py)
Simple Axes Divider 1
[Simple Axes Divider 3](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-gallery-axes-grid1-simple-axes-divider3-py)
Simple Axes Divider 3
[Simple ImageGrid](https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid.html#sphx-glr-gallery-axes-grid1-simple-axesgrid-py)
Simple ImageGrid
[Simple ImageGrid 2](https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid2.html#sphx-glr-gallery-axes-grid1-simple-axesgrid2-py)
Simple ImageGrid 2
[Simple Axisline4](https://matplotlib.org/stable/gallery/axes_grid1/simple_axisline4.html#sphx-glr-gallery-axes-grid1-simple-axisline4-py)
Simple Axisline4
[Simple Colorbar](https://matplotlib.org/stable/gallery/axes_grid1/simple_colorbar.html#sphx-glr-gallery-axes-grid1-simple-colorbar-py)
Simple Colorbar
[Axis Direction](https://matplotlib.org/stable/gallery/axisartist/axis_direction.html#sphx-glr-gallery-axisartist-axis-direction-py)
Axis Direction
[axis\_direction demo](https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-gallery-axisartist-demo-axis-direction-py)
axis\_direction demo
[Axis line styles](https://matplotlib.org/stable/gallery/axisartist/demo_axisline_style.html#sphx-glr-gallery-axisartist-demo-axisline-style-py)
Axis line styles
[Curvilinear grid demo](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid-py)
Curvilinear grid demo
[Demo CurveLinear Grid2](https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid2.html#sphx-glr-gallery-axisartist-demo-curvelinear-grid2-py)
Demo CurveLinear Grid2
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
[floating\_axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axis.html#sphx-glr-gallery-axisartist-demo-floating-axis-py)
floating\_axis demo
[Parasite Axes demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-gallery-axisartist-demo-parasite-axes-py)
Parasite Axes demo
[Parasite axis demo](https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-gallery-axisartist-demo-parasite-axes2-py)
Parasite axis demo
[Ticklabel alignment](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_alignment.html#sphx-glr-gallery-axisartist-demo-ticklabel-alignment-py)
Ticklabel alignment
[Ticklabel direction](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_direction.html#sphx-glr-gallery-axisartist-demo-ticklabel-direction-py)
Ticklabel direction
[Simple Axis Direction01](https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction01.html#sphx-glr-gallery-axisartist-simple-axis-direction01-py)
Simple Axis Direction01
[Simple Axis Direction03](https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction03.html#sphx-glr-gallery-axisartist-simple-axis-direction03-py)
Simple Axis Direction03
[Simple Axis Pad](https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-gallery-axisartist-simple-axis-pad-py)
Simple Axis Pad
[Custom spines with axisartist](https://matplotlib.org/stable/gallery/axisartist/simple_axisartist1.html#sphx-glr-gallery-axisartist-simple-axisartist1-py)
Custom spines with axisartist
[Simple Axisline](https://matplotlib.org/stable/gallery/axisartist/simple_axisline.html#sphx-glr-gallery-axisartist-simple-axisline-py)
Simple Axisline
[Simple Axisline3](https://matplotlib.org/stable/gallery/axisartist/simple_axisline3.html#sphx-glr-gallery-axisartist-simple-axisline3-py)
Simple Axisline3
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Firefox](https://matplotlib.org/stable/gallery/showcase/firefox.html#sphx-glr-gallery-showcase-firefox-py)
Firefox
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[XKCD](https://matplotlib.org/stable/gallery/showcase/xkcd.html#sphx-glr-gallery-showcase-xkcd-py)
XKCD
[Decay](https://matplotlib.org/stable/gallery/animation/animate_decay.html#sphx-glr-gallery-animation-animate-decay-py)
Decay
[Animated histogram](https://matplotlib.org/stable/gallery/animation/animated_histogram.html#sphx-glr-gallery-animation-animated-histogram-py)
Animated histogram
 [The Bayes update](https://matplotlib.org/stable/gallery/animation/bayes_update.html#sphx-glr-gallery-animation-bayes-update-py)
The Bayes update
 [The double pendulum problem](https://matplotlib.org/stable/gallery/animation/double_pendulum.html#sphx-glr-gallery-animation-double-pendulum-py)
The double pendulum problem
 [Animated image using a precomputed list of images](https://matplotlib.org/stable/gallery/animation/dynamic_image.html#sphx-glr-gallery-animation-dynamic-image-py)
Animated image using a precomputed list of images
[Pausing and Resuming an Animation](https://matplotlib.org/stable/gallery/animation/pause_resume.html#sphx-glr-gallery-animation-pause-resume-py)
Pausing and Resuming an Animation
 [Rain simulation](https://matplotlib.org/stable/gallery/animation/rain.html#sphx-glr-gallery-animation-rain-py)
Rain simulation
[Animated 3D random walk](https://matplotlib.org/stable/gallery/animation/random_walk.html#sphx-glr-gallery-animation-random-walk-py)
Animated 3D random walk
[Animated line plot](https://matplotlib.org/stable/gallery/animation/simple_anim.html#sphx-glr-gallery-animation-simple-anim-py)
Animated line plot
[Oscilloscope](https://matplotlib.org/stable/gallery/animation/strip_chart.html#sphx-glr-gallery-animation-strip-chart-py)
Oscilloscope
 [MATPLOTLIB UNCHAINED](https://matplotlib.org/stable/gallery/animation/unchained.html#sphx-glr-gallery-animation-unchained-py)
MATPLOTLIB \*\*UNCHAINED\*\*
[Close Event](https://matplotlib.org/stable/gallery/event_handling/close_event.html#sphx-glr-gallery-event-handling-close-event-py)
Close Event
[Mouse move and click events](https://matplotlib.org/stable/gallery/event_handling/coords_demo.html#sphx-glr-gallery-event-handling-coords-demo-py)
Mouse move and click events
[Cross hair cursor](https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py)
Cross hair cursor
[Data Browser](https://matplotlib.org/stable/gallery/event_handling/data_browser.html#sphx-glr-gallery-event-handling-data-browser-py)
Data Browser
[Figure/Axes enter and leave events](https://matplotlib.org/stable/gallery/event_handling/figure_axes_enter_leave.html#sphx-glr-gallery-event-handling-figure-axes-enter-leave-py)
Figure/Axes enter and leave events
[Interactive functions](https://matplotlib.org/stable/gallery/event_handling/ginput_manual_clabel_sgskip.html#sphx-glr-gallery-event-handling-ginput-manual-clabel-sgskip-py)
Interactive functions
[Image Slices Viewer](https://matplotlib.org/stable/gallery/event_handling/image_slices_viewer.html#sphx-glr-gallery-event-handling-image-slices-viewer-py)
Image Slices Viewer
[Keypress event](https://matplotlib.org/stable/gallery/event_handling/keypress_demo.html#sphx-glr-gallery-event-handling-keypress-demo-py)
Keypress event
[Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html#sphx-glr-gallery-event-handling-lasso-demo-py)
Lasso Demo
[Legend Picking](https://matplotlib.org/stable/gallery/event_handling/legend_picking.html#sphx-glr-gallery-event-handling-legend-picking-py)
Legend Picking
[Looking Glass](https://matplotlib.org/stable/gallery/event_handling/looking_glass.html#sphx-glr-gallery-event-handling-looking-glass-py)
Looking Glass
[Path Editor](https://matplotlib.org/stable/gallery/event_handling/path_editor.html#sphx-glr-gallery-event-handling-path-editor-py)
Path Editor
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Pick Event Demo2](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo2.html#sphx-glr-gallery-event-handling-pick-event-demo2-py)
Pick Event Demo2
[Poly Editor](https://matplotlib.org/stable/gallery/event_handling/poly_editor.html#sphx-glr-gallery-event-handling-poly-editor-py)
Poly Editor
[Pong](https://matplotlib.org/stable/gallery/event_handling/pong_sgskip.html#sphx-glr-gallery-event-handling-pong-sgskip-py)
Pong
[Resampling Data](https://matplotlib.org/stable/gallery/event_handling/resample.html#sphx-glr-gallery-event-handling-resample-py)
Resampling Data
[Timers](https://matplotlib.org/stable/gallery/event_handling/timers.html#sphx-glr-gallery-event-handling-timers-py)
Timers
[Trifinder Event Demo](https://matplotlib.org/stable/gallery/event_handling/trifinder_event_demo.html#sphx-glr-gallery-event-handling-trifinder-event-demo-py)
Trifinder Event Demo
[Viewlims](https://matplotlib.org/stable/gallery/event_handling/viewlims.html#sphx-glr-gallery-event-handling-viewlims-py)
Viewlims
[Zoom Window](https://matplotlib.org/stable/gallery/event_handling/zoom_window.html#sphx-glr-gallery-event-handling-zoom-window-py)
Zoom Window
[Anchored Artists](https://matplotlib.org/stable/gallery/misc/anchored_artists.html#sphx-glr-gallery-misc-anchored-artists-py)
Anchored Artists
[Changing colors of lines intersecting a box](https://matplotlib.org/stable/gallery/misc/bbox_intersect.html#sphx-glr-gallery-misc-bbox-intersect-py)
Changing colors of lines intersecting a box
[Manual Contour](https://matplotlib.org/stable/gallery/misc/contour_manual.html#sphx-glr-gallery-misc-contour-manual-py)
Manual Contour
[Coords Report](https://matplotlib.org/stable/gallery/misc/coords_report.html#sphx-glr-gallery-misc-coords-report-py)
Coords Report
[Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html#sphx-glr-gallery-misc-custom-projection-py)
Custom projection
[Customize Rc](https://matplotlib.org/stable/gallery/misc/customize_rc.html#sphx-glr-gallery-misc-customize-rc-py)
Customize Rc
[AGG filter](https://matplotlib.org/stable/gallery/misc/demo_agg_filter.html#sphx-glr-gallery-misc-demo-agg-filter-py)
AGG filter
[Ribbon Box](https://matplotlib.org/stable/gallery/misc/demo_ribbon_box.html#sphx-glr-gallery-misc-demo-ribbon-box-py)
Ribbon Box
[Fill Spiral](https://matplotlib.org/stable/gallery/misc/fill_spiral.html#sphx-glr-gallery-misc-fill-spiral-py)
Fill Spiral
[Findobj Demo](https://matplotlib.org/stable/gallery/misc/findobj_demo.html#sphx-glr-gallery-misc-findobj-demo-py)
Findobj Demo
[Building histograms using Rectangles and PolyCollections](https://matplotlib.org/stable/gallery/misc/histogram_path.html#sphx-glr-gallery-misc-histogram-path-py)
Building histograms using Rectangles and PolyCollections
[Plotting with keywords](https://matplotlib.org/stable/gallery/misc/keyword_plotting.html#sphx-glr-gallery-misc-keyword-plotting-py)
Plotting with keywords
[Matplotlib logo](https://matplotlib.org/stable/gallery/misc/logos2.html#sphx-glr-gallery-misc-logos2-py)
Matplotlib logo
[Multiprocess](https://matplotlib.org/stable/gallery/misc/multiprocess_sgskip.html#sphx-glr-gallery-misc-multiprocess-sgskip-py)
Multiprocess
[Packed-bubble chart](https://matplotlib.org/stable/gallery/misc/packed_bubbles.html#sphx-glr-gallery-misc-packed-bubbles-py)
Packed-bubble chart
[Patheffect Demo](https://matplotlib.org/stable/gallery/misc/patheffect_demo.html#sphx-glr-gallery-misc-patheffect-demo-py)
Patheffect Demo
[Pythonic Matplotlib](https://matplotlib.org/stable/gallery/misc/pythonic_matplotlib.html#sphx-glr-gallery-misc-pythonic-matplotlib-py)
Pythonic Matplotlib
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[Table Demo](https://matplotlib.org/stable/gallery/misc/table_demo.html#sphx-glr-gallery-misc-table-demo-py)
Table Demo
[TickedStroke patheffect](https://matplotlib.org/stable/gallery/misc/tickedstroke_demo.html#sphx-glr-gallery-misc-tickedstroke-demo-py)
TickedStroke patheffect
[transforms.offset\_copy](https://matplotlib.org/stable/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py)
transforms.offset\_copy
[Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html#sphx-glr-gallery-misc-zorder-demo-py)
Zorder Demo
[Plot 2D data on 3D plot](https://matplotlib.org/stable/gallery/mplot3d/2dcollections3d.html#sphx-glr-gallery-mplot3d-2dcollections3d-py)
Plot 2D data on 3D plot
[Demo of 3D bar charts](https://matplotlib.org/stable/gallery/mplot3d/3d_bars.html#sphx-glr-gallery-mplot3d-3d-bars-py)
Demo of 3D bar charts
[Create 2D bar graphs in different planes](https://matplotlib.org/stable/gallery/mplot3d/bars3d.html#sphx-glr-gallery-mplot3d-bars3d-py)
Create 2D bar graphs in different planes
[3D box surface plot](https://matplotlib.org/stable/gallery/mplot3d/box3d.html#sphx-glr-gallery-mplot3d-box3d-py)
3D box surface plot
[Demonstrates plotting contour (level) curves in 3D](https://matplotlib.org/stable/gallery/mplot3d/contour3d.html#sphx-glr-gallery-mplot3d-contour3d-py)
Demonstrates plotting contour (level) curves in 3D
[Demonstrates plotting contour (level) curves in 3D using the extend3d option](https://matplotlib.org/stable/gallery/mplot3d/contour3d_2.html#sphx-glr-gallery-mplot3d-contour3d-2-py)
Demonstrates plotting contour (level) curves in 3D using the extend3d option
[Projecting contour profiles onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html#sphx-glr-gallery-mplot3d-contour3d-3-py)
Projecting contour profiles onto a graph
[Filled contours](https://matplotlib.org/stable/gallery/mplot3d/contourf3d.html#sphx-glr-gallery-mplot3d-contourf3d-py)
Filled contours
[Projecting filled contour onto a graph](https://matplotlib.org/stable/gallery/mplot3d/contourf3d_2.html#sphx-glr-gallery-mplot3d-contourf3d-2-py)
Projecting filled contour onto a graph
[Custom hillshading in a 3D surface plot](https://matplotlib.org/stable/gallery/mplot3d/custom_shaded_3d_surface.html#sphx-glr-gallery-mplot3d-custom-shaded-3d-surface-py)
Custom hillshading in a 3D surface plot
[3D errorbars](https://matplotlib.org/stable/gallery/mplot3d/errorbar3d.html#sphx-glr-gallery-mplot3d-errorbar3d-py)
3D errorbars
[Create 3D histogram of 2D data](https://matplotlib.org/stable/gallery/mplot3d/hist3d.html#sphx-glr-gallery-mplot3d-hist3d-py)
Create 3D histogram of 2D data
[Parametric Curve](https://matplotlib.org/stable/gallery/mplot3d/lines3d.html#sphx-glr-gallery-mplot3d-lines3d-py)
Parametric Curve
[Lorenz Attractor](https://matplotlib.org/stable/gallery/mplot3d/lorenz_attractor.html#sphx-glr-gallery-mplot3d-lorenz-attractor-py)
Lorenz Attractor
[2D and 3D Axes in same Figure](https://matplotlib.org/stable/gallery/mplot3d/mixed_subplots.html#sphx-glr-gallery-mplot3d-mixed-subplots-py)
2D and 3D \*Axes\* in same \*Figure\*
[Automatic Text Offsetting](https://matplotlib.org/stable/gallery/mplot3d/offset.html#sphx-glr-gallery-mplot3d-offset-py)
Automatic Text Offsetting
[Draw flat objects in 3D plot](https://matplotlib.org/stable/gallery/mplot3d/pathpatch3d.html#sphx-glr-gallery-mplot3d-pathpatch3d-py)
Draw flat objects in 3D plot
[Generate polygons to fill under 3D line graph](https://matplotlib.org/stable/gallery/mplot3d/polys3d.html#sphx-glr-gallery-mplot3d-polys3d-py)
Generate polygons to fill under 3D line graph
[3D plot projection types](https://matplotlib.org/stable/gallery/mplot3d/projections.html#sphx-glr-gallery-mplot3d-projections-py)
3D plot projection types
[3D quiver plot](https://matplotlib.org/stable/gallery/mplot3d/quiver3d.html#sphx-glr-gallery-mplot3d-quiver3d-py)
3D quiver plot
[3D scatterplot](https://matplotlib.org/stable/gallery/mplot3d/scatter3d.html#sphx-glr-gallery-mplot3d-scatter3d-py)
3D scatterplot
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
[3D plots as subplots](https://matplotlib.org/stable/gallery/mplot3d/subplot3d.html#sphx-glr-gallery-mplot3d-subplot3d-py)
3D plots as subplots
[3D surface (colormap)](https://matplotlib.org/stable/gallery/mplot3d/surface3d.html#sphx-glr-gallery-mplot3d-surface3d-py)
3D surface (colormap)
[3D surface (solid color)](https://matplotlib.org/stable/gallery/mplot3d/surface3d_2.html#sphx-glr-gallery-mplot3d-surface3d-2-py)
3D surface (solid color)
[3D surface (checkerboard)](https://matplotlib.org/stable/gallery/mplot3d/surface3d_3.html#sphx-glr-gallery-mplot3d-surface3d-3-py)
3D surface (checkerboard)
[3D surface with polar coordinates](https://matplotlib.org/stable/gallery/mplot3d/surface3d_radial.html#sphx-glr-gallery-mplot3d-surface3d-radial-py)
3D surface with polar coordinates
[Text annotations in 3D](https://matplotlib.org/stable/gallery/mplot3d/text3d.html#sphx-glr-gallery-mplot3d-text3d-py)
Text annotations in 3D
[Triangular 3D contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontour3d.html#sphx-glr-gallery-mplot3d-tricontour3d-py)
Triangular 3D contour plot
[Triangular 3D filled contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontourf3d.html#sphx-glr-gallery-mplot3d-tricontourf3d-py)
Triangular 3D filled contour plot
[Triangular 3D surfaces](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d.html#sphx-glr-gallery-mplot3d-trisurf3d-py)
Triangular 3D surfaces
[More triangular 3D surfaces](https://matplotlib.org/stable/gallery/mplot3d/trisurf3d_2.html#sphx-glr-gallery-mplot3d-trisurf3d-2-py)
More triangular 3D surfaces
[Primary 3D view planes](https://matplotlib.org/stable/gallery/mplot3d/view_planes_3d.html#sphx-glr-gallery-mplot3d-view-planes-3d-py)
Primary 3D view planes
[3D voxel / volumetric plot](https://matplotlib.org/stable/gallery/mplot3d/voxels.html#sphx-glr-gallery-mplot3d-voxels-py)
3D voxel / volumetric plot
[3D voxel plot of the numpy logo](https://matplotlib.org/stable/gallery/mplot3d/voxels_numpy_logo.html#sphx-glr-gallery-mplot3d-voxels-numpy-logo-py)
3D voxel plot of the numpy logo
[3D voxel / volumetric plot with rgb colors](https://matplotlib.org/stable/gallery/mplot3d/voxels_rgb.html#sphx-glr-gallery-mplot3d-voxels-rgb-py)
3D voxel / volumetric plot with rgb colors
[3D voxel / volumetric plot with cylindrical coordinates](https://matplotlib.org/stable/gallery/mplot3d/voxels_torus.html#sphx-glr-gallery-mplot3d-voxels-torus-py)
3D voxel / volumetric plot with cylindrical coordinates
[3D wireframe plot](https://matplotlib.org/stable/gallery/mplot3d/wire3d.html#sphx-glr-gallery-mplot3d-wire3d-py)
3D wireframe plot
[3D wireframe plots in one direction](https://matplotlib.org/stable/gallery/mplot3d/wire3d_zero_stride.html#sphx-glr-gallery-mplot3d-wire3d-zero-stride-py)
3D wireframe plots in one direction
[Asinh Demo](https://matplotlib.org/stable/gallery/scales/asinh_demo.html#sphx-glr-gallery-scales-asinh-demo-py)
Asinh Demo
[Loglog Aspect](https://matplotlib.org/stable/gallery/scales/aspect_loglog.html#sphx-glr-gallery-scales-aspect-loglog-py)
Loglog Aspect
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[Log Bar](https://matplotlib.org/stable/gallery/scales/log_bar.html#sphx-glr-gallery-scales-log-bar-py)
Log Bar
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[Logit Demo](https://matplotlib.org/stable/gallery/scales/logit_demo.html#sphx-glr-gallery-scales-logit-demo-py)
Logit Demo
[Exploring normalizations](https://matplotlib.org/stable/gallery/scales/power_norm.html#sphx-glr-gallery-scales-power-norm-py)
Exploring normalizations
[Scales](https://matplotlib.org/stable/gallery/scales/scales.html#sphx-glr-gallery-scales-scales-py)
Scales
[Log Axis](https://matplotlib.org/stable/gallery/scales/semilogx_demo.html#sphx-glr-gallery-scales-semilogx-demo-py)
Log Axis
[Symlog Demo](https://matplotlib.org/stable/gallery/scales/symlog_demo.html#sphx-glr-gallery-scales-symlog-demo-py)
Symlog Demo
[Hillshading](https://matplotlib.org/stable/gallery/specialty_plots/advanced_hillshading.html#sphx-glr-gallery-specialty-plots-advanced-hillshading-py)
Hillshading
[Anscombe's quartet](https://matplotlib.org/stable/gallery/specialty_plots/anscombe.html#sphx-glr-gallery-specialty-plots-anscombe-py)
Anscombe's quartet
[Hinton diagrams](https://matplotlib.org/stable/gallery/specialty_plots/hinton_demo.html#sphx-glr-gallery-specialty-plots-hinton-demo-py)
Hinton diagrams
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[MRI](https://matplotlib.org/stable/gallery/specialty_plots/mri_demo.html#sphx-glr-gallery-specialty-plots-mri-demo-py)
===
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Radar chart (aka spider or star chart)](https://matplotlib.org/stable/gallery/specialty_plots/radar_chart.html#sphx-glr-gallery-specialty-plots-radar-chart-py)
Radar chart (aka spider or star chart)
[The Sankey class](https://matplotlib.org/stable/gallery/specialty_plots/sankey_basics.html#sphx-glr-gallery-specialty-plots-sankey-basics-py)
The Sankey class
[Long chain of connections using Sankey](https://matplotlib.org/stable/gallery/specialty_plots/sankey_links.html#sphx-glr-gallery-specialty-plots-sankey-links-py)
Long chain of connections using Sankey
[Rankine power cycle](https://matplotlib.org/stable/gallery/specialty_plots/sankey_rankine.html#sphx-glr-gallery-specialty-plots-sankey-rankine-py)
Rankine power cycle
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Topographic hillshading](https://matplotlib.org/stable/gallery/specialty_plots/topographic_hillshading.html#sphx-glr-gallery-specialty-plots-topographic-hillshading-py)
Topographic hillshading
[Centered spines with arrows](https://matplotlib.org/stable/gallery/spines/centered_spines_with_arrows.html#sphx-glr-gallery-spines-centered-spines-with-arrows-py)
Centered spines with arrows
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Spine Placement](https://matplotlib.org/stable/gallery/spines/spine_placement_demo.html#sphx-glr-gallery-spines-spine-placement-demo-py)
Spine Placement
[Spines](https://matplotlib.org/stable/gallery/spines/spines.html#sphx-glr-gallery-spines-spines-py)
Spines
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
[Dropped spines](https://matplotlib.org/stable/gallery/spines/spines_dropped.html#sphx-glr-gallery-spines-spines-dropped-py)
Dropped spines
[Automatically setting tick positions](https://matplotlib.org/stable/gallery/ticks/auto_ticks.html#sphx-glr-gallery-ticks-auto-ticks-py)
Automatically setting tick positions
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Custom Ticker](https://matplotlib.org/stable/gallery/ticks/custom_ticker1.html#sphx-glr-gallery-ticks-custom-ticker1-py)
Custom Ticker
[Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html#sphx-glr-gallery-ticks-date-concise-formatter-py)
Formatting date ticks using ConciseDateFormatter
[Date Demo Convert](https://matplotlib.org/stable/gallery/ticks/date_demo_convert.html#sphx-glr-gallery-ticks-date-demo-convert-py)
Date Demo Convert
[Placing date ticks using recurrence rules](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html#sphx-glr-gallery-ticks-date-demo-rrule-py)
Placing date ticks using recurrence rules
[Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html#sphx-glr-gallery-ticks-date-precision-and-epochs-py)
Date Precision and Epochs
[Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html#sphx-glr-gallery-ticks-major-minor-demo-py)
Major and minor ticks
[The default tick formatter](https://matplotlib.org/stable/gallery/ticks/scalarformatter.html#sphx-glr-gallery-ticks-scalarformatter-py)
The default tick formatter
[Tick formatters](https://matplotlib.org/stable/gallery/ticks/tick-formatters.html#sphx-glr-gallery-ticks-tick-formatters-py)
Tick formatters
[Tick locators](https://matplotlib.org/stable/gallery/ticks/tick-locators.html#sphx-glr-gallery-ticks-tick-locators-py)
Tick locators
[Set default y-axis tick labels on the right](https://matplotlib.org/stable/gallery/ticks/tick_label_right.html#sphx-glr-gallery-ticks-tick-label-right-py)
Set default y-axis tick labels on the right
[Setting tick labels from a list of values](https://matplotlib.org/stable/gallery/ticks/tick_labels_from_values.html#sphx-glr-gallery-ticks-tick-labels-from-values-py)
Setting tick labels from a list of values
[Move x-axis tick labels to the top](https://matplotlib.org/stable/gallery/ticks/tick_xlabel_top.html#sphx-glr-gallery-ticks-tick-xlabel-top-py)
Move x-axis tick labels to the top
[Rotating custom tick labels](https://matplotlib.org/stable/gallery/ticks/ticklabels_rotation.html#sphx-glr-gallery-ticks-ticklabels-rotation-py)
Rotating custom tick labels
[Fixing too many ticks](https://matplotlib.org/stable/gallery/ticks/ticks_too_many.html#sphx-glr-gallery-ticks-ticks-too-many-py)
Fixing too many ticks
[Annotation with units](https://matplotlib.org/stable/gallery/units/annotate_with_units.html#sphx-glr-gallery-units-annotate-with-units-py)
Annotation with units
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Bar demo with units](https://matplotlib.org/stable/gallery/units/bar_demo2.html#sphx-glr-gallery-units-bar-demo2-py)
Bar demo with units
[Group barchart with units](https://matplotlib.org/stable/gallery/units/bar_unit_demo.html#sphx-glr-gallery-units-bar-unit-demo-py)
Group barchart with units
[Ellipse with units](https://matplotlib.org/stable/gallery/units/ellipse_with_units.html#sphx-glr-gallery-units-ellipse-with-units-py)
Ellipse with units
[Evans test](https://matplotlib.org/stable/gallery/units/evans_test.html#sphx-glr-gallery-units-evans-test-py)
Evans test
[Radian ticks](https://matplotlib.org/stable/gallery/units/radian_demo.html#sphx-glr-gallery-units-radian-demo-py)
Radian ticks
[Inches and Centimeters](https://matplotlib.org/stable/gallery/units/units_sample.html#sphx-glr-gallery-units-units-sample-py)
Inches and Centimeters
[Unit handling](https://matplotlib.org/stable/gallery/units/units_scatter.html#sphx-glr-gallery-units-units-scatter-py)
Unit handling
[pyplot with GTK3](https://matplotlib.org/stable/gallery/user_interfaces/pylab_with_gtk3_sgskip.html#sphx-glr-gallery-user-interfaces-pylab-with-gtk3-sgskip-py)
pyplot with GTK3
[pyplot with GTK4](https://matplotlib.org/stable/gallery/user_interfaces/pylab_with_gtk4_sgskip.html#sphx-glr-gallery-user-interfaces-pylab-with-gtk4-sgskip-py)
pyplot with GTK4
[Tool Manager](https://matplotlib.org/stable/gallery/user_interfaces/toolmanager_sgskip.html#sphx-glr-gallery-user-interfaces-toolmanager-sgskip-py)
Tool Manager
[Anchored Box04](https://matplotlib.org/stable/gallery/userdemo/anchored_box04.html#sphx-glr-gallery-userdemo-anchored-box04-py)
Anchored Box04
[Annotate Explain](https://matplotlib.org/stable/gallery/userdemo/annotate_explain.html#sphx-glr-gallery-userdemo-annotate-explain-py)
Annotate Explain
[Annotate Simple01](https://matplotlib.org/stable/gallery/userdemo/annotate_simple01.html#sphx-glr-gallery-userdemo-annotate-simple01-py)
Annotate Simple01
[Annotate Simple02](https://matplotlib.org/stable/gallery/userdemo/annotate_simple02.html#sphx-glr-gallery-userdemo-annotate-simple02-py)
Annotate Simple02
[Annotate Simple03](https://matplotlib.org/stable/gallery/userdemo/annotate_simple03.html#sphx-glr-gallery-userdemo-annotate-simple03-py)
Annotate Simple03
[Annotate Simple04](https://matplotlib.org/stable/gallery/userdemo/annotate_simple04.html#sphx-glr-gallery-userdemo-annotate-simple04-py)
Annotate Simple04
[Annotate Simple Coord01](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord01.html#sphx-glr-gallery-userdemo-annotate-simple-coord01-py)
Annotate Simple Coord01
[Annotate Simple Coord02](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord02.html#sphx-glr-gallery-userdemo-annotate-simple-coord02-py)
Annotate Simple Coord02
[Annotate Simple Coord03](https://matplotlib.org/stable/gallery/userdemo/annotate_simple_coord03.html#sphx-glr-gallery-userdemo-annotate-simple-coord03-py)
Annotate Simple Coord03
[Annotate Text Arrow](https://matplotlib.org/stable/gallery/userdemo/annotate_text_arrow.html#sphx-glr-gallery-userdemo-annotate-text-arrow-py)
Annotate Text Arrow
[Connect Simple01](https://matplotlib.org/stable/gallery/userdemo/connect_simple01.html#sphx-glr-gallery-userdemo-connect-simple01-py)
Connect Simple01
[Connection styles for annotations](https://matplotlib.org/stable/gallery/userdemo/connectionstyle_demo.html#sphx-glr-gallery-userdemo-connectionstyle-demo-py)
Connection styles for annotations
[Custom box styles](https://matplotlib.org/stable/gallery/userdemo/custom_boxstyle01.html#sphx-glr-gallery-userdemo-custom-boxstyle01-py)
Custom box styles
[subplot2grid demo](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec01.html#sphx-glr-gallery-userdemo-demo-gridspec01-py)
subplot2grid demo
[GridSpec demo](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec03.html#sphx-glr-gallery-userdemo-demo-gridspec03-py)
GridSpec demo
[Nested GridSpecs](https://matplotlib.org/stable/gallery/userdemo/demo_gridspec06.html#sphx-glr-gallery-userdemo-demo-gridspec06-py)
Nested GridSpecs
[Simple Annotate01](https://matplotlib.org/stable/gallery/userdemo/simple_annotate01.html#sphx-glr-gallery-userdemo-simple-annotate01-py)
Simple Annotate01
[Simple Legend01](https://matplotlib.org/stable/gallery/userdemo/simple_legend01.html#sphx-glr-gallery-userdemo-simple-legend01-py)
Simple Legend01
[Simple Legend02](https://matplotlib.org/stable/gallery/userdemo/simple_legend02.html#sphx-glr-gallery-userdemo-simple-legend02-py)
Simple Legend02
[Annotated Cursor](https://matplotlib.org/stable/gallery/widgets/annotated_cursor.html#sphx-glr-gallery-widgets-annotated-cursor-py)
Annotated Cursor
[Buttons](https://matplotlib.org/stable/gallery/widgets/buttons.html#sphx-glr-gallery-widgets-buttons-py)
Buttons
[Check Buttons](https://matplotlib.org/stable/gallery/widgets/check_buttons.html#sphx-glr-gallery-widgets-check-buttons-py)
Check Buttons
[Cursor](https://matplotlib.org/stable/gallery/widgets/cursor.html#sphx-glr-gallery-widgets-cursor-py)
Cursor
[Lasso Selector](https://matplotlib.org/stable/gallery/widgets/lasso_selector_demo_sgskip.html#sphx-glr-gallery-widgets-lasso-selector-demo-sgskip-py)
Lasso Selector
[Menu](https://matplotlib.org/stable/gallery/widgets/menu.html#sphx-glr-gallery-widgets-menu-py)
Menu
[Mouse Cursor](https://matplotlib.org/stable/gallery/widgets/mouse_cursor.html#sphx-glr-gallery-widgets-mouse-cursor-py)
Mouse Cursor
[Multicursor](https://matplotlib.org/stable/gallery/widgets/multicursor.html#sphx-glr-gallery-widgets-multicursor-py)
Multicursor
[Select indices from a collection using polygon selector](https://matplotlib.org/stable/gallery/widgets/polygon_selector_demo.html#sphx-glr-gallery-widgets-polygon-selector-demo-py)
Select indices from a collection using polygon selector
[Radio Buttons](https://matplotlib.org/stable/gallery/widgets/radio_buttons.html#sphx-glr-gallery-widgets-radio-buttons-py)
Radio Buttons
[Thresholding an Image with RangeSlider](https://matplotlib.org/stable/gallery/widgets/range_slider.html#sphx-glr-gallery-widgets-range-slider-py)
Thresholding an Image with RangeSlider
[Rectangle and ellipse selectors](https://matplotlib.org/stable/gallery/widgets/rectangle_selector.html#sphx-glr-gallery-widgets-rectangle-selector-py)
Rectangle and ellipse selectors
[Slider](https://matplotlib.org/stable/gallery/widgets/slider_demo.html#sphx-glr-gallery-widgets-slider-demo-py)
Slider
[Snapping Sliders to Discrete Values](https://matplotlib.org/stable/gallery/widgets/slider_snap_demo.html#sphx-glr-gallery-widgets-slider-snap-demo-py)
Snapping Sliders to Discrete Values
[Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html#sphx-glr-gallery-widgets-span-selector-py)
Span Selector
[Textbox](https://matplotlib.org/stable/gallery/widgets/textbox.html#sphx-glr-gallery-widgets-textbox-py)
Textbox
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
[Customizing Matplotlib with style sheets and rcParams](https://matplotlib.org/stable/tutorials/introductory/customizing.html#sphx-glr-tutorials-introductory-customizing-py)
Customizing Matplotlib with style sheets and rcParams
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Styling with cycler](https://matplotlib.org/stable/tutorials/intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py)
Styling with cycler
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
[origin and extent in imshow](https://matplotlib.org/stable/tutorials/intermediate/imshow_extent.html#sphx-glr-tutorials-intermediate-imshow-extent-py)
\*origin\* and \*extent\* in `~.Axes.imshow`
[Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html#sphx-glr-tutorials-advanced-blitting-py)
Faster rendering by using blitting
[Path Tutorial](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py)
Path Tutorial
[Path effects guide](https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py)
Path effects guide
[Transformations Tutorial](https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py)
Transformations Tutorial
[Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html#sphx-glr-tutorials-colors-colors-py)
Specifying Colors
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py)
Creating Colormaps in Matplotlib
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
[Text properties and layout](https://matplotlib.org/stable/tutorials/text/text_props.html#sphx-glr-tutorials-text-text-props-py)
Text properties and layout
[plot(x, y)](https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py)
plot(x, y)
[scatter(x, y)](https://matplotlib.org/stable/plot_types/basic/scatter_plot.html#sphx-glr-plot-types-basic-scatter-plot-py)
scatter(x, y)
[bar(x, height)](https://matplotlib.org/stable/plot_types/basic/bar.html#sphx-glr-plot-types-basic-bar-py)
bar(x, height)
[stem(x, y)](https://matplotlib.org/stable/plot_types/basic/stem.html#sphx-glr-plot-types-basic-stem-py)
stem(x, y)
[step(x, y)](https://matplotlib.org/stable/plot_types/basic/step.html#sphx-glr-plot-types-basic-step-py)
step(x, y)
[fill\_between(x, y1, y2)](https://matplotlib.org/stable/plot_types/basic/fill_between.html#sphx-glr-plot-types-basic-fill-between-py)
fill\_between(x, y1, y2)
[stackplot(x, y)](https://matplotlib.org/stable/plot_types/basic/stackplot.html#sphx-glr-plot-types-basic-stackplot-py)
stackplot(x, y)
[imshow(Z)](https://matplotlib.org/stable/plot_types/arrays/imshow.html#sphx-glr-plot-types-arrays-imshow-py)
imshow(Z)
[pcolormesh(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/pcolormesh.html#sphx-glr-plot-types-arrays-pcolormesh-py)
pcolormesh(X, Y, Z)
[contour(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/contour.html#sphx-glr-plot-types-arrays-contour-py)
contour(X, Y, Z)
[contourf(X, Y, Z)](https://matplotlib.org/stable/plot_types/arrays/contourf.html#sphx-glr-plot-types-arrays-contourf-py)
contourf(X, Y, Z)
[barbs(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/barbs.html#sphx-glr-plot-types-arrays-barbs-py)
barbs(X, Y, U, V)
[quiver(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/quiver.html#sphx-glr-plot-types-arrays-quiver-py)
quiver(X, Y, U, V)
[streamplot(X, Y, U, V)](https://matplotlib.org/stable/plot_types/arrays/streamplot.html#sphx-glr-plot-types-arrays-streamplot-py)
streamplot(X, Y, U, V)
[hist(x)](https://matplotlib.org/stable/plot_types/stats/hist_plot.html#sphx-glr-plot-types-stats-hist-plot-py)
hist(x)
[boxplot(X)](https://matplotlib.org/stable/plot_types/stats/boxplot_plot.html#sphx-glr-plot-types-stats-boxplot-plot-py)
boxplot(X)
[errorbar(x, y, yerr, xerr)](https://matplotlib.org/stable/plot_types/stats/errorbar_plot.html#sphx-glr-plot-types-stats-errorbar-plot-py)
errorbar(x, y, yerr, xerr)
[violinplot(D)](https://matplotlib.org/stable/plot_types/stats/violin.html#sphx-glr-plot-types-stats-violin-py)
violinplot(D)
[eventplot(D)](https://matplotlib.org/stable/plot_types/stats/eventplot.html#sphx-glr-plot-types-stats-eventplot-py)
eventplot(D)
[hist2d(x, y)](https://matplotlib.org/stable/plot_types/stats/hist2d.html#sphx-glr-plot-types-stats-hist2d-py)
hist2d(x, y)
[hexbin(x, y, C)](https://matplotlib.org/stable/plot_types/stats/hexbin.html#sphx-glr-plot-types-stats-hexbin-py)
hexbin(x, y, C)
[pie(x)](https://matplotlib.org/stable/plot_types/stats/pie.html#sphx-glr-plot-types-stats-pie-py)
pie(x)
[tricontour(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontour.html#sphx-glr-plot-types-unstructured-tricontour-py)
tricontour(x, y, z)
[tricontourf(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontourf.html#sphx-glr-plot-types-unstructured-tricontourf-py)
tricontourf(x, y, z)
[tripcolor(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tripcolor.html#sphx-glr-plot-types-unstructured-tripcolor-py)
tripcolor(x, y, z)
[triplot(x, y)](https://matplotlib.org/stable/plot_types/unstructured/triplot.html#sphx-glr-plot-types-unstructured-triplot-py)
triplot(x, y)
| programming_docs |
matplotlib matplotlib.axes.Axes.tricontour matplotlib.axes.Axes.tricontour
===============================
Axes.tricontour(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/tri/tricontour.py#L215-L241)
Draw contour lines on an unstructured triangular grid.
Call signatures:
```
tricontour(triangulation, Z, [levels], ...)
tricontour(x, y, Z, [levels], *, [triangles=triangles], [mask=mask], ...)
```
The triangular grid can be specified either by passing a [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object as the first parameter, or by passing the points *x*, *y* and optionally the *triangles* and a *mask*. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") for an explanation of these parameters. If neither of *triangulation* or *triangles* are given, the triangulation is calculated on the fly.
It is possible to pass *triangles* positionally, i.e. `tricontour(x, y, triangles, Z, ...)`. However, this is discouraged. For more clarity, pass *triangles* via keyword argument.
Parameters:
**triangulation**[`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"), optional
An already created triangular grid.
**x, y, triangles, mask**
Parameters defining the triangular grid. See [`Triangulation`](../tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation"). This is mutually exclusive with specifying *triangulation*.
**Z**array-like
The height values over which the contour is drawn. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
**levels**int or array-like, optional
Determines the number and positions of the contour lines / regions.
If an int *n*, use [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator"), which tries to automatically choose no more than *n+1* "nice" contour levels between *vmin* and *vmax*.
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
Returns:
[`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet")
Other Parameters:
**colors**color string or sequence of colors, optional
The colors of the levels, i.e., the contour lines.
The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it is repeated.
As a shortcut, single color strings may be used in place of one-element lists, i.e. `'red'` instead of `['red']` to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors.
By default (value *None*), the colormap specified by *cmap* will be used.
**alpha**float, default: 1
The alpha blending value, between 0 (transparent) and 1 (opaque).
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *colors* is set.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *colors* is set.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
If *vmin* or *vmax* are not given, the default color scaling is based on *levels*.
This parameter is ignored if *colors* is set.
**origin**{*None*, 'upper', 'lower', 'image'}, default: None
Determines the orientation and exact position of *Z* by specifying the position of `Z[0, 0]`. This is only relevant, if *X*, *Y* are not given.
* *None*: `Z[0, 0]` is at X=0, Y=0 in the lower left corner.
* 'lower': `Z[0, 0]` is at X=0.5, Y=0.5 in the lower left corner.
* 'upper': `Z[0, 0]` is at X=N+0.5, Y=0.5 in the upper left corner.
* 'image': Use the value from `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`).
**extent**(x0, x1, y0, y1), optional
If *origin* is not *None*, then *extent* is interpreted as in [`imshow`](matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow"): it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0], and (*x1*, *y1*) is the position of Z[-1, -1].
This argument is ignored if *X* and *Y* are specified in the call to contour.
**locator**ticker.Locator subclass, optional
The locator is used to determine the contour levels if they are not given explicitly via *levels*. Defaults to [`MaxNLocator`](../ticker_api#matplotlib.ticker.MaxNLocator "matplotlib.ticker.MaxNLocator").
**extend**{'neither', 'both', 'min', 'max'}, default: 'neither'
Determines the `tricontour`-coloring of values that are outside the *levels* range.
If 'neither', values outside the *levels* range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the *levels* range.
Values below `min(levels)` and above `max(levels)` are mapped to the under/over values of the [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using [`Colormap.set_under`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_under "matplotlib.colors.Colormap.set_under") and [`Colormap.set_over`](matplotlib.colors.colormap#matplotlib.colors.Colormap.set_over "matplotlib.colors.Colormap.set_over").
Note
An existing [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") does not get notified if properties of its colormap are changed. Therefore, an explicit call to [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed") is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the [`TriContourSet`](../tri_api#matplotlib.tri.TriContourSet "matplotlib.tri.TriContourSet") because it internally calls [`ContourSet.changed()`](../contour_api#matplotlib.contour.ContourSet.changed "matplotlib.contour.ContourSet.changed").
**xunits, yunits**registered units, optional
Override axis units by specifying an instance of a [`matplotlib.units.ConversionInterface`](../units_api#matplotlib.units.ConversionInterface "matplotlib.units.ConversionInterface").
**antialiased**bool, optional
Enable antialiasing, overriding the defaults. For filled contours, the default is *True*. For line contours, it is taken from `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`).
**linewidths**float or array-like, default: `[rcParams["contour.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.linewidth#matplotlibrc-sample)` (default: `None`)
The line width of the contour lines.
If a number, all levels will be plotted with this linewidth.
If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified.
If None, this falls back to `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`).
**linestyles**{*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
If *linestyles* is *None*, the default is 'solid' unless the lines are monochrome. In that case, negative contours will take their linestyle from `[rcParams["contour.negative\_linestyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=contour.negative_linestyle#matplotlibrc-sample)` (default: `'dashed'`) setting.
*linestyles* can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.
Examples using `matplotlib.axes.Axes.tricontour`
------------------------------------------------
[Contour plot of irregularly spaced data](https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html#sphx-glr-gallery-images-contours-and-fields-irregulardatagrid-py)
Contour plot of irregularly spaced data
[Tricontour Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_demo.html#sphx-glr-gallery-images-contours-and-fields-tricontour-demo-py)
Tricontour Demo
[Tricontour Smooth Delaunay](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_delaunay.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-delaunay-py)
Tricontour Smooth Delaunay
[Tricontour Smooth User](https://matplotlib.org/stable/gallery/images_contours_and_fields/tricontour_smooth_user.html#sphx-glr-gallery-images-contours-and-fields-tricontour-smooth-user-py)
Tricontour Smooth User
[Trigradient Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/trigradient_demo.html#sphx-glr-gallery-images-contours-and-fields-trigradient-demo-py)
Trigradient Demo
[Triangular 3D contour plot](https://matplotlib.org/stable/gallery/mplot3d/tricontour3d.html#sphx-glr-gallery-mplot3d-tricontour3d-py)
Triangular 3D contour plot
[tricontour(x, y, z)](https://matplotlib.org/stable/plot_types/unstructured/tricontour.html#sphx-glr-plot-types-unstructured-tricontour-py)
tricontour(x, y, z)
matplotlib matplotlib.colors.SymLogNorm matplotlib.colors.SymLogNorm
============================
*class*matplotlib.colors.SymLogNorm(*linthresh*, *linscale=1.0*, *vmin=None*, *vmax=None*, *clip=False*, *\**, *base=10*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1782-L1817)
Bases: [`SymLogNorm`](#matplotlib.colors.SymLogNorm "matplotlib.colors.SymLogNorm")
The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin.
Since the values close to zero tend toward infinity, there is a need to have a range around zero that is linear. The parameter *linthresh* allows the user to specify the size of this range (-*linthresh*, *linthresh*).
Parameters:
**linthresh**float
The range within which the plot is linear (to avoid having the plot go to infinity around zero).
**linscale**float, default: 1
This allows the linear range (-*linthresh* to *linthresh*) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when *linscale* == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
**base**float, default: 10
Parameters:
**vmin, vmax**float or None
If *vmin* and/or *vmax* is not given, they are initialized from the minimum and maximum value, respectively, of the first input processed; i.e., `__call__(A)` calls `autoscale_None(A)`.
**clip**bool, default: False
If `True` values falling outside the range `[vmin, vmax]`, are mapped to 0 or 1, whichever is closer, and masked values are set to 1. If `False` masked values remain masked.
Clipping silently defeats the purpose of setting the over, under, and masked colors in a colormap, so it is likely to lead to surprises; therefore the default is `clip=False`.
#### Notes
Returns 0 if `vmin == vmax`.
\_\_call\_\_(*value*, *clip=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1676-L1695)
Normalize *value* data in the `[vmin, vmax]` interval into the `[0.0, 1.0]` interval and return it.
Parameters:
**value**
Data to normalize.
**clip**bool
If `None`, defaults to `self.clip` (which defaults to `False`).
#### Notes
If not already initialized, `self.vmin` and `self.vmax` are initialized using `self.autoscale_None(value)`.
autoscale(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1714-L1717)
Set *vmin*, *vmax* to min, max of *A*.
autoscale\_None(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1719-L1721)
If vmin or vmax are not set, use the min/max of *A* to set them.
inverse(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L1697-L1712)
Examples using `matplotlib.colors.SymLogNorm`
---------------------------------------------
[Colormap Normalizations](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py)
Colormap Normalizations
[Colormap Normalizations SymLogNorm](https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations_symlognorm.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-symlognorm-py)
Colormap Normalizations SymLogNorm
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py)
Colormap Normalization
matplotlib matplotlib.pyplot.text matplotlib.pyplot.text
======================
matplotlib.pyplot.text(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2899-L2901)
Add text to the Axes.
Add the text *s* to the Axes at location *x*, *y* in data coordinates.
Parameters:
**x, y**float
The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the *transform* parameter.
**s**str
The text.
**fontdict**dict, default: None
A dictionary to override the default text properties. If fontdict is None, the defaults are determined by [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams").
Returns:
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The created [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](../text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](../text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](../text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](../text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](../text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](../text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](../text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](../text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](../text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](../text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](../text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](../text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](../text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](../text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](../text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](../text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](../text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](../text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](../text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](../text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](../text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](../text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](../text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](../text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](../text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
#### Examples
Individual keyword arguments can be used to override any given parameter:
```
>>> text(x, y, s, fontsize=12)
```
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes:
```
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
... verticalalignment='center', transform=ax.transAxes)
```
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword *bbox*. *bbox* is a dictionary of [`Rectangle`](matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") properties. For example:
```
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
```
Examples using `matplotlib.pyplot.text`
---------------------------------------
[Figure size in different units](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_size_units.html#sphx-glr-gallery-subplots-axes-and-figures-figure-size-units-py)
Figure size in different units
[Auto-wrapping text](https://matplotlib.org/stable/gallery/text_labels_and_annotations/autowrap.html#sphx-glr-gallery-text-labels-and-annotations-autowrap-py)
Auto-wrapping text
[Styling text boxes](https://matplotlib.org/stable/gallery/text_labels_and_annotations/fancytextbox_demo.html#sphx-glr-gallery-text-labels-and-annotations-fancytextbox-demo-py)
Styling text boxes
[Controlling style of text and labels using a dictionary](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_fontdict.html#sphx-glr-gallery-text-labels-and-annotations-text-fontdict-py)
Controlling style of text and labels using a dictionary
[Pyplot Mathtext](https://matplotlib.org/stable/gallery/pyplots/pyplot_mathtext.html#sphx-glr-gallery-pyplots-pyplot-mathtext-py)
Pyplot Mathtext
[Pyplot Text](https://matplotlib.org/stable/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)
Pyplot Text
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Close Event](https://matplotlib.org/stable/gallery/event_handling/close_event.html#sphx-glr-gallery-event-handling-close-event-py)
Close Event
[transforms.offset\_copy](https://matplotlib.org/stable/gallery/misc/transoffset.html#sphx-glr-gallery-misc-transoffset-py)
transforms.offset\_copy
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
[Path effects guide](https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py)
Path effects guide
[Text properties and layout](https://matplotlib.org/stable/tutorials/text/text_props.html#sphx-glr-tutorials-text-text-props-py)
Text properties and layout
[Annotations](https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py)
Annotations
| programming_docs |
matplotlib matplotlib.axes.Axes.set_yticklabels matplotlib.axes.Axes.set\_yticklabels
=====================================
Axes.set\_yticklabels(*labels*, *\**, *fontdict=None*, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the yaxis' labels with list of string labels.
Warning
This method should only be used after fixing the tick positions using [`Axes.set_yticks`](matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks"). Otherwise, the labels may end up in unexpected positions.
Parameters:
**labels**list of str
The label texts.
**fontdict**dict, optional
A dictionary controlling the appearance of the ticklabels. The default *fontdict* is:
```
{'fontsize': rcParams['axes.titlesize'],
'fontweight': rcParams['axes.titleweight'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}
```
**minor**bool, default: False
Whether to set the minor ticklabels rather than the major ones.
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The labels.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Examples using `matplotlib.axes.Axes.set_yticklabels`
-----------------------------------------------------
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Artist customization in box plots](https://matplotlib.org/stable/gallery/statistics/boxplot.html#sphx-glr-gallery-statistics-boxplot-py)
Artist customization in box plots
[Boxplot drawer function](https://matplotlib.org/stable/gallery/statistics/bxp.html#sphx-glr-gallery-statistics-bxp-py)
Boxplot drawer function
[Violin plot basics](https://matplotlib.org/stable/gallery/statistics/violinplot.html#sphx-glr-gallery-statistics-violinplot-py)
Violin plot basics
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
matplotlib matplotlib.pyplot.uninstall_repl_displayhook matplotlib.pyplot.uninstall\_repl\_displayhook
==============================================
matplotlib.pyplot.uninstall\_repl\_displayhook()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L159-L166)
Disconnect from the display hook of the current shell.
matplotlib matplotlib.pyplot.gca matplotlib.pyplot.gca
=====================
matplotlib.pyplot.gca()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2223-L2225)
Get the current Axes.
If there is currently no Axes on this Figure, a new one is created using [`Figure.add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot"). (To test whether there is currently an Axes on a Figure, check whether `figure.axes` is empty. To test whether there is currently a Figure on the pyplot figure stack, check whether [`pyplot.get_fignums()`](matplotlib.pyplot.get_fignums#matplotlib.pyplot.get_fignums "matplotlib.pyplot.get_fignums") is empty.)
Examples using `matplotlib.pyplot.gca`
--------------------------------------
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Managing multiple figures in pyplot](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/multiple_figs_demo.html#sphx-glr-gallery-subplots-axes-and-figures-multiple-figs-demo-py)
Managing multiple figures in pyplot
[Scale invariant angle label](https://matplotlib.org/stable/gallery/text_labels_and_annotations/angle_annotation.html#sphx-glr-gallery-text-labels-and-annotations-angle-annotation-py)
Scale invariant angle label
[Rainbow text](https://matplotlib.org/stable/gallery/text_labels_and_annotations/rainbow_text.html#sphx-glr-gallery-text-labels-and-annotations-rainbow-text-py)
Rainbow text
[Infinite lines](https://matplotlib.org/stable/gallery/pyplots/axline.html#sphx-glr-gallery-pyplots-axline-py)
Infinite lines
[Set and get properties](https://matplotlib.org/stable/gallery/misc/set_and_get.html#sphx-glr-gallery-misc-set-and-get-py)
Set and get properties
[Hinton diagrams](https://matplotlib.org/stable/gallery/specialty_plots/hinton_demo.html#sphx-glr-gallery-specialty-plots-hinton-demo-py)
Hinton diagrams
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.colors.Colormap matplotlib.colors.Colormap
==========================
*class*matplotlib.colors.Colormap(*name*, *N=256*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L647-L941)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Baseclass for all scalar to RGBA mappings.
Typically, Colormap instances are used to convert data values (floats) from the interval `[0, 1]` to the RGBA color that the respective Colormap represents. For scaling of data into the `[0, 1]` interval see [`matplotlib.colors.Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"). Subclasses of [`matplotlib.cm.ScalarMappable`](../cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") make heavy use of this `data -> normalize -> map-to-color` processing chain.
Parameters:
**name**str
The name of the colormap.
**N**int
The number of rgb quantization levels.
\_\_call\_\_(*X*, *alpha=None*, *bytes=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L683-L755)
Parameters:
**X**float or int, ndarray or scalar
The data value(s) to convert to RGBA. For floats, X should be in the interval `[0.0, 1.0]` to return the RGBA values `X*100` percent along the Colormap line. For integers, X should be in the interval `[0, Colormap.N)` to return RGBA values *indexed* from the Colormap with index `X`.
**alpha**float or array-like or None
Alpha must be a scalar between 0 and 1, a sequence of such floats with shape matching X, or None.
**bytes**bool
If False (default), the returned RGBA values will be floats in the interval `[0, 1]` otherwise they will be uint8s in the interval `[0, 255]`.
Returns:
Tuple of RGBA values if X is scalar, otherwise an array of
RGBA values with a shape of `X.shape + (4, )`.
colorbar\_extend
When this colormap exists on a scalar mappable and colorbar\_extend is not False, colorbar creation will pick up `colorbar_extend` as the default value for the `extend` keyword in the [`matplotlib.colorbar.Colorbar`](../colorbar_api#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar") constructor.
copy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L939-L941)
Return a copy of the colormap.
get\_bad()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L776-L780)
Get the color for masked values.
get\_over()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L800-L804)
Get the color for high out-of-range values.
get\_under()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L788-L792)
Get the color for low out-of-range values.
is\_gray()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L849-L854)
Return whether the colormap is grayscale.
resampled(*lutsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L856-L867)
Return a new colormap with *lutsize* entries.
reversed(*name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L869-L886)
Return a reversed instance of the Colormap.
Note
This function is not implemented for base class.
Parameters:
**name**str, optional
The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "\_r".
See also
[`LinearSegmentedColormap.reversed`](matplotlib.colors.linearsegmentedcolormap#matplotlib.colors.LinearSegmentedColormap.reversed "matplotlib.colors.LinearSegmentedColormap.reversed")
[`ListedColormap.reversed`](matplotlib.colors.listedcolormap#matplotlib.colors.ListedColormap.reversed "matplotlib.colors.ListedColormap.reversed")
set\_bad(*color='k'*, *alpha=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L782-L786)
Set the color for masked values.
set\_extremes(*\**, *bad=None*, *under=None*, *over=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L812-L822)
Set the colors for masked (*bad*) values and, when `norm.clip =
False`, low (*under*) and high (*over*) out-of-range values.
set\_over(*color='k'*, *alpha=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L806-L810)
Set the color for high out-of-range values.
set\_under(*color='k'*, *alpha=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L794-L798)
Set the color for low out-of-range values.
with\_extremes(*\**, *bad=None*, *under=None*, *over=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/colors.py#L824-L832)
Return a copy of the colormap, for which the colors for masked (*bad*) values and, when `norm.clip = False`, low (*under*) and high (*over*) out-of-range values, have been set accordingly.
Examples using `matplotlib.colors.Colormap`
-------------------------------------------
[Multicolored lines](https://matplotlib.org/stable/gallery/lines_bars_and_markers/multicolored_line.html#sphx-glr-gallery-lines-bars-and-markers-multicolored-line-py)
Multicolored lines
[Creating a colormap from a list of colors](https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-gallery-color-custom-cmap-py)
Creating a colormap from a list of colors
[Left ventricle bullseye](https://matplotlib.org/stable/gallery/specialty_plots/leftventricle_bulleye.html#sphx-glr-gallery-specialty-plots-leftventricle-bulleye-py)
Left ventricle bullseye
[Customized Colorbars Tutorial](https://matplotlib.org/stable/tutorials/colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py)
Customized Colorbars Tutorial
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py)
Creating Colormaps in Matplotlib
matplotlib matplotlib.axes.Axes.minorticks_off matplotlib.axes.Axes.minorticks\_off
====================================
Axes.minorticks\_off()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3986-L3989)
Remove minor ticks from the Axes.
matplotlib matplotlib.pyplot.yscale matplotlib.pyplot.yscale
========================
matplotlib.pyplot.yscale(*value*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L3027-L3029)
Set the yaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](../scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](../scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](../scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](../scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](../scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](../scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](../scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
Examples using `matplotlib.pyplot.yscale`
-----------------------------------------
[Custom scale](https://matplotlib.org/stable/gallery/scales/custom_scale.html#sphx-glr-gallery-scales-custom-scale-py)
Custom scale
[Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py)
Pyplot tutorial
matplotlib mpl_toolkits.axes_grid1.axes_divider.AxesDivider mpl\_toolkits.axes\_grid1.axes\_divider.AxesDivider
===================================================
*class*mpl\_toolkits.axes\_grid1.axes\_divider.AxesDivider(*axes*, *xref=None*, *yref=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L394-L558)
Bases: [`Divider`](mpl_toolkits.axes_grid1.axes_divider.divider#mpl_toolkits.axes_grid1.axes_divider.Divider "mpl_toolkits.axes_grid1.axes_divider.Divider")
Divider based on the preexisting axes.
Parameters:
**axes**[`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
**xref**
**yref**
append\_axes(*position*, *size*, *pad=None*, *add\_to\_figure=<deprecated parameter>*, *\**, *axes\_class=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L495-L529)
Add a new axes on a given side of the main axes.
Parameters:
**position**{"left", "right", "bottom", "top"}
Where the new axes is positioned relative to the main axes.
**size**[`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size") or float or str
The axes width or height. float or str arguments are interpreted as `axes_size.from_any(size, AxesX(<main_axes>))` for left or right axes, and likewise with `AxesY` for bottom or top axes.
**pad**[`axes_size`](mpl_toolkits.axes_grid1.axes_size#module-mpl_toolkits.axes_grid1.axes_size "mpl_toolkits.axes_grid1.axes_size") or float or str
Padding between the axes. float or str arguments are interpreted as for *size*. Defaults to `[rcParams["figure.subplot.wspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.wspace#matplotlibrc-sample)` (default: `0.2`) times the main axes width (left or right axes) or `[rcParams["figure.subplot.hspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.hspace#matplotlibrc-sample)` (default: `0.2`) times the main axes height (bottom or top axes).
**axes\_class**subclass type of [`Axes`](../axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The type of the new axes. Defaults to the type of the main axes.
**\*\*kwargs**
All extra keywords arguments are passed to the created axes.
get\_anchor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L548-L552)
Return the anchor.
get\_aspect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L531-L539)
Return aspect.
get\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L541-L546)
Return the position of the rectangle.
get\_subplotspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/axes_divider.py#L554-L558)
Examples using `mpl_toolkits.axes_grid1.axes_divider.AxesDivider`
-----------------------------------------------------------------
[Colorbar with AxesDivider](https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_axes_divider.html#sphx-glr-gallery-axes-grid1-demo-colorbar-with-axes-divider-py)
Colorbar with `.AxesDivider`
[Make room for ylabel using axes\_grid](https://matplotlib.org/stable/gallery/axes_grid1/make_room_for_ylabel_using_axesgrid.html#sphx-glr-gallery-axes-grid1-make-room-for-ylabel-using-axesgrid-py)
Make room for ylabel using axes\_grid
[Scatter Histogram (Locatable Axes)](https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-gallery-axes-grid1-scatter-hist-locatable-axes-py)
Scatter Histogram (Locatable Axes)
[Simple Colorbar](https://matplotlib.org/stable/gallery/axes_grid1/simple_colorbar.html#sphx-glr-gallery-axes-grid1-simple-colorbar-py)
Simple Colorbar
[Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py)
Tight Layout guide
matplotlib matplotlib.animation.AbstractMovieWriter matplotlib.animation.AbstractMovieWriter
========================================
*class*matplotlib.animation.AbstractMovieWriter(*fps=5*, *metadata=None*, *codec=None*, *bitrate=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L154-L233)
Abstract base class for writing movies, providing a way to grab frames by calling [`grab_frame`](#matplotlib.animation.AbstractMovieWriter.grab_frame "matplotlib.animation.AbstractMovieWriter.grab_frame").
[`setup`](#matplotlib.animation.AbstractMovieWriter.setup "matplotlib.animation.AbstractMovieWriter.setup") is called to start the process and [`finish`](#matplotlib.animation.AbstractMovieWriter.finish "matplotlib.animation.AbstractMovieWriter.finish") is called afterwards. [`saving`](#matplotlib.animation.AbstractMovieWriter.saving "matplotlib.animation.AbstractMovieWriter.saving") is provided as a context manager to facilitate this process as
```
with moviewriter.saving(fig, outfile='myfile.mp4', dpi=100):
# Iterate over frames
moviewriter.grab_frame(**savefig_kwargs)
```
The use of the context manager ensures that [`setup`](#matplotlib.animation.AbstractMovieWriter.setup "matplotlib.animation.AbstractMovieWriter.setup") and [`finish`](#matplotlib.animation.AbstractMovieWriter.finish "matplotlib.animation.AbstractMovieWriter.finish") are performed as necessary.
An instance of a concrete subclass of this class can be given as the `writer` argument of [`Animation.save()`](matplotlib.animation.animation#matplotlib.animation.Animation.save "matplotlib.animation.Animation.save").
\_\_init\_\_(*fps=5*, *metadata=None*, *codec=None*, *bitrate=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L173-L179)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.AbstractMovieWriter.__init__ "matplotlib.animation.AbstractMovieWriter.__init__")([fps, metadata, codec, bitrate]) | |
| [`finish`](#matplotlib.animation.AbstractMovieWriter.finish "matplotlib.animation.AbstractMovieWriter.finish")() | Finish any processing for writing the movie. |
| [`grab_frame`](#matplotlib.animation.AbstractMovieWriter.grab_frame "matplotlib.animation.AbstractMovieWriter.grab_frame")(\*\*savefig\_kwargs) | Grab the image information from the figure and save as a movie frame. |
| [`saving`](#matplotlib.animation.AbstractMovieWriter.saving "matplotlib.animation.AbstractMovieWriter.saving")(fig, outfile, dpi, \*args, \*\*kwargs) | Context manager to facilitate writing the movie file. |
| [`setup`](#matplotlib.animation.AbstractMovieWriter.setup "matplotlib.animation.AbstractMovieWriter.setup")(fig, outfile[, dpi]) | Setup for writing the movie file. |
#### Attributes
| | |
| --- | --- |
| [`frame_size`](#matplotlib.animation.AbstractMovieWriter.frame_size "matplotlib.animation.AbstractMovieWriter.frame_size") | A tuple `(width, height)` in pixels of a movie frame. |
*abstract*finish()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L217-L219)
Finish any processing for writing the movie.
*property*frame\_size
A tuple `(width, height)` in pixels of a movie frame.
*abstract*grab\_frame(*\*\*savefig\_kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L208-L215)
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *savefig\_kwargs* are passed on to the [`savefig`](../figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") call that saves the figure.
saving(*fig*, *outfile*, *dpi*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L221-L233)
Context manager to facilitate writing the movie file.
`*args, **kw` are any parameters that should be passed to [`setup`](#matplotlib.animation.AbstractMovieWriter.setup "matplotlib.animation.AbstractMovieWriter.setup").
*abstract*setup(*fig*, *outfile*, *dpi=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L181-L200)
Setup for writing the movie file.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object that contains the information for frames.
**outfile**str
The filename of the resulting movie file.
**dpi**float, default: `fig.dpi`
The DPI (or resolution) for the file. This controls the size in pixels of the resulting movie file.
| programming_docs |
matplotlib matplotlib.axes.Axes.format_ydata matplotlib.axes.Axes.format\_ydata
==================================
Axes.format\_ydata(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3950-L3958)
Return *y* formatted as an y-value.
This function will use the `fmt_ydata` attribute if it is not None, else will fall back on the yaxis major formatter.
matplotlib matplotlib.axis.Axis.set_remove_overlapping_locs matplotlib.axis.Axis.set\_remove\_overlapping\_locs
===================================================
Axis.set\_remove\_overlapping\_locs(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L736-L737)
matplotlib matplotlib.artist.Artist.mouseover matplotlib.artist.Artist.mouseover
==================================
*property*Artist.mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
matplotlib matplotlib.axis.Axis.contains matplotlib.axis.Axis.contains
=============================
Axis.contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L457-L478)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](../backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
matplotlib matplotlib.axes.Axes.format_xdata matplotlib.axes.Axes.format\_xdata
==================================
Axes.format\_xdata(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3940-L3948)
Return *x* formatted as an x-value.
This function will use the `fmt_xdata` attribute if it is not None, else will fall back on the xaxis major formatter.
matplotlib matplotlib.axes.Axes.tick_params matplotlib.axes.Axes.tick\_params
=================================
Axes.tick\_params(*axis='both'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L3357-L3434)
Change the appearance of ticks, tick labels, and gridlines.
Tick properties that are not explicitly set using the keyword arguments remain unchanged unless *reset* is True.
Parameters:
**axis**{'x', 'y', 'both'}, default: 'both'
The axis to which the parameters are applied.
**which**{'major', 'minor', 'both'}, default: 'major'
The group of ticks to which the parameters are applied.
**reset**bool, default: False
Whether to reset the ticks to defaults before updating them.
Other Parameters:
**direction**{'in', 'out', 'inout'}
Puts ticks inside the Axes, outside the Axes, or both.
**length**float
Tick length in points.
**width**float
Tick width in points.
**color**color
Tick color.
**pad**float
Distance in points between tick and label.
**labelsize**float or str
Tick label font size in points or as a string (e.g., 'large').
**labelcolor**color
Tick label color.
**colors**color
Tick color and label color.
**zorder**float
Tick and label zorder.
**bottom, top, left, right**bool
Whether to draw the respective ticks.
**labelbottom, labeltop, labelleft, labelright**bool
Whether to draw the respective tick labels.
**labelrotation**float
Tick label rotation
**grid\_color**color
Gridline color.
**grid\_alpha**float
Transparency of gridlines: 0 (transparent) to 1 (opaque).
**grid\_linewidth**float
Width of gridlines in points.
**grid\_linestyle**str
Any valid [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") line style spec.
#### Examples
```
ax.tick_params(direction='out', length=6, width=2, colors='r',
grid_color='r', grid_alpha=0.5)
```
This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent.
Examples using `matplotlib.axes.Axes.tick_params`
-------------------------------------------------
[Scatter plot with histograms](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#sphx-glr-gallery-lines-bars-and-markers-scatter-hist-py)
Scatter plot with histograms
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Image Masked](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_masked.html#sphx-glr-gallery-images-contours-and-fields-image-masked-py)
Image Masked
[Aligning Labels](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/align_labels_demo.html#sphx-glr-gallery-subplots-axes-and-figures-align-labels-demo-py)
Aligning Labels
[Axes Props](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/axes_props.html#sphx-glr-gallery-subplots-axes-and-figures-axes-props-py)
Axes Props
[Broken Axis](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/broken_axis.html#sphx-glr-gallery-subplots-axes-and-figures-broken-axis-py)
Broken Axis
[Plots with different scales](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html#sphx-glr-gallery-subplots-axes-and-figures-two-scales-py)
Plots with different scales
[Polar Legend](https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_legend.html#sphx-glr-gallery-pie-and-polar-charts-polar-legend-py)
Polar Legend
[Fig Axes Customize Simple](https://matplotlib.org/stable/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py)
Fig Axes Customize Simple
[Color Demo](https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-gallery-color-color-demo-py)
Color Demo
[Inset Locator Demo](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-gallery-axes-grid1-inset-locator-demo-py)
Inset Locator Demo
[Inset Locator Demo2](https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-gallery-axes-grid1-inset-locator-demo2-py)
Inset Locator Demo2
[Make room for ylabel using axes\_grid](https://matplotlib.org/stable/gallery/axes_grid1/make_room_for_ylabel_using_axesgrid.html#sphx-glr-gallery-axes-grid1-make-room-for-ylabel-using-axesgrid-py)
Make room for ylabel using axes\_grid
[Simple Axes Divider 3](https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-gallery-axes-grid1-simple-axes-divider3-py)
Simple Axes Divider 3
[Anatomy of a figure](https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py)
Anatomy of a figure
[Stock prices over 32 years](https://matplotlib.org/stable/gallery/showcase/stock_prices.html#sphx-glr-gallery-showcase-stock-prices-py)
Stock prices over 32 years
[Anscombe's quartet](https://matplotlib.org/stable/gallery/specialty_plots/anscombe.html#sphx-glr-gallery-specialty-plots-anscombe-py)
Anscombe's quartet
[Multiple Yaxis With Spines](https://matplotlib.org/stable/gallery/spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-spines-multiple-yaxis-with-spines-py)
Multiple Yaxis With Spines
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Major and minor ticks](https://matplotlib.org/stable/gallery/ticks/major_minor_demo.html#sphx-glr-gallery-ticks-major-minor-demo-py)
Major and minor ticks
[Move x-axis tick labels to the top](https://matplotlib.org/stable/gallery/ticks/tick_xlabel_top.html#sphx-glr-gallery-ticks-tick-xlabel-top-py)
Move x-axis tick labels to the top
[Text in Matplotlib Plots](https://matplotlib.org/stable/tutorials/text/text_intro.html#sphx-glr-tutorials-text-text-intro-py)
Text in Matplotlib Plots
matplotlib matplotlib.axis.Axis.set_tick_params matplotlib.axis.Axis.set\_tick\_params
======================================
Axis.set\_tick\_params(*which='major'*, *reset=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L917-L954)
Set appearance parameters for ticks, ticklabels, and gridlines.
For documentation of keyword arguments, see [`matplotlib.axes.Axes.tick_params()`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
Examples using `matplotlib.axis.Axis.set_tick_params`
-----------------------------------------------------
[Violin plot customization](https://matplotlib.org/stable/gallery/statistics/customized_violin.html#sphx-glr-gallery-statistics-customized-violin-py)
Violin plot customization
[Dollar Ticks](https://matplotlib.org/stable/gallery/pyplots/dollar_ticks.html#sphx-glr-gallery-pyplots-dollar-ticks-py)
Dollar Ticks
[Scatter Histogram (Locatable Axes)](https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-gallery-axes-grid1-scatter-hist-locatable-axes-py)
Scatter Histogram (Locatable Axes)
[Pythonic Matplotlib](https://matplotlib.org/stable/gallery/misc/pythonic_matplotlib.html#sphx-glr-gallery-misc-pythonic-matplotlib-py)
Pythonic Matplotlib
[Placing date ticks using recurrence rules](https://matplotlib.org/stable/gallery/ticks/date_demo_rrule.html#sphx-glr-gallery-ticks-date-demo-rrule-py)
Placing date ticks using recurrence rules
[Date Precision and Epochs](https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html#sphx-glr-gallery-ticks-date-precision-and-epochs-py)
Date Precision and Epochs
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py)
Choosing Colormaps in Matplotlib
matplotlib matplotlib.axis.Axis.reset_ticks matplotlib.axis.Axis.reset\_ticks
=================================
Axis.reset\_ticks()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L897-L915)
Re-initialize the major and minor Tick lists.
Each list starts with a single fresh Tick.
matplotlib mpl_toolkits.axisartist.grid_finder.FormatterPrettyPrint mpl\_toolkits.axisartist.grid\_finder.FormatterPrettyPrint
==========================================================
*class*mpl\_toolkits.axisartist.grid\_finder.FormatterPrettyPrint(*useMathText=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L308-L315)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
\_\_call\_\_(*direction*, *factor*, *values*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L314-L315)
Call self as a function.
matplotlib matplotlib.pyplot.hexbin matplotlib.pyplot.hexbin
========================
matplotlib.pyplot.hexbin(*x*, *y*, *C=None*, *gridsize=100*, *bins=None*, *xscale='linear'*, *yscale='linear'*, *extent=None*, *cmap=None*, *norm=None*, *vmin=None*, *vmax=None*, *alpha=None*, *linewidths=None*, *edgecolors='face'*, *reduce\_C\_function=<function mean>*, *mincnt=None*, *marginals=False*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2536-L2551)
Make a 2D hexagonal binning plot of points *x*, *y*.
If *C* is *None*, the value of the hexagon is determined by the number of points in the hexagon. Otherwise, *C* specifies values at the coordinate (x[i], y[i]). For each hexagon, these values are reduced using *reduce\_C\_function*.
Parameters:
**x, y**array-like
The data positions. *x* and *y* must be of the same length.
**C**array-like, optional
If given, these values are accumulated in the bins. Otherwise, every point has a value of 1. Must be of the same length as *x* and *y*.
**gridsize**int or (int, int), default: 100
If a single int, the number of hexagons in the *x*-direction. The number of hexagons in the *y*-direction is chosen such that the hexagons are approximately regular.
Alternatively, if a tuple (*nx*, *ny*), the number of hexagons in the *x*-direction and the *y*-direction.
**bins**'log' or int or sequence, default: None
Discretization of the hexagon values.
* If *None*, no binning is applied; the color of each hexagon directly corresponds to its count value.
* If 'log', use a logarithmic scale for the colormap. Internally, \(log\_{10}(i+1)\) is used to determine the hexagon color. This is equivalent to `norm=LogNorm()`.
* If an integer, divide the counts in the specified number of bins, and color the hexagons accordingly.
* If a sequence of values, the values of the lower bound of the bins to be used.
**xscale**{'linear', 'log'}, default: 'linear'
Use a linear or log10 scale on the horizontal axis.
**yscale**{'linear', 'log'}, default: 'linear'
Use a linear or log10 scale on the vertical axis.
**mincnt**int > 0, default: *None*
If not *None*, only display cells with more than *mincnt* number of points in the cell.
**marginals**bool, default: *False*
If marginals is *True*, plot the marginal density as colormapped rectangles along the bottom of the x-axis and left of the y-axis.
**extent**4-tuple of float, default: *None*
The limits of the bins (xmin, xmax, ymin, ymax). The default assigns the limits based on *gridsize*, *x*, *y*, *xscale* and *yscale*.
If *xscale* or *yscale* is set to 'log', the limits are expected to be the exponent for a power of 10. E.g. for x-limits of 1 and 50 in 'linear' scale and y-limits of 10 and 1000 in 'log' scale, enter (1, 50, 1, 3).
Returns:
[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") defining the hexagonal bins.
* [`PolyCollection.get_offsets`](../collections_api#matplotlib.collections.PolyCollection.get_offsets "matplotlib.collections.PolyCollection.get_offsets") contains a Mx2 array containing the x, y positions of the M hexagon centers.
* [`PolyCollection.get_array`](../collections_api#matplotlib.collections.PolyCollection.get_array "matplotlib.collections.PolyCollection.get_array") contains the values of the M hexagons.
If *marginals* is *True*, horizontal bar and vertical bar (both PolyCollections) will be attached to the return collection as attributes *hbar* and *vbar*.
Other Parameters:
**cmap**str or [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](../scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
**alpha**float between 0 and 1, optional
The alpha blending value, between 0 (transparent) and 1 (opaque).
**linewidths**float, default: *None*
If *None*, defaults to 1.0.
**edgecolors**{'face', 'none', *None*} or color, default: 'face'
The color of the hexagon edges. Possible values are:
* 'face': Draw the edges in the same color as the fill color.
* 'none': No edges are drawn. This can sometimes lead to unsightly unpainted pixels between the hexagons.
* *None*: Draw outlines in the default color.
* An explicit color.
**reduce\_C\_function**callable, default: [`numpy.mean`](https://numpy.org/doc/stable/reference/generated/numpy.mean.html#numpy.mean "(in NumPy v1.23)")
The function to aggregate *C* within the bins. It is ignored if *C* is not given. This must have the signature:
```
def reduce_C_function(C: array) -> float
```
Commonly used functions are:
* [`numpy.mean`](https://numpy.org/doc/stable/reference/generated/numpy.mean.html#numpy.mean "(in NumPy v1.23)"): average of the points
* [`numpy.sum`](https://numpy.org/doc/stable/reference/generated/numpy.sum.html#numpy.sum "(in NumPy v1.23)"): integral of the point values
* [`numpy.amax`](https://numpy.org/doc/stable/reference/generated/numpy.amax.html#numpy.amax "(in NumPy v1.23)"): value taken from the largest point
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *C*
**\*\*kwargs**[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") properties
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"):
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`hist2d`](matplotlib.pyplot.hist2d#matplotlib.pyplot.hist2d "matplotlib.pyplot.hist2d")
2D histogram rectangular bins
| programming_docs |
matplotlib mpl_toolkits.axisartist.grid_finder.FixedLocator mpl\_toolkits.axisartist.grid\_finder.FixedLocator
==================================================
*class*mpl\_toolkits.axisartist.grid\_finder.FixedLocator(*locs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L296-L303)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
\_\_call\_\_(*v1*, *v2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_finder.py#L300-L303)
Call self as a function.
Examples using `mpl_toolkits.axisartist.grid_finder.FixedLocator`
-----------------------------------------------------------------
[mpl\_toolkits.axisartist.floating\_axes features](https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-gallery-axisartist-demo-floating-axes-py)
:mod:`mpl\_toolkits.axisartist.floating\_axes` features
matplotlib matplotlib.axes.Axes.add_collection matplotlib.axes.Axes.add\_collection
====================================
Axes.add\_collection(*collection*, *autolim=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L2279-L2311)
Add a [`Collection`](../collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection") to the Axes; return the collection.
Examples using `matplotlib.axes.Axes.add_collection`
----------------------------------------------------
[EventCollection Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.html#sphx-glr-gallery-lines-bars-and-markers-eventcollection-demo-py)
EventCollection Demo
[Using span\_where](https://matplotlib.org/stable/gallery/lines_bars_and_markers/span_regions.html#sphx-glr-gallery-lines-bars-and-markers-span-regions-py)
Using span\_where
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
[Line, Poly and RegularPoly Collection with autoscaling](https://matplotlib.org/stable/gallery/shapes_and_collections/collections.html#sphx-glr-gallery-shapes-and-collections-collections-py)
Line, Poly and RegularPoly Collection with autoscaling
[Ellipse Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_collection.html#sphx-glr-gallery-shapes-and-collections-ellipse-collection-py)
Ellipse Collection
[Line Collection](https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html#sphx-glr-gallery-shapes-and-collections-line-collection-py)
Line Collection
[Circles, Wedges and Polygons](https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py)
Circles, Wedges and Polygons
[Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html#sphx-glr-gallery-event-handling-lasso-demo-py)
Lasso Demo
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[Artist tests](https://matplotlib.org/stable/gallery/units/artist_tests.html#sphx-glr-gallery-units-artist-tests-py)
Artist tests
[Autoscaling](https://matplotlib.org/stable/tutorials/intermediate/autoscale.html#sphx-glr-tutorials-intermediate-autoscale-py)
Autoscaling
matplotlib matplotlib.patches.BoxStyle matplotlib.patches.BoxStyle
===========================
*class*matplotlib.patches.BoxStyle(*stylename*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2272-L2647)
Bases: `_Style`
[`BoxStyle`](#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") is a container class which defines several boxstyle classes, which are used for [`FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch").
A style object can be created as:
```
BoxStyle.Round(pad=0.2)
```
or:
```
BoxStyle("Round", pad=0.2)
```
or:
```
BoxStyle("Round, pad=0.2")
```
The following boxstyle classes are defined.
| Class | Name | Attrs |
| --- | --- | --- |
| Square | `square` | pad=0.3 |
| Circle | `circle` | pad=0.3 |
| LArrow | `larrow` | pad=0.3 |
| RArrow | `rarrow` | pad=0.3 |
| DArrow | `darrow` | pad=0.3 |
| Round | `round` | pad=0.3, rounding\_size=None |
| Round4 | `round4` | pad=0.3, rounding\_size=None |
| Sawtooth | `sawtooth` | pad=0.3, tooth\_size=None |
| Roundtooth | `roundtooth` | pad=0.3, tooth\_size=None |
An instance of a boxstyle class is a callable object, with the signature
```
__call__(self, x0, y0, width, height, mutation_size) -> Path
```
*x0*, *y0*, *width* and *height* specify the location and size of the box to be drawn; *mutation\_size* scales the outline properties such as padding.
Return the instance of the subclass with the given style name.
*class*Circle(*pad=0.3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2327-L2346)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A circular box.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2340-L2346)
Call self as a function.
*class*DArrow(*pad=0.3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2390-L2425)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A box in the shape of a two-way arrow.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2404-L2425)
Call self as a function.
*class*LArrow(*pad=0.3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2348-L2378)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A box in the shape of a left-pointing arrow.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2361-L2378)
Call self as a function.
*class*RArrow(*pad=0.3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2380-L2388)
Bases: [`LArrow`](#matplotlib.patches.BoxStyle.LArrow "matplotlib.patches.BoxStyle.LArrow")
A box in the shape of a right-pointing arrow.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2384-L2388)
Call self as a function.
*class*Round(*pad=0.3*, *rounding\_size=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2427-L2485)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A box with round corners.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
**rounding\_size**float, default: *pad*
Radius of the corners.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2443-L2485)
Call self as a function.
*class*Round4(*pad=0.3*, *rounding\_size=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2487-L2536)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A box with rounded edges.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
**rounding\_size**float, default: *pad*/2
Rounding of edges.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2503-L2536)
Call self as a function.
*class*Roundtooth(*pad=0.3*, *tooth\_size=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2634-L2647)
Bases: [`Sawtooth`](#matplotlib.patches.BoxStyle.Sawtooth "matplotlib.patches.BoxStyle.Sawtooth")
A box with a rounded sawtooth outline.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
**tooth\_size**float, default: *pad*/2
Size of the sawtooth.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2638-L2647)
Call self as a function.
*class*Sawtooth(*pad=0.3*, *tooth\_size=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2538-L2632)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A box with a sawtooth outline.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
**tooth\_size**float, default: *pad*/2
Size of the sawtooth.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2628-L2632)
Call self as a function.
*class*Square(*pad=0.3*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2304-L2325)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A square box.
Parameters:
**pad**float, default: 0.3
The amount of padding around the original box.
\_\_call\_\_(*x0*, *y0*, *width*, *height*, *mutation\_size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/patches.py#L2317-L2325)
Call self as a function.
Examples using `matplotlib.patches.BoxStyle`
--------------------------------------------
[Reference for Matplotlib artists](https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py)
Reference for Matplotlib artists
matplotlib matplotlib.axes.Axes.get_xticklabels matplotlib.axes.Axes.get\_xticklabels
=====================================
Axes.get\_xticklabels(*minor=False*, *which=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Get the xaxis' tick labels.
Parameters:
**minor**bool
Whether to return the minor or the major ticklabels.
**which**None, ('minor', 'major', 'both')
Overrides *minor*.
Selects which ticklabels to return
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
Examples using `matplotlib.axes.Axes.get_xticklabels`
-----------------------------------------------------
[Creating a timeline with lines, dates, and text](https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py)
Creating a timeline with lines, dates, and text
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Date tick labels](https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html#sphx-glr-gallery-text-labels-and-annotations-date-py)
Date tick labels
[Pick Event Demo](https://matplotlib.org/stable/gallery/event_handling/pick_event_demo.html#sphx-glr-gallery-event-handling-pick-event-demo-py)
Pick Event Demo
[Centering labels between ticks](https://matplotlib.org/stable/gallery/ticks/centered_ticklabels.html#sphx-glr-gallery-ticks-centered-ticklabels-py)
Centering labels between ticks
[Formatting date ticks using ConciseDateFormatter](https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html#sphx-glr-gallery-ticks-date-concise-formatter-py)
Formatting date ticks using ConciseDateFormatter
[Evans test](https://matplotlib.org/stable/gallery/units/evans_test.html#sphx-glr-gallery-units-evans-test-py)
Evans test
[The Lifecycle of a Plot](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py)
The Lifecycle of a Plot
matplotlib matplotlib.artist.Artist.get_url matplotlib.artist.Artist.get\_url
=================================
Artist.get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
matplotlib matplotlib.axis.Axis.update_units matplotlib.axis.Axis.update\_units
==================================
Axis.update\_units(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1596-L1615)
Introspect *data* for units converter and update the axis.converter instance if necessary. Return *True* if *data* is registered for unit conversion.
matplotlib matplotlib.pyplot.figlegend matplotlib.pyplot.figlegend
===========================
matplotlib.pyplot.figlegend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L950-L951)
Place a legend on the figure.
Call signatures:
```
figlegend()
figlegend(handles, labels)
figlegend(handles=handles)
figlegend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
fig.figlegend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
fig.figlegend()
```
Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling [`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
fig.figlegend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax1.plot([1, 2, 3], label='label1')
line2, = ax2.plot([1, 2, 3], label='label2')
fig.figlegend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on all Axes, call this function with an iterable of strings, one for each legend item. For example:
```
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1, 3, 5], color='blue')
ax2.plot([2, 4, 6], color='red')
fig.figlegend(['the blues', 'the reds'])
```
Parameters:
**handles**list of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](../legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](../figure_api#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](../transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](../font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](../legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Axes.legend`](matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
| programming_docs |
matplotlib matplotlib.axes.Axes.step matplotlib.axes.Axes.step
=========================
Axes.step(*x*, *y*, *\*args*, *where='pre'*, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L2084-L2150)
Make a step plot.
Call signatures:
```
step(x, y, [fmt], *, data=None, where='pre', **kwargs)
step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)
```
This is just a thin wrapper around [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") which changes some formatting options. Most of the concepts and parameters of plot can be used here as well.
Note
This method uses a standard plot with a step drawstyle: The *x* values are the reference positions and steps extend left/right/both directions depending on *where*.
For the common case where you know the values and edges of the steps, use [`stairs`](matplotlib.axes.axes.stairs#matplotlib.axes.Axes.stairs "matplotlib.axes.Axes.stairs") instead.
Parameters:
**x**array-like
1D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing.
**y**array-like
1D sequence of y levels.
**fmt**str, optional
A format string, e.g. 'g' for a green line. See [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") for a more detailed description.
Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument *linestyle* instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots.
**where**{'pre', 'post', 'mid'}, default: 'pre'
Define where the steps should be placed:
* 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval `(x[i-1], x[i]]` has the value `y[i]`.
* 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval `[x[i], x[i+1])` has the value `y[i]`.
* 'mid': Steps occur half-way between the *x* positions.
**data**indexable object, optional
An object with labelled data. If given, provide the label names to plot in *x* and *y*.
**\*\*kwargs**
Additional parameters are the same as those for [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot").
Returns:
list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Objects representing the plotted data.
Examples using `matplotlib.axes.Axes.step`
------------------------------------------
[step(x, y)](https://matplotlib.org/stable/plot_types/basic/step.html#sphx-glr-plot-types-basic-step-py)
step(x, y)
matplotlib mpl_toolkits.mplot3d.art3d.Line3DCollection mpl\_toolkits.mplot3d.art3d.Line3DCollection
============================================
*class*mpl\_toolkits.mplot3d.art3d.Line3DCollection(*segments*, *\**, *zorder=2*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L283-L313)
Bases: [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
A collection of 3D lines.
Parameters:
**segments**list of array-like
A sequence of (*line0*, *line1*, *line2*), where:
```
linen = (x0, y0), (x1, y1), ... (xm, ym)
```
or the equivalent numpy array with two columns. Each line can have a different number of segments.
**linewidths**float or list of float, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The width of each line in points.
**colors**color or list of color, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not allowed).
**antialiaseds**bool or list of bool, default: `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`)
Whether to use antialiasing for each line.
**zorder**int, default: 2
zorder of the lines once drawn.
**facecolors**color or list of color, default: 'none'
When setting *facecolors*, each line is interpreted as a boundary for an area, implicitly closing the path from the last point to the first point. The enclosed area is filled with *facecolor*. In order to manually specify what should count as the "interior" of each line, please use [`PathCollection`](../collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") instead, where the "interior" can be specified by appropriate usage of [`CLOSEPOLY`](../path_api#matplotlib.path.Path.CLOSEPOLY "matplotlib.path.Path.CLOSEPOLY").
**\*\*kwargs**
Forwarded to [`Collection`](../collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection").
do\_3d\_projection()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L300-L313)
Project the points according to renderer matrix.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *colors=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *segments=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *sort\_zpos=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`colors`](../collections_api#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`segments`](#mpl_toolkits.mplot3d.art3d.Line3DCollection.set_segments "mpl_toolkits.mplot3d.art3d.Line3DCollection.set_segments") | unknown |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`sort_zpos`](#mpl_toolkits.mplot3d.art3d.Line3DCollection.set_sort_zpos "mpl_toolkits.mplot3d.art3d.Line3DCollection.set_sort_zpos") | unknown |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_segments(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L293-L298)
Set 3D segments.
set\_sort\_zpos(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/art3d.py#L288-L291)
Set the position to use for z-sorting.
Examples using `mpl_toolkits.mplot3d.art3d.Line3DCollection`
------------------------------------------------------------
[3D stem](https://matplotlib.org/stable/gallery/mplot3d/stem3d_demo.html#sphx-glr-gallery-mplot3d-stem3d-demo-py)
3D stem
matplotlib matplotlib.pyplot.rcdefaults matplotlib.pyplot.rcdefaults
============================
matplotlib.pyplot.rcdefaults()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L560-L564)
Restore the [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") from Matplotlib's internal default style.
Style-blacklisted [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") (defined in `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
See also
[`matplotlib.rc_file_defaults`](../matplotlib_configuration_api#matplotlib.rc_file_defaults "matplotlib.rc_file_defaults")
Restore the [`rcParams`](../matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") from the rc file originally loaded by Matplotlib.
[`matplotlib.style.use`](../style_api#matplotlib.style.use "matplotlib.style.use")
Use a specific style file. Call `style.use('default')` to restore the default style.
Examples using `matplotlib.pyplot.rcdefaults`
---------------------------------------------
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Customize Rc](https://matplotlib.org/stable/gallery/misc/customize_rc.html#sphx-glr-gallery-misc-customize-rc-py)
Customize Rc
matplotlib matplotlib.axis.Axis.get_ticklines matplotlib.axis.Axis.get\_ticklines
===================================
Axis.get\_ticklines(*minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L1408-L1412)
Return this Axis' tick lines as a list of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s.
Examples using `matplotlib.axis.Axis.get_ticklines`
---------------------------------------------------
[Artist tutorial](https://matplotlib.org/stable/tutorials/intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py)
Artist tutorial
matplotlib matplotlib.pyplot.fill_between matplotlib.pyplot.fill\_between
===============================
matplotlib.pyplot.fill\_between(*x*, *y1*, *y2=0*, *where=None*, *interpolate=False*, *step=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L2510-L2516)
Fill the area between two horizontal curves.
The curves are defined by the points (*x*, *y1*) and (*x*, *y2*). This creates one or multiple polygons describing the filled area.
You may exclude some horizontal sections from filling using *where*.
By default, the edges connect the given points directly. Use *step* if the filling should be a step function, i.e. constant in between *x*.
Parameters:
**x**array (length N)
The x coordinates of the nodes defining the curves.
**y1**array (length N) or scalar
The y coordinates of the nodes defining the first curve.
**y2**array (length N) or scalar, default: 0
The y coordinates of the nodes defining the second curve.
**where**array of bool (length N), optional
Define *where* to exclude some horizontal regions from being filled. The filled regions are defined by the coordinates `x[where]`. More precisely, fill between `x[i]` and `x[i+1]` if `where[i] and where[i+1]`. Note that this definition implies that an isolated *True* value between two *False* values in *where* will not result in filling. Both sides of the *True* position remain unfilled due to the adjacent *False* values.
**interpolate**bool, default: False
This option is only relevant if *where* is used and the two curves are crossing each other.
Semantically, *where* is often used for *y1* > *y2* or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the *x* array. Such a polygon cannot describe the above semantics close to the intersection. The x-sections containing the intersection are simply clipped.
Setting *interpolate* to *True* will calculate the actual intersection point and extend the filled region up to this point.
**step**{'pre', 'post', 'mid'}, optional
Define *step* if the filling should be a step function, i.e. constant in between *x*. The value determines where the step will occur:
* 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval `(x[i-1], x[i]]` has the value `y[i]`.
* 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval `[x[i], x[i+1])` has the value `y[i]`.
* 'mid': Steps occur half-way between the *x* positions.
Returns:
[`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection") containing the plotted polygons.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y1*, *y2*, *where*
**\*\*kwargs**
All other keyword arguments are passed on to [`PolyCollection`](../collections_api#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection"). They control the [`Polygon`](matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](../collections_api#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](../collections_api#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](../cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](../collections_api#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](../cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](../cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](../collections_api#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](../collections_api#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](../collections_api#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](../collections_api#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](../collections_api#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](../collections_api#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](../collections_api#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](../cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](../collections_api#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](../collections_api#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](../collections_api#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](../transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](../collections_api#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](../collections_api#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](../collections_api#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`fill_between`](#matplotlib.pyplot.fill_between "matplotlib.pyplot.fill_between")
Fill between two sets of y-values.
[`fill_betweenx`](matplotlib.pyplot.fill_betweenx#matplotlib.pyplot.fill_betweenx "matplotlib.pyplot.fill_betweenx")
Fill between two sets of x-values.
| programming_docs |
matplotlib matplotlib.axes.Axes.set_xticklabels matplotlib.axes.Axes.set\_xticklabels
=====================================
Axes.set\_xticklabels(*labels*, *\**, *fontdict=None*, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the xaxis' labels with list of string labels.
Warning
This method should only be used after fixing the tick positions using [`Axes.set_xticks`](matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks"). Otherwise, the labels may end up in unexpected positions.
Parameters:
**labels**list of str
The label texts.
**fontdict**dict, optional
A dictionary controlling the appearance of the ticklabels. The default *fontdict* is:
```
{'fontsize': rcParams['axes.titlesize'],
'fontweight': rcParams['axes.titleweight'],
'verticalalignment': 'baseline',
'horizontalalignment': loc}
```
**minor**bool, default: False
Whether to set the minor ticklabels rather than the major ones.
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
The labels.
Other Parameters:
**\*\*kwargs**[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
Examples using `matplotlib.axes.Axes.set_xticklabels`
-----------------------------------------------------
[Managing multiple figures in pyplot](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/multiple_figs_demo.html#sphx-glr-gallery-subplots-axes-and-figures-multiple-figs-demo-py)
Managing multiple figures in pyplot
[Zoom region inset axes](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/zoom_inset_axes.html#sphx-glr-gallery-subplots-axes-and-figures-zoom-inset-axes-py)
Zoom region inset axes
[Boxplots](https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py)
Boxplots
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[XKCD](https://matplotlib.org/stable/gallery/showcase/xkcd.html#sphx-glr-gallery-showcase-xkcd-py)
XKCD
[Colorbar Tick Labelling](https://matplotlib.org/stable/gallery/ticks/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-colorbar-tick-labelling-demo-py)
Colorbar Tick Labelling
[Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py)
Constrained Layout Guide
matplotlib matplotlib.pyplot.subplot_mosaic matplotlib.pyplot.subplot\_mosaic
=================================
matplotlib.pyplot.subplot\_mosaic(*mosaic*, *\**, *sharex=False*, *sharey=False*, *width\_ratios=None*, *height\_ratios=None*, *empty\_sentinel='.'*, *subplot\_kw=None*, *gridspec\_kw=None*, *\*\*fig\_kw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/pyplot.py#L1438-L1539)
Build a layout of Axes based on ASCII art or nested lists.
This is a helper function to build complex GridSpec layouts visually.
Note
This API is provisional and may be revised in the future based on early user feedback.
See [Complex and semantic figure composition](https://matplotlib.org/stable/tutorials/provisional/mosaic.html) for an example and full API documentation
Parameters:
**mosaic**list of list of {hashable or nested} or str
A visual layout of how you want your Axes to be arranged labeled as strings. For example
```
x = [['A panel', 'A panel', 'edge'],
['C panel', '.', 'edge']]
```
produces 4 axes:
* 'A panel' which is 1 row high and spans the first two columns
* 'edge' which is 2 rows high and is on the right edge
* 'C panel' which in 1 row and 1 column wide in the bottom left
* a blank space 1 row and 1 column wide in the bottom center
Any of the entries in the layout can be a list of lists of the same form to create nested layouts.
If input is a str, then it must be of the form
```
'''
AAE
C.E
'''
```
where each character is a column and each line is a row. This only allows only single character Axes labels and does not allow nesting but is very terse.
**sharex, sharey**bool, default: False
If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared among all subplots. In that case, tick label visibility and axis units behave as for [`subplots`](matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots"). If False, each subplot's x- or y-axis will be independent.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Convenience for `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Convenience for `gridspec_kw={'height_ratios': [...]}`.
**empty\_sentinel**object, optional
Entry in the layout to mean "leave this space empty". Defaults to `'.'`. Note, if *layout* is a string, it is processed via [`inspect.cleandoc`](https://docs.python.org/3/library/inspect.html#inspect.cleandoc "(in Python v3.10)") to remove leading white space, which may interfere with using white-space as the empty sentinel.
**subplot\_kw**dict, optional
Dictionary with keywords passed to the [`Figure.add_subplot`](../figure_api#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dictionary with keywords passed to the [`GridSpec`](matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
**\*\*fig\_kw**
All additional keyword arguments are passed to the [`pyplot.figure`](matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure") call.
Returns:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The new figure
dict[label, Axes]
A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.
Examples using `matplotlib.pyplot.subplot_mosaic`
-------------------------------------------------
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Image Demo](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_demo.html#sphx-glr-gallery-images-contours-and-fields-image-demo-py)
Image Demo
[Labelling subplots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/label_subplots.html#sphx-glr-gallery-text-labels-and-annotations-label-subplots-py)
Labelling subplots
[Primary 3D view planes](https://matplotlib.org/stable/gallery/mplot3d/view_planes_3d.html#sphx-glr-gallery-mplot3d-view-planes-3d-py)
Primary 3D view planes
[Quick start guide](https://matplotlib.org/stable/tutorials/introductory/quick_start.html#sphx-glr-tutorials-introductory-quick-start-py)
Quick start guide
[Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py)
Legend guide
[Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html#sphx-glr-tutorials-intermediate-arranging-axes-py)
Arranging multiple Axes in a Figure
matplotlib mpl_toolkits.axisartist.angle_helper.select_step360 mpl\_toolkits.axisartist.angle\_helper.select\_step360
======================================================
mpl\_toolkits.axisartist.angle\_helper.select\_step360(*v1*, *v2*, *nv*, *include\_last=True*, *threshold\_factor=3600*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L136-L139)
matplotlib mpl_toolkits.axisartist.grid_helper_curvelinear.GridHelperCurveLinear mpl\_toolkits.axisartist.grid\_helper\_curvelinear.GridHelperCurveLinear
========================================================================
*class*mpl\_toolkits.axisartist.grid\_helper\_curvelinear.GridHelperCurveLinear(*aux\_trans*, *extreme\_finder=None*, *grid\_locator1=None*, *grid\_locator2=None*, *tick\_formatter1=None*, *tick\_formatter2=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L254-L364)
Bases: [`GridHelperBase`](mpl_toolkits.axisartist.axislines.gridhelperbase#mpl_toolkits.axisartist.axislines.GridHelperBase "mpl_toolkits.axisartist.axislines.GridHelperBase")
aux\_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate. An instance of MPL's Transform (inverse transform should be defined) or a tuple of two callable objects which defines the transform and its inverse. The callables need take two arguments of array of source coordinates and should return two target coordinates.
e.g., `x2, y2 = trans(x1, y1)`
get\_gridlines(*which='major'*, *axis='both'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L335-L343)
Return list of grid lines as a list of paths (list of points).
*which* : "major" or "minor" *axis* : "both", "x" or "y"
get\_tick\_iterator(*nth\_coord*, *axis\_side*, *minor=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L345-L364)
*property*grid\_info[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
new\_fixed\_axis(*loc*, *nth\_coord=None*, *axis\_direction=None*, *offset=None*, *axes=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L289-L302)
new\_floating\_axis(*nth\_coord*, *value*, *axes=None*, *axis\_direction='bottom'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L304-L330)
update\_grid\_finder(*aux\_trans=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py#L283-L287)
matplotlib mpl_toolkits.mplot3d.proj3d.persp_transformation mpl\_toolkits.mplot3d.proj3d.persp\_transformation
==================================================
mpl\_toolkits.mplot3d.proj3d.persp\_transformation(*zfront*, *zback*, *focal\_length*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/mplot3d/proj3d.py#L97-L106)
matplotlib matplotlib.artist.Artist.set_clip_box matplotlib.artist.Artist.set\_clip\_box
=======================================
Artist.set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
Examples using `matplotlib.artist.Artist.set_clip_box`
------------------------------------------------------
[Annotating Plots](https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#sphx-glr-gallery-text-labels-and-annotations-annotation-demo-py)
Annotating Plots
[Ellipse Demo](https://matplotlib.org/stable/gallery/shapes_and_collections/ellipse_demo.html#sphx-glr-gallery-shapes-and-collections-ellipse-demo-py)
Ellipse Demo
matplotlib mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxes mpl\_toolkits.axes\_grid1.parasite\_axes.ParasiteAxes
=====================================================
mpl\_toolkits.axes\_grid1.parasite\_axes.ParasiteAxes[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axes_grid1/parasite_axes.py)
alias of `AxesParasite`
matplotlib matplotlib.axes.Axes.set_yticks matplotlib.axes.Axes.set\_yticks
================================
Axes.set\_yticks(*ticks*, *labels=None*, *\**, *minor=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set the yaxis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
Parameters:
**ticks**list of floats
List of tick locations. The axis [`Locator`](../ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") is replaced by a [`FixedLocator`](../ticker_api#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator").
Some tick formatters will not label arbitrary tick positions; e.g. log formatters only label decade ticks by default. In such a case you can set a formatter explicitly on the axis using [`Axis.set_major_formatter`](matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") or provide formatted *labels* yourself.
**labels**list of str, optional
List of tick labels. If not set, the labels are generated with the axis tick [`Formatter`](../ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter").
**minor**bool, default: False
If `False`, set the major ticks; if `True`, the minor ticks.
**\*\*kwargs**
[`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels. These take effect only if you pass *labels*. In other cases, please use [`tick_params`](matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
#### Notes
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
Examples using `matplotlib.axes.Axes.set_yticks`
------------------------------------------------
[Bar Label Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html#sphx-glr-gallery-lines-bars-and-markers-bar-label-demo-py)
Bar Label Demo
[Horizontal bar chart](https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html#sphx-glr-gallery-lines-bars-and-markers-barh-py)
Horizontal bar chart
[Broken Barh](https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py)
Broken Barh
[Psd Demo](https://matplotlib.org/stable/gallery/lines_bars_and_markers/psd_demo.html#sphx-glr-gallery-lines-bars-and-markers-psd-demo-py)
Psd Demo
[Creating annotated heatmaps](https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py)
Creating annotated heatmaps
[Rendering math equations using TeX](https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html#sphx-glr-gallery-text-labels-and-annotations-tex-demo-py)
Rendering math equations using TeX
[Programmatically controlling subplot adjustment](https://matplotlib.org/stable/gallery/pyplots/auto_subplots_adjust.html#sphx-glr-gallery-pyplots-auto-subplots-adjust-py)
Programmatically controlling subplot adjustment
[Make room for ylabel using axes\_grid](https://matplotlib.org/stable/gallery/axes_grid1/make_room_for_ylabel_using_axesgrid.html#sphx-glr-gallery-axes-grid1-make-room-for-ylabel-using-axesgrid-py)
Make room for ylabel using axes\_grid
[Scatter Histogram (Locatable Axes)](https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-gallery-axes-grid1-scatter-hist-locatable-axes-py)
Scatter Histogram (Locatable Axes)
[Ticklabel alignment](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_alignment.html#sphx-glr-gallery-axisartist-demo-ticklabel-alignment-py)
Ticklabel alignment
[Ticklabel direction](https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_direction.html#sphx-glr-gallery-axisartist-demo-ticklabel-direction-py)
Ticklabel direction
[Integral as the area under a curve](https://matplotlib.org/stable/gallery/showcase/integral.html#sphx-glr-gallery-showcase-integral-py)
Integral as the area under a curve
[Shaded & power normalized rendering](https://matplotlib.org/stable/gallery/showcase/mandelbrot.html#sphx-glr-gallery-showcase-mandelbrot-py)
Shaded & power normalized rendering
[XKCD](https://matplotlib.org/stable/gallery/showcase/xkcd.html#sphx-glr-gallery-showcase-xkcd-py)
XKCD
 [Rain simulation](https://matplotlib.org/stable/gallery/animation/rain.html#sphx-glr-gallery-animation-rain-py)
Rain simulation
 [MATPLOTLIB UNCHAINED](https://matplotlib.org/stable/gallery/animation/unchained.html#sphx-glr-gallery-animation-unchained-py)
MATPLOTLIB \*\*UNCHAINED\*\*
[Create 2D bar graphs in different planes](https://matplotlib.org/stable/gallery/mplot3d/bars3d.html#sphx-glr-gallery-mplot3d-bars3d-py)
Create 2D bar graphs in different planes
[MRI with EEG](https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py)
MRI with EEG
[SkewT-logP diagram: using transforms and custom projections](https://matplotlib.org/stable/gallery/specialty_plots/skewt.html#sphx-glr-gallery-specialty-plots-skewt-py)
SkewT-logP diagram: using transforms and custom projections
[Custom spine bounds](https://matplotlib.org/stable/gallery/spines/spines_bounds.html#sphx-glr-gallery-spines-spines-bounds-py)
Custom spine bounds
matplotlib matplotlib.animation.ArtistAnimation matplotlib.animation.ArtistAnimation
====================================
*class*matplotlib.animation.ArtistAnimation(*fig*, *artists*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1427-L1500)
Animation using a fixed set of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") objects.
Before creating an instance, all plotting should have taken place and the relevant artists saved.
Note
You must store the created Animation in a variable that lives as long as the animation should run. Otherwise, the Animation object will be garbage-collected and the animation stops.
Parameters:
**fig**[`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure object used to get needed events, such as draw or resize.
**artists**list
Each list entry is a collection of [`Artist`](../artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") objects that are made visible on the corresponding frame. Other artists are made invisible.
**interval**int, default: 200
Delay between frames in milliseconds.
**repeat\_delay**int, default: 0
The delay in milliseconds between consecutive animation runs, if *repeat* is True.
**repeat**bool, default: True
Whether the animation repeats when the sequence of frames is completed.
**blit**bool, default: False
Whether blitting is used to optimize drawing.
\_\_init\_\_(*fig*, *artists*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/animation.py#L1458-L1465)
#### Methods
| | |
| --- | --- |
| [`__init__`](#matplotlib.animation.ArtistAnimation.__init__ "matplotlib.animation.ArtistAnimation.__init__")(fig, artists, \*args, \*\*kwargs) | |
| `new_frame_seq`() | Return a new sequence of frame information. |
| `new_saved_frame_seq`() | Return a new sequence of saved/cached frame information. |
| `pause`() | Pause the animation. |
| `resume`() | Resume the animation. |
| `save`(filename[, writer, fps, dpi, codec, ...]) | Save the animation as a movie file by drawing every frame. |
| `to_html5_video`([embed\_limit]) | Convert the animation to an HTML5 `<video>` tag. |
| `to_jshtml`([fps, embed\_frames, default\_mode]) | Generate HTML representation of the animation. |
| programming_docs |
matplotlib matplotlib.axes.Axes.get_yticklabels matplotlib.axes.Axes.get\_yticklabels
=====================================
Axes.get\_yticklabels(*minor=False*, *which=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Get the yaxis' tick labels.
Parameters:
**minor**bool
Whether to return the minor or the major ticklabels.
**which**None, ('minor', 'major', 'both')
Overrides *minor*.
Selects which ticklabels to return
Returns:
list of [`Text`](../text_api#matplotlib.text.Text "matplotlib.text.Text")
Examples using `matplotlib.axes.Axes.get_yticklabels`
-----------------------------------------------------
[Programmatically controlling subplot adjustment](https://matplotlib.org/stable/gallery/pyplots/auto_subplots_adjust.html#sphx-glr-gallery-pyplots-auto-subplots-adjust-py)
Programmatically controlling subplot adjustment
matplotlib matplotlib.axes.Axes.phase_spectrum matplotlib.axes.Axes.phase\_spectrum
====================================
Axes.phase\_spectrum(*x*, *Fs=None*, *Fc=None*, *window=None*, *pad\_to=None*, *sides=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L7424-L7491)
Plot the phase spectrum.
Compute the phase spectrum (unwrapped angle spectrum) of *x*. Data is padded to a length of *pad\_to* and the windowing function *window* is applied to the signal.
Parameters:
**x**1-D array or sequence
Array or sequence containing the data
**Fs**float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, *freqs*, in cycles per time unit.
**window**callable or ndarray, default: [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning")
A function or a vector of length *NFFT*. To create window vectors see [`window_hanning`](../mlab_api#matplotlib.mlab.window_hanning "matplotlib.mlab.window_hanning"), [`window_none`](../mlab_api#matplotlib.mlab.window_none "matplotlib.mlab.window_none"), [`numpy.blackman`](https://numpy.org/doc/stable/reference/generated/numpy.blackman.html#numpy.blackman "(in NumPy v1.23)"), [`numpy.hamming`](https://numpy.org/doc/stable/reference/generated/numpy.hamming.html#numpy.hamming "(in NumPy v1.23)"), [`numpy.bartlett`](https://numpy.org/doc/stable/reference/generated/numpy.bartlett.html#numpy.bartlett "(in NumPy v1.23)"), [`scipy.signal`](https://docs.scipy.org/doc/scipy/reference/signal.html#module-scipy.signal "(in SciPy v1.9.1)"), [`scipy.signal.get_window`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window "(in SciPy v1.9.1)"), etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
**sides**{'default', 'onesided', 'twosided'}, optional
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
**pad\_to**int, optional
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the *n* parameter in the call to [`fft`](https://numpy.org/doc/stable/reference/generated/numpy.fft.fft.html#numpy.fft.fft "(in NumPy v1.23)"). The default is None, which sets *pad\_to* equal to the length of the input signal (i.e. no padding).
**Fc**int, default: 0
The center frequency of *x*, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
Returns:
**spectrum**1-D array
The values for the phase spectrum in radians (real valued).
**freqs**1-D array
The frequencies corresponding to the elements in *spectrum*.
**line**[`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The line created by this function.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*
**\*\*kwargs**
Keyword arguments control the [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`magnitude_spectrum`](matplotlib.axes.axes.magnitude_spectrum#matplotlib.axes.Axes.magnitude_spectrum "matplotlib.axes.Axes.magnitude_spectrum")
Plots the magnitudes of the corresponding frequencies.
[`angle_spectrum`](matplotlib.axes.axes.angle_spectrum#matplotlib.axes.Axes.angle_spectrum "matplotlib.axes.Axes.angle_spectrum")
Plots the wrapped version of this function.
[`specgram`](matplotlib.axes.axes.specgram#matplotlib.axes.Axes.specgram "matplotlib.axes.Axes.specgram")
Can plot the phase spectrum of segments within the signal in a colormap.
matplotlib mpl_toolkits.axisartist.angle_helper.select_step_hour mpl\_toolkits.axisartist.angle\_helper.select\_step\_hour
=========================================================
mpl\_toolkits.axisartist.angle\_helper.select\_step\_hour(*dv*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/mpl_toolkits/axisartist/angle_helper.py#L33-L56)
matplotlib matplotlib.artist.Artist.set_snap matplotlib.artist.Artist.set\_snap
==================================
Artist.set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
matplotlib matplotlib.axes.Axes.xaxis_date matplotlib.axes.Axes.xaxis\_date
================================
Axes.xaxis\_date(*tz=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_base.py#L72-L73)
Set up axis ticks and labels to treat data along the xaxis as dates.
Parameters:
**tz**str or [`datetime.tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.tzinfo "(in Python v3.10)"), default: `[rcParams["timezone"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=timezone#matplotlibrc-sample)` (default: `'UTC'`)
The timezone used to create date labels.
matplotlib matplotlib.axes.Axes.errorbar matplotlib.axes.Axes.errorbar
=============================
Axes.errorbar(*x*, *y*, *yerr=None*, *xerr=None*, *fmt=''*, *ecolor=None*, *elinewidth=None*, *capsize=None*, *barsabove=False*, *lolims=False*, *uplims=False*, *xlolims=False*, *xuplims=False*, *errorevery=1*, *capthick=None*, *\**, *data=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axes/_axes.py#L3293-L3638)
Plot y versus x as lines and/or markers with attached errorbars.
*x*, *y* define the data locations, *xerr*, *yerr* define the errorbar sizes. By default, this draws the data markers/lines as well the errorbars. Use fmt='none' to draw errorbars without any data markers.
Parameters:
**x, y**float or array-like
The data positions.
**xerr, yerr**float or array-like, shape(N,) or shape(2, N), optional
The errorbar sizes:
* scalar: Symmetric +/- values for all data points.
* shape(N,): Symmetric +/-values for each data point.
* shape(2, N): Separate - and + values for each bar. First row contains the lower errors, the second row contains the upper errors.
* *None*: No errorbar.
All values must be >= 0.
See [Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html) for an example on the usage of `xerr` and `yerr`.
**fmt**str, default: ''
The format for the data points / data lines. See [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") for details.
Use 'none' (case insensitive) to plot errorbars without any data markers.
**ecolor**color, default: None
The color of the errorbar lines. If None, use the color of the line connecting the markers.
**elinewidth**float, default: None
The linewidth of the errorbar lines. If None, the linewidth of the current style is used.
**capsize**float, default: `[rcParams["errorbar.capsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=errorbar.capsize#matplotlibrc-sample)` (default: `0.0`)
The length of the error bar caps in points.
**capthick**float, default: None
An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*). This setting is a more sensible name for the property that controls the thickness of the error bar cap in points. For backwards compatibility, if *mew* or *markeredgewidth* are given, then they will over-ride *capthick*. This may change in future releases.
**barsabove**bool, default: False
If True, will plot the errorbars above the plot symbols. Default is below.
**lolims, uplims, xlolims, xuplims**bool, default: False
These arguments can be used to indicate that a value gives only upper/lower limits. In that case a caret symbol is used to indicate this. *lims*-arguments may be scalars, or array-likes of the same length as *xerr* and *yerr*. To use limits with inverted axes, [`set_xlim`](matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") or [`set_ylim`](matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") must be called before [`errorbar()`](#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar"). Note the tricky parameter names: setting e.g. *lolims* to True means that the y-value is a *lower* limit of the True value, so, only an *upward*-pointing arrow will be drawn!
**errorevery**int or (int, int), default: 1
draws error bars on a subset of the data. *errorevery* =N draws error bars on the points (x[::N], y[::N]). *errorevery* =(start, N) draws error bars on the points (x[start::N], y[start::N]). e.g. errorevery=(6, 3) adds error bars to the data at (x[6], x[9], x[12], x[15], ...). Used to avoid overlapping error bars when two series share x-axis values.
Returns:
[`ErrorbarContainer`](../container_api#matplotlib.container.ErrorbarContainer "matplotlib.container.ErrorbarContainer")
The container contains:
* plotline: [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instance of x, y plot markers and/or line.
* caplines: A tuple of [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances of the error bar caps.
* barlinecols: A tuple of [`LineCollection`](../collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") with the horizontal and vertical error ranges.
Other Parameters:
**data**indexable object, optional
If given, the following parameters also accept a string `s`, which is interpreted as `data[s]` (unless this raises an exception):
*x*, *y*, *xerr*, *yerr*
**\*\*kwargs**
All other keyword arguments are passed on to the [`plot`](matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") call drawing the markers. For example, this code makes big red squares with thick green edges:
```
x, y, yerr = rand(3, 10)
errorbar(x, y, yerr, marker='s', mfc='red',
mec='green', ms=20, mew=4)
```
where *mfc*, *mec*, *ms* and *mew* are aliases for the longer property names, *markerfacecolor*, *markeredgecolor*, *markersize* and *markeredgewidth*.
Valid kwargs for the marker properties are:
* *dashes*
* *dash\_capstyle*
* *dash\_joinstyle*
* *drawstyle*
* *fillstyle*
* *linestyle*
* *marker*
* *markeredgecolor*
* *markeredgewidth*
* *markerfacecolor*
* *markerfacecoloralt*
* *markersize*
* *markevery*
* *solid\_capstyle*
* *solid\_joinstyle*
Refer to the corresponding [`Line2D`](matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") property for more details:
| Property | Description |
| --- | --- |
| [`agg_filter`](matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_antialiased "matplotlib.lines.Line2D.set_antialiased") or aa | bool |
| [`clip_box`](matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](../transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_color "matplotlib.lines.Line2D.set_color") or c | color |
| [`dash_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_capstyle "matplotlib.lines.Line2D.set_dash_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`dash_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dash_joinstyle "matplotlib.lines.Line2D.set_dash_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`dashes`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_dashes "matplotlib.lines.Line2D.set_dashes") | sequence of floats (on/off ink in points) or (None, None) |
| [`data`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_data "matplotlib.lines.Line2D.set_data") | (2, N) array or two 1D arrays |
| [`drawstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_drawstyle "matplotlib.lines.Line2D.set_drawstyle") or ds | {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
| [`figure`](matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](../figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fillstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_fillstyle "matplotlib.lines.Line2D.set_fillstyle") | {'full', 'left', 'right', 'bottom', 'top', 'none'} |
| [`gapcolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_gapcolor "matplotlib.lines.Line2D.set_gapcolor") | color or None |
| [`gid`](matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linewidth "matplotlib.lines.Line2D.set_linewidth") or lw | float |
| [`marker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_marker "matplotlib.lines.Line2D.set_marker") | marker style string, [`Path`](../path_api#matplotlib.path.Path "matplotlib.path.Path") or [`MarkerStyle`](matplotlib.markers.markerstyle#matplotlib.markers.MarkerStyle "matplotlib.markers.MarkerStyle") |
| [`markeredgecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgecolor "matplotlib.lines.Line2D.set_markeredgecolor") or mec | color |
| [`markeredgewidth`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markeredgewidth "matplotlib.lines.Line2D.set_markeredgewidth") or mew | float |
| [`markerfacecolor`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecolor "matplotlib.lines.Line2D.set_markerfacecolor") or mfc | color |
| [`markerfacecoloralt`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markerfacecoloralt "matplotlib.lines.Line2D.set_markerfacecoloralt") or mfcalt | color |
| [`markersize`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markersize "matplotlib.lines.Line2D.set_markersize") or ms | float |
| [`markevery`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_markevery "matplotlib.lines.Line2D.set_markevery") | None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
| [`mouseover`](matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](../patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_picker "matplotlib.lines.Line2D.set_picker") | float or callable[[Artist, Event], tuple[bool, dict]] |
| [`pickradius`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_pickradius "matplotlib.lines.Line2D.set_pickradius") | unknown |
| [`rasterized`](matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`solid_capstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_capstyle "matplotlib.lines.Line2D.set_solid_capstyle") | [`CapStyle`](../_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`solid_joinstyle`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_solid_joinstyle "matplotlib.lines.Line2D.set_solid_joinstyle") | [`JoinStyle`](../_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`transform`](matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xdata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_xdata "matplotlib.lines.Line2D.set_xdata") | 1D array |
| [`ydata`](matplotlib.lines.line2d#matplotlib.lines.Line2D.set_ydata "matplotlib.lines.Line2D.set_ydata") | 1D array |
| [`zorder`](matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Examples using `matplotlib.axes.Axes.errorbar`
----------------------------------------------
[Errorbar subsampling](https://matplotlib.org/stable/gallery/lines_bars_and_markers/errorbar_subsample.html#sphx-glr-gallery-lines-bars-and-markers-errorbar-subsample-py)
Errorbar subsampling
[Errorbar function](https://matplotlib.org/stable/gallery/statistics/errorbar.html#sphx-glr-gallery-statistics-errorbar-py)
Errorbar function
[Different ways of specifying error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_features.html#sphx-glr-gallery-statistics-errorbar-features-py)
Different ways of specifying error bars
[Including upper and lower limits in error bars](https://matplotlib.org/stable/gallery/statistics/errorbar_limits.html#sphx-glr-gallery-statistics-errorbar-limits-py)
Including upper and lower limits in error bars
[Creating boxes from error bars using PatchCollection](https://matplotlib.org/stable/gallery/statistics/errorbars_and_boxes.html#sphx-glr-gallery-statistics-errorbars-and-boxes-py)
Creating boxes from error bars using PatchCollection
[Legend Demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/legend_demo.html#sphx-glr-gallery-text-labels-and-annotations-legend-demo-py)
Legend Demo
[Parasite Simple2](https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-gallery-axes-grid1-parasite-simple2-py)
Parasite Simple2
[3D errorbars](https://matplotlib.org/stable/gallery/mplot3d/errorbar3d.html#sphx-glr-gallery-mplot3d-errorbar3d-py)
3D errorbars
[Log Demo](https://matplotlib.org/stable/gallery/scales/log_demo.html#sphx-glr-gallery-scales-log-demo-py)
Log Demo
[errorbar(x, y, yerr, xerr)](https://matplotlib.org/stable/plot_types/stats/errorbar_plot.html#sphx-glr-plot-types-stats-errorbar-plot-py)
errorbar(x, y, yerr, xerr)
| programming_docs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.