matplotlib 3.5.1

ParametersBackRef
print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None, orientation='portrait', format=None, *, bbox_inches=None, pad_inches=None, bbox_extra_artists=None, backend=None, **kwargs)

Parameters

filename : str or path-like or file-like

The file where the figure is saved.

dpi : float, default: :rc:`savefig.dpi`

The dots per inch to save the figure in.

facecolor : color or 'auto', default: :rc:`savefig.facecolor`

The facecolor of the figure. If 'auto', use the current figure facecolor.

edgecolor : color or 'auto', default: :rc:`savefig.edgecolor`

The edgecolor of the figure. If 'auto', use the current figure edgecolor.

orientation : {'landscape', 'portrait'}, default: 'portrait'

Only currently applies to PostScript printing.

format : str, optional

Force a specific file format. If not given, the format is inferred from the filename extension, and if that fails from savefig.format .

bbox_inches : 'tight' or `.Bbox`, default: :rc:`savefig.bbox`

Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure.

pad_inches : float, default: :rc:`savefig.pad_inches`

Amount of padding around the figure when bbox_inches is 'tight'.

bbox_extra_artists : list of `~matplotlib.artist.Artist`, optional

A list of extra artists that will be considered when the tight bbox is calculated.

backend : str, optional

Use a non-default backend to render the file, e.g. to render a png file with the "cairo" backend rather than the default "agg", or a pdf file with the "pgf" backend rather than the default "pdf". Note that the default backend is normally sufficient. See the-builtin-backends for a list of valid backends for each file format. Custom backends can be referenced as "module://...".

Render the figure to hardcopy. Set the figure patch face and edge colors. This is useful because some of the GUIs have a gray figure face color background and you'll probably want to override this on hardcopy.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.backends.backend_ps.FigureCanvasPS._print_figure matplotlib.backend_bases._check_savefig_extra_args

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/backend_bases.py#2192
type: <class 'function'>
Commit: