The top level container for all the plot elements.
See matplotlib.figure for an index of class methods.
The Rectangle instance representing the figure background patch.
For multiple images, the figure will make composite images depending on the renderer option_image_nocomposite function. If suppressComposite is a boolean, this will override the renderer.
rcParams["figure.figsize"] (default: [6.4, 4.8])
Figure dimension (width, height) in inches.
rcParams["figure.dpi"] (default: 100.0)
Dots per inch.
rcParams["figure.facecolor"] (default: 'white')
The figure patch facecolor.
rcParams["figure.edgecolor"] (default: 'white')
The figure patch edge color.
The linewidth of the frame (i.e. the edge linewidth of the figure patch).
rcParams["figure.frameon"] (default: True)
If False, suppress drawing the figure background patch.
SubplotParams
Subplot parameters. If not given, the default subplot parameters rcParams["figure.subplot.*"] are used.
rcParams["figure.autolayout"] (default: False)
Whether to use the tight layout mechanism. See set_tight_layout.
Discouraged
The use of this parameter is discouraged. Please use layout='tight' instead for the common case of tight_layout=True and use set_tight_layout otherwise.
rcParams["figure.constrained_layout.use"] (default: False)
This is equal to layout='constrained'.
Discouraged
The use of this parameter is discouraged. Please use layout='constrained' instead.
LayoutEngine, None}, default: None
The layout mechanism for positioning of plot elements to avoid overlapping Axes decorations (labels, ticks, etc). Note that layout managers can have significant performance penalties.
'constrained': The constrained layout solver adjusts Axes sizes to avoid overlapping Axes decorations. Can handle complex plot layouts and colorbars, and is thus recommended.
See Constrained layout guide for examples.
'tight': Use the tight layout mechanism. This is a relatively simple algorithm that adjusts the subplot parameters so that decorations do not overlap.
See Tight layout guide for examples.
LayoutEngine instance. Builtin layout classes are ConstrainedLayoutEngine and TightLayoutEngine, more easily accessible by 'constrained' and 'tight'. Passing an instance allows third parties to provide their own layout engine.If not given, fall back to using the parameters tight_layout and constrained_layout, including their config defaults rcParams["figure.autolayout"] (default: False) and rcParams["figure.constrained_layout.use"] (default: False).
Figure properties, optional
Property | Description |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
FigureCanvas | |
| |
bool | |
Patch or (Path, Transform) or None | |
unknown | |
unknown | |
float | |
float | |
float | |
bool | |
str | |
bool | |
object | |
{'constrained', 'compressed', 'tight', 'none', | |
number | |
bool | |
list of | |
None or bool or float or callable | |
bool | |
(float, float) or float | |
(scale: float, length: float, randomness: float) | |
bool or None | |
unknown | |
str | |
bool | |
float |
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.html