Only show "outer" labels and tick labels.
x-labels are only kept for subplots on the last row (or first row, if labels are on the top side); y-labels only for subplots on the first column (or last column, if labels are on the right side).
If True, remove the inner ticks as well (not only tick labels).
Added in version 3.8.
matplotlib.axes.Axes.label_outer
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.label_outer.html