matplotlib.figure#

matplotlib.figure implements the following classes:

Figure

Top level Artist, which holds all plot elements. Many methods are implemented in FigureBase.

SubFigure

A logical figure inside a figure, usually added to a figure (or parent SubFigure) with Figure.add_subfigure or Figure.subfigures methods.

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)