matplotlib.figure.Figure.align_titles
- Figure.align_titles(axs=None)[source]
-
Align the titles of subplots in the same subplot row if title alignment is being done automatically (i.e. the title position is not manually set).
Alignment persists for draw events after this is called.
- Parameters:
-
-
axslist of
Axes -
Optional list of (or ndarray)
Axesto align the titles. Default is to align all Axes on the figure.
-
axslist of
See also
Notes
This assumes that all Axes in
axsare from the sameGridSpec, so that theirSubplotSpecpositions correspond to figure positions.Examples
Example with titles:
fig, axs = plt.subplots(1, 2) axs[0].set_aspect('equal') axs[0].set_title('Title 0') axs[1].set_title('Title 1') fig.align_titles()
Examples using matplotlib.figure.Figure.align_titles
© 2012–2026 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.figure.Figure.align_titles.html