matplotlib.figure.Figure.align_labels#

Figure.align_labels(axs=None)[source]#

Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set).

Alignment persists for draw events after this is called.

Parameters:
axslist of Axes

Optional list (or ndarray) of Axes to align the labels. Default is to align all Axes on the figure.

Notes

This assumes that all Axes in axs are from the same GridSpec, so that their SubplotSpec positions correspond to figure positions.

Examples using matplotlib.figure.Figure.align_labels#

Align labels and titles

Align labels and titles