W3cubDocs

/Matplotlib 3.5

matplotlib.axis.Axis.get_tightbbox

Axis.get_tightbbox(renderer, *, for_layout_only=False)[source]

Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.

If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.

© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.axis.Axis.get_tightbbox.html