matplotlib.figure#
matplotlib.figure implements the following classes:
FigureTop level
Artist, which holds all plot elements. Many methods are implemented inFigureBase.SubFigureA logical figure inside a figure, usually added to a figure (or parent
SubFigure) withFigure.add_subfigureorFigure.subfiguresmethods.
Figures are typically created using pyplot methods figure,
subplots, and subplot_mosaic.
fig, ax = plt.subplots(figsize=(2, 2), facecolor='lightskyblue',
layout='constrained')
fig.suptitle('Figure')
ax.set_title('Axes', loc='left', fontstyle='oblique', fontsize='medium')
(Source code, 2x.png, png)