alias of matplotlib.backends.backend_pgf.FigureCanvasPgf
Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.
Use LaTeX to compile a pgf generated figure to pdf.
Output pgf macros for drawing the figure so it can be included and rendered in latex documents.
Use LaTeX to compile a pgf figure to pdf and convert it to png.
Bases: Exception
Bases: object
The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be modified by setting fonts and/or a custom preamble in rcParams.
Get the width, total height, and descent (in TeX points) for a text typeset by the current LaTeX environment.
Bases: object
A multi-page PDF file using the pgf backend
Create a new PdfPages object.
Plots using PdfPages.savefig will be written to a file at this location. Any older file with the same name is overwritten.
If set to False, then empty pdf files will be deleted automatically when closed.
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.
Note that some versions of LaTeX engines may ignore the 'Producer' key and set it to themselves.
Finalize this object, running LaTeX in a temporary directory and moving the final pdf file to filename.
Return the current number of pages in the multipage pdf file.
Save a Figure to this file as a new page.
Any other keyword arguments are passed to savefig.
The figure, or index of the figure, that is saved to the file.
Bases: matplotlib.backend_bases.RendererBase
Create a new PGF renderer that translates any drawing instruction into text commands to be interpreted in a latex pgfpicture environment.
Matplotlib figure to initialize height, width and dpi from.
File handle for the output of the drawing commands.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts and images.
Return the canvas width and height in display coords.
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
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"].
Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).
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:
a float or a numpy array of float
Bases: object
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
Do some necessary and/or useful substitutions for texts to be included in LaTeX documents.
This distinguishes text-mode and math-mode by replacing the math separator $ with \(\displaystyle %s\). Escaped math separators (\$) are ignored.
The following characters are escaped in text segments: _^$%
Build fontspec preamble from rc.
Get LaTeX preamble from rc.
Return a function that converts a pdf file to a png file.


A PostScript backend, which can produce both PostScript .ps and .eps.
alias of matplotlib.backends.backend_ps.FigureCanvasPS
Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.
Bases: matplotlib.backend_bases.GraphicsContextBase
[Deprecated]
Deprecated since version 3.4:
Return the CapStyle.
Return the JoinStyle.
Bases: object
Bases: matplotlib.backends._backend_pdf_ps.RendererPDFPSBase
The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles.
Draw a Gouraud-shaded triangle.
The graphics context.
Array of (x, y) points for the triangle.
RGBA colors for each point of the triangle.
An affine transform to apply to the points.
Draw a series of Gouraud triangles.
Array of N (x, y) points for the triangles.
Array of N RGBA colors for each point of the triangles.
An affine transform to apply to the points.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw the math text using matplotlib.mathtext.
Draw a Path instance using the given affine transform.
Draw a collection of paths selecting drawing properties from the lists facecolors, edgecolors, linewidths, linestyles and antialiaseds. offsets is a list of offsets to apply to each of the paths. The offsets in offsets are first transformed by offsetTrans before being applied.
offset_position is unused now, but the argument is kept for backwards compatibility.
This provides a fallback implementation of draw_path_collection() that makes multiple calls to draw_path(). Some 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() can be made globally.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
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.
When we want to use the LaTeX backend with postscript, we write PSFrag tags to a temporary postscript file, each one marking a position for LaTeX to render some text. convert_psfrags generates a LaTeX document containing the commands to convert those tags to text. LaTeX/dvips produces the postscript file that includes the actual text.
Return a postscript header string for the given bbox lbrt=(l, b, r, t). Optionally, return rotate command.
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.
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.
Quote dangerous characters of S for use in a PostScript string constant.
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.


alias of matplotlib.backends.backend_svg.FigureCanvasSVG
Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.
Output target; if a string, a file will be opened for writing.
Metadata in the SVG file defined as key-value pairs of strings, datetimes, or lists of strings, e.g., {'Creator': 'My software',
'Contributor': ['Me', 'My Friend'], 'Title': 'Awesome'}.
The standard keys and their value types are:
Values have been predefined for 'Creator', 'Date', 'Format', and 'Type'. They can be removed by setting them to None.
Information is encoded as Dublin Core Metadata.
Bases: matplotlib.backend_bases.RendererBase
Close a grouping element with label s.
Only used by the SVG renderer.
Draw a Gouraud-shaded triangle.
The graphics context.
Array of (x, y) points for the triangle.
RGBA colors for each point of the triangle.
An affine transform to apply to the points.
Draw a series of Gouraud triangles.
Array of N (x, y) points for the triangles.
Array of N RGBA colors for each point of the triangles.
An affine transform to apply to the points.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw a Path instance using the given affine transform.
Draw a collection of paths selecting drawing properties from the lists facecolors, edgecolors, linewidths, linestyles and antialiaseds. offsets is a list of offsets to apply to each of the paths. The offsets in offsets are first transformed by offsetTrans before being applied.
offset_position is unused now, but the argument is kept for backwards compatibility.
This provides a fallback implementation of draw_path_collection() that makes multiple calls to draw_path(). Some 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() can be made globally.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts and images.
Return the canvas width and height in display coords.
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.
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
Open a grouping element with label s and gid (if set) as id.
Only used by the SVG renderer.
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"].
Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).
Bases: object
Close open elements, up to (and including) the element identified by the given identifier.
Element identifier, as returned by the start() method.
Add a comment to the output stream.
Comment text.
Add character data to the output stream.
Character data.
Add an entire element. This is the same as calling start(), data(), and end() in sequence. The text argument can be omitted.
Close the current element (opened by the most recent call to start()).
Element tag. If given, the tag must match the start tag. If omitted, the current element is closed.
Flush the output stream.
Open a new element. Attributes can be given as keyword arguments, or as a string/string dictionary. The method returns an opaque identifier that can be passed to the close() method, to close all open elements up to and including this one.
Element tag.
Attribute dictionary. Alternatively, attributes can be given as keyword arguments.
Create a short string representation of a float, which is %f formatting with trailing zeros and the decimal point removed.


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
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, 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
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:
alias of matplotlib.backends.backend_template.FigureCanvasTemplate
Bases: 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.
A high-level Figure instance
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.
Write out format foo.
This method is normally called via Figure.savefig and 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 does not need to handle these settings.
alias of matplotlib.backends.backend_template.FigureManagerTemplate
Bases: 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.
Bases: 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.
Bases: 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 for documentation of the methods.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts and images.
Return the canvas width and height in display coords.
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
Return an instance of a GraphicsContextBase.
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:
a float or a numpy array of float
For image backends - is not required. For GUI backends - this should be overridden if drawing should be done in interactive python mode.
Create a new figure manager instance.
Create a new figure manager instance for the given figure.
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.


Abstract base classes define the primitives for Tools. These tools are used by matplotlib.backend_managers.ToolManager
Simple stateless tool
Tool that has two states, only one Toggle tool can be active at any given time for the same matplotlib.backend_managers.ToolManager
Bases: matplotlib.backend_tools.ToolToggleBase
Base Tool to toggle between linear and logarithmic.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.
Calls enable or disable based on toggled value.
Bases: matplotlib.backend_tools.ToolBase
Base tool for the configuration of subplots.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: enum.IntEnum
Backend-independent cursor types.
Bases: matplotlib.backend_tools.ToolBase
Draw and remove a rubberband.
Draw rubberband.
This method must get implemented per backend.
Remove rubberband.
This method should get implemented per backend.
Call draw_rubberband or remove_rubberband based on data.
Bases: matplotlib.backend_tools.ToolBase
Base tool for figure saving.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: matplotlib.backend_tools.ToolBase
Change to the current cursor while inaxes.
This tool, keeps track of all ToolToggleBase derived tools, and calls set_cursor when a tool gets triggered.
[Deprecated] Set the cursor.
Deprecated since version 3.5.
Bases: matplotlib.backend_tools.ViewsPositionsBase
Move back up the view limits stack.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: object
Base tool class.
A base tool, only implements trigger method or no method at all. The tool is instantiated by matplotlib.backend_managers.ToolManager.
The canvas of the figure affected by this tool, or 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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Destroy the tool.
This method is called by ToolManager.remove_tool.
The Figure affected by this tool, or None.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
The tool id (str, must be unique among tools of a tool manager).
The ToolManager that controls this tool.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
alias of matplotlib.backend_tools.ToolCopyToClipboardBase
Bases: matplotlib.backend_tools.ToolBase
Tool to copy the figure to the clipboard.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
Bases: matplotlib.backend_tools.ToolBase
Send message with the current pointer position.
This tool runs in the background reporting the position of the cursor.
Call matplotlib.backend_managers.ToolManager.message_event.
Bases: matplotlib.backend_tools.ViewsPositionsBase
Move forward in the view lim stack.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: matplotlib.backend_tools.ToolToggleBase
Tool to toggle full screen.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.
Bases: matplotlib.backend_tools.ToolBase
Tool to toggle the major grids of the figure.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
Bases: matplotlib.backend_tools.ToolBase
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Convert a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: matplotlib.backend_tools.ViewsPositionsBase
Restore the original view limits.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Bases: matplotlib.backend_tools.ToolBase
Tool to toggle the major and minor grids of the figure.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
Bases: matplotlib.backend_tools.ZoomPanBase
Pan axes with left mouse, zoom with right.
Cursor to use when the tool is active.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.
Bases: matplotlib.backend_tools.ToolBase
Tool to call the figure manager destroy method.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
Bases: matplotlib.backend_tools.ToolBase
Tool to call the figure manager destroy method.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
alias of matplotlib.backend_tools.SetCursorBase
Bases: matplotlib.backend_tools.ToolBase
Toggleable tool.
Every time it is triggered, it switches between enable and disable.
Variable length argument to be used by the Tool.
toggled if present and True, sets the initial state of the Tool Arbitrary keyword arguments to be consumed by the Tool
Cursor to use when the tool is active.
Default of toggled state.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.
State of the toggled tool.
Calls enable or disable based on toggled value.
Bases: matplotlib.backend_tools.ToolBase
Auxiliary Tool to handle changes in views and positions.
Runs in the background and should get used by all the tools that need to access the figure's history of views and positions, e.g.
Add the current figure to the stack of views and positions.
Back one step in the stack of views and positions.
Reset the axes stack.
Forward one step in the stack of views and positions.
Recall the first view and position from the stack.
Push the current view limits and position onto their respective stacks.
Make sure that self.home_views has an entry for all axes present in the figure.
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.
Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the X axis.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the Y axis.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Bases: matplotlib.backend_tools.ZoomPanBase
A Tool for zooming using a rectangle selector.
Cursor to use when the tool is active.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.
Bases: matplotlib.backend_tools.ToolBase
Base class for ToolHome, ToolBack and ToolForward.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.
Bases: matplotlib.backend_tools.ToolToggleBase
Base class for ToolZoom and ToolPan.
Release the canvas and disconnect press/release events.
Connect press/release events and lock the canvas.
Calls enable or disable based on toggled value.
Add multiple tools to the container.
backend_bases.ToolContainerBase object that will get the tools added.
List in the form [[group1, [tool1, tool2 ...]], [group2, [...]]] where the tools [tool1, tool2, ...] will display in group1. See add_tool for details.
Add multiple tools to a ToolManager.
Manager to which the tools are added.
The tools to add in a {name: tool} dict, see add_tool for more info.
alias of matplotlib.backend_tools.Cursors
Default tools in the toolbar
Default tools


Add multiple tools to the container.
backend_bases.ToolContainerBase object that will get the tools added.
List in the form [[group1, [tool1, tool2 ...]], [group2, [...]]] where the tools [tool1, tool2, ...] will display in group1. See add_tool for details.


Add multiple tools to a ToolManager.
Manager to which the tools are added.
The tools to add in a {name: tool} dict, see add_tool for more info.


Bases: matplotlib.backend_tools.ToolToggleBase
Base Tool to toggle between linear and logarithmic.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.
Calls enable or disable based on toggled value.


Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.


Enable the toggle tool.
trigger calls this method when toggled is False.


Calls enable or disable based on toggled value.


Bases: matplotlib.backend_tools.ToolBase
Base tool for the configuration of subplots.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.


Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Bases: enum.IntEnum
Backend-independent cursor types.


Bases: matplotlib.backend_tools.ToolBase
Draw and remove a rubberband.
Draw rubberband.
This method must get implemented per backend.
Remove rubberband.
This method should get implemented per backend.
Call draw_rubberband or remove_rubberband based on data.


Draw rubberband.
This method must get implemented per backend.


Remove rubberband.
This method should get implemented per backend.


Call draw_rubberband or remove_rubberband based on data.


Bases: matplotlib.backend_tools.ToolBase
Base tool for figure saving.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


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.


Bases: matplotlib.backend_tools.ToolBase
Change to the current cursor while inaxes.
This tool, keeps track of all ToolToggleBase derived tools, and calls set_cursor when a tool gets triggered.
[Deprecated] Set the cursor.
Deprecated since version 3.5.


[Deprecated] Set the cursor.
Deprecated since version 3.5.


Bases: matplotlib.backend_tools.ViewsPositionsBase
Move back up the view limits stack.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Bases: object
Base tool class.
A base tool, only implements trigger method or no method at all. The tool is instantiated by matplotlib.backend_managers.ToolManager.
The canvas of the figure affected by this tool, or 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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Destroy the tool.
This method is called by ToolManager.remove_tool.
The Figure affected by this tool, or None.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
The tool id (str, must be unique among tools of a tool manager).
The ToolManager that controls this tool.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Destroy the tool.
This method is called by ToolManager.remove_tool.


Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ToolBase
Tool to copy the figure to the clipboard.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ToolBase
Send message with the current pointer position.
This tool runs in the background reporting the position of the cursor.
Call matplotlib.backend_managers.ToolManager.message_event.


Bases: matplotlib.backend_tools.ViewsPositionsBase
Move forward in the view lim stack.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.


Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Bases: matplotlib.backend_tools.ToolToggleBase
Tool to toggle full screen.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.


Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.


Enable the toggle tool.
trigger calls this method when toggled is False.


Bases: matplotlib.backend_tools.ToolBase
Tool to toggle the major grids of the figure.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ToolBase
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Convert a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


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.


Convert a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.


Bases: matplotlib.backend_tools.ViewsPositionsBase
Restore the original view limits.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Bases: matplotlib.backend_tools.ToolBase
Tool to toggle the major and minor grids of the figure.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ZoomPanBase
Pan axes with left mouse, zoom with right.
Cursor to use when the tool is active.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.


Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.


Bases: matplotlib.backend_tools.ToolBase
Tool to call the figure manager destroy method.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ToolBase
Toggleable tool.
Every time it is triggered, it switches between enable and disable.
Variable length argument to be used by the Tool.
toggled if present and True, sets the initial state of the Tool Arbitrary keyword arguments to be consumed by the Tool
Cursor to use when the tool is active.
Default of toggled state.
Disable the toggle tool.
trigger call this method when toggled is True.
This can happen in different circumstances.
Enable the toggle tool.
trigger calls this method when toggled is False.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.
State of the toggled tool.
Calls enable or disable based on toggled value.


Calls enable or disable based on toggled value.


Bases: matplotlib.backend_tools.ToolBase
Auxiliary Tool to handle changes in views and positions.
Runs in the background and should get used by all the tools that need to access the figure's history of views and positions, e.g.
Add the current figure to the stack of views and positions.
Back one step in the stack of views and positions.
Reset the axes stack.
Forward one step in the stack of views and positions.
Recall the first view and position from the stack.
Push the current view limits and position onto their respective stacks.
Make sure that self.home_views has an entry for all axes present in the figure.
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.


Add the current figure to the stack of views and positions.


Back one step in the stack of views and positions.


Forward one step in the stack of views and positions.


Recall the first view and position from the stack.


Push the current view limits and position onto their respective stacks.


Make sure that self.home_views has an entry for all axes present in the figure.


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.


Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the X axis.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.


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.


Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.


Bases: matplotlib.backend_tools.AxisScaleBase
Tool to toggle between linear and logarithmic scales on the Y axis.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.


Bases: matplotlib.backend_tools.ZoomPanBase
A Tool for zooming using a rectangle selector.
Cursor to use when the tool is active.
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.
Description of the Tool.
str: Tooltip used if the Tool is included in a Toolbar.
Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.
Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.


Filename of the image.
str: Filename of the image to use in a Toolbar. If None, the name is used as a label in the toolbar button.


Attribute to group 'radio' like tools (mutually exclusive).
str that identifies the group or None if not belonging to a group.


Bases: matplotlib.backend_tools.ToolBase
Base class for ToolHome, ToolBack and ToolForward.
Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Called when this tool gets used.
This method is called by ToolManager.trigger_tool.
The canvas event that caused this tool to be called.
Object that requested the tool to be triggered.
Extra data.


Bases: matplotlib.backend_tools.ToolToggleBase
Base class for ToolZoom and ToolPan.
Release the canvas and disconnect press/release events.
Connect press/release events and lock the canvas.
Calls enable or disable based on toggled value.


Release the canvas and disconnect press/release events.


Connect press/release events and lock the canvas.


Calls enable or disable based on toggled value.


Displays Agg images in the browser, with interactivity
alias of matplotlib.backends.backend_webagg.FigureCanvasWebAgg
Bases: matplotlib.backends.backend_webagg_core.FigureCanvasWebAggCore
Bases: threading.Thread
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.
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.
Bases: tornado.web.Application
Bases: tornado.web.RequestHandler
Bases: tornado.web.RequestHandler
Bases: tornado.web.RequestHandler
Bases: tornado.web.RequestHandler
Bases: tornado.web.RequestHandler
Bases: tornado.websocket.WebSocketHandler
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.
Handle incoming messages on the WebSocket
This method must be overridden.
Changed in version 4.5: on_message can be a coroutine.
Invoked when a new WebSocket is opened.
The arguments to open are extracted from the tornado.web.URLSpec regular expression, just like the arguments to tornado.web.RequestHandler.get.
open may be a coroutine. on_message will not be called until open has returned.
Changed in version 5.1: open may be a coroutine.
Show all figures.
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.


Bases: matplotlib.backend_bases.FigureCanvasBase
Get the image as a memoryview to the renderer's buffer.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
Render the Figure.
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.
Write the figure to a JPEG file.
The file to write to.
Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.
Write the figure to a JPEG file.
The file to write to.
Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.
Write the figure to a PNG file.
The file to write to.
Metadata in the PNG file as key-value pairs of bytes or latin-1 encodable strings. According to the PNG specification, keys must be shorter than 79 chars.
The PNG specification defines some common keywords that may be used as appropriate:
Other keywords may be invented for other purposes.
If 'Software' is not given, an autogenerated value for Matplotlib will be used. This can be removed by setting it to None.
For more details see the PNG specification.
Keyword arguments passed to PIL.Image.Image.save.
If the 'pnginfo' key is present, it completely overrides metadata, including the default 'Software' key.
Get the image as ARGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
Get the image as RGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.


Get the image as a memoryview to the renderer's buffer.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.


Render the Figure.
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.


Write the figure to a JPEG file.
The file to write to.
Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.


Write the figure to a PNG file.
The file to write to.
Metadata in the PNG file as key-value pairs of bytes or latin-1 encodable strings. According to the PNG specification, keys must be shorter than 79 chars.
The PNG specification defines some common keywords that may be used as appropriate:
Other keywords may be invented for other purposes.
If 'Software' is not given, an autogenerated value for Matplotlib will be used. This can be removed by setting it to None.
For more details see the PNG specification.
Keyword arguments passed to PIL.Image.Image.save.
If the 'pnginfo' key is present, it completely overrides metadata, including the default 'Software' key.


Get the image as ARGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.


Get the image as RGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.


Bases: matplotlib.backend_bases.RendererBase
The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles
Draw mathtext using matplotlib.mathtext.
Draw a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return the canvas width and height in display coords.
[Deprecated]
Deprecated since version 3.4:
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
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"].
Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).
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:
a float or a numpy array of float
Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. xy (a pair of floats) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox) where the region will be restored.
Start filtering. It simply create a new canvas (the old one is saved).
Save the plot in the current canvas as a image and apply the post_processing function.
# ny, nx, depth = image.shape # image (numpy array) has RGBA channels and has a depth of 4. ... # create a new_image (numpy array of 4 channels, size can be # different). The resulting image may have offsets from # lower-left corner of the original image return new_image, offset_x, offset_y
The saved renderer is restored and the returned image from post_processing is plotted (using draw_image) on it.
[Deprecated]
Deprecated since version 3.4:


Draw mathtext using matplotlib.mathtext.


Draw a Path instance using the given affine transform.


Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.


Return the canvas width and height in display coords.


[Deprecated]
Deprecated since version 3.4:


Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.


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"].


Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).


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:
a float or a numpy array of float


Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. xy (a pair of floats) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox) where the region will be restored.


Start filtering. It simply create a new canvas (the old one is saved).


Save the plot in the current canvas as a image and apply the post_processing function.
# ny, nx, depth = image.shape # image (numpy array) has RGBA channels and has a depth of 4. ... # create a new_image (numpy array of 4 channels, size can be # different). The resulting image may have offsets from # lower-left corner of the original image return new_image, offset_x, offset_y
The saved renderer is restored and the returned image from post_processing is plotted (using draw_image) on it.


Bases: matplotlib.backend_bases.GraphicsContextBase
Return a tuple of three or four floats from 0-1.
Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack.
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 whether object should be drawn with antialiased rendering.
Set how to draw endpoints of lines.
Set the clip path to a TransformedPath or None.
Set the clip rectangle to a Bbox or None.
Set the dash style for the gc.
The offset (usually 0).
The on-off sequence as points. None specifies a solid line.
See p. 107 of to PostScript blue book for more info.
Set the foreground color.
If fg is known to be an (r, g, b, a) tuple, isRGBA can be set to True to improve performance.
Set how to draw connections between line segments.
Set the linewidth in points.


Return a tuple of three or four floats from 0-1.


Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack.


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 whether object should be drawn with antialiased rendering.


Set the clip path to a TransformedPath or None.


Set the clip rectangle to a Bbox or None.


Set the dash style for the gc.
The offset (usually 0).
The on-off sequence as points. None specifies a solid line.
See p. 107 of to PostScript blue book for more info.


Set the foreground color.
If fg is known to be an (r, g, b, a) tuple, isRGBA can be set to True to improve performance.


Set how to draw connections between line segments.


Bases: matplotlib.backend_bases.RendererBase
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return the canvas width and height in display coords.
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
Return an instance of a GraphicsContextBase.
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:
a float or a numpy array of float


Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.


Draw a Path instance using the given affine transform.


Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.


Return the canvas width and height in display coords.


Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.


Return an instance of a GraphicsContextBase.


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:
a float or a numpy array of float


Bases: object
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.
The figure instance.
The width of the canvas in logical units
The height of the canvas in logical units
The dpi of the canvas
An instance of a subclass of RendererBase that will be used for the vector drawing.
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.)
Enter "raster" mode. All subsequent drawing commands (until stop_rasterizing is called) will be drawn with the raster backend.
Exit "raster" mode. All of the drawing that was done since the last start_rasterizing call will be copied to the vector backend by calling draw_image.


Enter "raster" mode. All subsequent drawing commands (until stop_rasterizing is called) will be drawn with the raster backend.


Exit "raster" mode. All of the drawing that was done since the last start_rasterizing call will be copied to the vector backend by calling draw_image.


Bases: object
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.


Return a string showing the figure and connection status for the backend.
This is intended as a diagnostic tool, and not for general use.


Bases: matplotlib.backends.backend_webagg_core.FigureManagerWebAgg
alias of matplotlib.backends.backend_nbagg.NavigationIPy
Clear up any closed Comms.
A special method to re-show the figure in the notebook.
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.


A special method to re-show the figure in the notebook.


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.


Create a new figure manager instance for the given figure.


Show all figures.
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.


Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.


Render the Figure.
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.


Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.


Make one string from sequence of strings, with whitespace in between.
The whitespace is chosen to form lines of at most linelen characters, if possible.


Bases: matplotlib.backend_bases.GraphicsContextBase
Set clip rectangle. Calls pop() and push().
Copy properties of other into self.
Copy properties of other into self and return PDF commands needed to transform self into other.
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.
Make sure every pushed graphics state is popped.
Return the appropriate pdf operator to cause the path to be stroked, filled, or both.
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.


Set clip rectangle. Calls pop() and push().


Copy properties of other into self and return PDF commands needed to transform self into other.


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.


Make sure every pushed graphics state is popped.


Return the appropriate pdf operator to cause the path to be stroked, filled, or both.


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.


Bases: matplotlib.backends.backend_pdf.Operator, enum.Enum
An enumeration.
Return the PDF operator to paint a path.
Fill the path with the fill color.
Stroke the outline of the path with the line color.


Return the PDF operator to paint a path.
Fill the path with the fill color.
Stroke the outline of the path with the line color.


Bases: object
PDF file object.
Output target; if a string, a file will be opened for writing.
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.
Add a Gouraud triangle shading.
Triangle vertices, shape (n, 3, 2) where n = number of triangles, 3 = vertices, 2 = x, y.
Vertex colors, shape (n, 3, 1) or (n, 3, 4) as with points, but last dimension is either (gray,) or (r, g, b, alpha).
Return name of an ExtGState that sets alpha to the given value.
Flush all buffers and free all resources.
Given a dvi font object, return a name suitable for Op.selectfont. This registers the font information in self.dviFontInfo if not yet registered.
Embed the TTF font from the named file into the document.
Write out the various deferred objects and the pdf end matter.
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.
Return name of an image XObject representing the given image.
Return name of a marker XObject representing the given path.
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 out the info dictionary, checking it for good form
Write out the PDF trailer.
Write out the xref table.


Add a Gouraud triangle shading.
Triangle vertices, shape (n, 3, 2) where n = number of triangles, 3 = vertices, 2 = x, y.
Vertex colors, shape (n, 3, 1) or (n, 3, 4) as with points, but last dimension is either (gray,) or (r, g, b, alpha).


Return name of an ExtGState that sets alpha to the given value.


Flush all buffers and free all resources.


Given a dvi font object, return a name suitable for Op.selectfont. This registers the font information in self.dviFontInfo if not yet registered.


Embed the TTF font from the named file into the document.


Write out the various deferred objects and the pdf end matter.


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.


Return name of an image XObject representing the given image.


Return name of a marker XObject representing the given path.


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 out the info dictionary, checking it for good form


Bases: object
A multi-page PDF file.
In reality PdfPages is a thin wrapper around PdfFile, in order to avoid confusion when using savefig and forgetting the format argument.
Create a new PdfPages object.
Plots using 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.
If set to False, then empty pdf files will be deleted automatically when closed.
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.
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.
Finalize this object, making the underlying file a complete PDF file.
Return the current number of pages in the multipage pdf file.
Return a modifiable information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary').
Save a Figure to this file as a new page.
Any other keyword arguments are passed to savefig.
The figure, or index of the figure, that is saved to the file.


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.


Finalize this object, making the underlying file a complete PDF file.


Return the current number of pages in the multipage pdf file.


Return a modifiable information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary').


Save a Figure to this file as a new page.
Any other keyword arguments are passed to savefig.
The figure, or index of the figure, that is saved to the file.


Bases: object
PDF reference object.
Use PdfFile.reserveObject() to create References.


Bases: matplotlib.backends._backend_pdf_ps.RendererPDFPSBase
Draw a Gouraud-shaded triangle.
The graphics context.
Array of (x, y) points for the triangle.
RGBA colors for each point of the triangle.
An affine transform to apply to the points.
Draw a series of Gouraud triangles.
Array of N (x, y) points for the triangles.
Array of N RGBA colors for each point of the triangles.
An affine transform to apply to the points.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw a Path instance using the given affine transform.
Draw a collection of paths selecting drawing properties from the lists facecolors, edgecolors, linewidths, linestyles and antialiaseds. offsets is a list of offsets to apply to each of the paths. The offsets in offsets are first transformed by offsetTrans before being applied.
offset_position is unused now, but the argument is kept for backwards compatibility.
This provides a fallback implementation of draw_path_collection() that makes multiple calls to draw_path(). Some 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() can be made globally.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
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.
Return an instance of a GraphicsContextBase.


Draw a Gouraud-shaded triangle.
The graphics context.
Array of (x, y) points for the triangle.
RGBA colors for each point of the triangle.
An affine transform to apply to the points.


Draw a series of Gouraud triangles.
Array of N (x, y) points for the triangles.
Array of N RGBA colors for each point of the triangles.
An affine transform to apply to the points.


Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.


Draw a Path instance using the given affine transform.


Draw a collection of paths selecting drawing properties from the lists facecolors, edgecolors, linewidths, linestyles and antialiaseds. offsets is a list of offsets to apply to each of the paths. The offsets in offsets are first transformed by offsetTrans before being applied.
offset_position is unused now, but the argument is kept for backwards compatibility.
This provides a fallback implementation of draw_path_collection() that makes multiple calls to draw_path(). Some 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() can be made globally.


Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.


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.


Return an instance of a GraphicsContextBase.


Bases: object
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().
Object id of the stream.
An unused Reference object for the length of the stream; None means to use a memory buffer so the length can be inlined.
The underlying object to write the stream to.
Extra key-value pairs to include in the stream header.
If the data is already png encoded, the decode parameters.
Finalize stream.
Write some data on the stream.


Bases: object
Store verbatim PDF command content for later inclusion in the stream.


Do some necessary and/or useful substitutions for texts to be included in LaTeX documents.
This distinguishes text-mode and math-mode by replacing the math separator $ with \(\displaystyle %s\). Escaped math separators (\$) are ignored.
The following characters are escaped in text segments: _^$%


Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.
Use LaTeX to compile a pgf generated figure to pdf.
Output pgf macros for drawing the figure so it can be included and rendered in latex documents.
Use LaTeX to compile a pgf figure to pdf and convert it to png.


Render the Figure.
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.


Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.


Use LaTeX to compile a pgf generated figure to pdf.


Output pgf macros for drawing the figure so it can be included and rendered in latex documents.


Use LaTeX to compile a pgf figure to pdf and convert it to png.


Bases: object
The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be modified by setting fonts and/or a custom preamble in rcParams.
Get the width, total height, and descent (in TeX points) for a text typeset by the current LaTeX environment.


Get the width, total height, and descent (in TeX points) for a text typeset by the current LaTeX environment.


Return a function that converts a pdf file to a png file.


Bases: object
A multi-page PDF file using the pgf backend
Create a new PdfPages object.
Plots using PdfPages.savefig will be written to a file at this location. Any older file with the same name is overwritten.
If set to False, then empty pdf files will be deleted automatically when closed.
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.
Note that some versions of LaTeX engines may ignore the 'Producer' key and set it to themselves.
Finalize this object, running LaTeX in a temporary directory and moving the final pdf file to filename.
Return the current number of pages in the multipage pdf file.
Save a Figure to this file as a new page.
Any other keyword arguments are passed to savefig.
The figure, or index of the figure, that is saved to the file.


Finalize this object, running LaTeX in a temporary directory and moving the final pdf file to filename.


Return the current number of pages in the multipage pdf file.


Save a Figure to this file as a new page.
Any other keyword arguments are passed to savefig.
The figure, or index of the figure, that is saved to the file.


Bases: matplotlib.backend_bases.RendererBase
Create a new PGF renderer that translates any drawing instruction into text commands to be interpreted in a latex pgfpicture environment.
Matplotlib figure to initialize height, width and dpi from.
File handle for the output of the drawing commands.
Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.
Draw a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts and images.
Return the canvas width and height in display coords.
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
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"].
Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).
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:
a float or a numpy array of float


Draw an RGBA image.
A graphics context with clipping information.
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
An array of RGBA pixels.
If and only if the concrete backend is written such that option_scale_image() returns True, an affine transformation (i.e., an Affine2DBase) may be passed to 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 a marker at each of path's vertices (excluding control points).
This provides a fallback implementation of draw_markers that makes multiple calls to draw_path(). Some backends may want to override this method in order to draw the marker only once and reuse it multiple times.
The graphics context.
An affine transform applied to the marker.
An affine transform applied to the path.


Draw a Path instance using the given affine transform.


Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
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:
to if 1, and then the actual bounding box will be plotted along with your text.


Return whether y values increase from top to bottom.
Note that this only affects drawing of texts and images.


Return the canvas width and height in display coords.


Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.


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"].


Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).


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:
a float or a numpy array of float


Bases: object
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:


[Deprecated]
Deprecated since version 3.4:


When we want to use the LaTeX backend with postscript, we write PSFrag tags to a temporary postscript file, each one marking a position for LaTeX to render some text. convert_psfrags generates a LaTeX document containing the commands to convert those tags to text. LaTeX/dvips produces the postscript file that includes the actual text.


Bases: matplotlib.backend_bases.FigureCanvasBase
Render the Figure.
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.
Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.


Render the Figure.
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.


Return the default savefig file format as specified in rcParams["savefig.format"] (default: 'png').
The returned string does not include a period. This method is overridden in backends that only support a single file type.


Return a postscript header string for the given bbox lbrt=(l, b, r, t). Optionally, return rotate command.


Bases: matplotlib.backend_bases.GraphicsContextBase
[Deprecated]
Deprecated since version 3.4:
Return the CapStyle.
Return the JoinStyle.


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.


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.


Quote dangerous characters of S for use in a PostScript string constant.