matplotlib.axis.Axis.get_tightbbox

Axis.get_tightbbox(self, 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.

Examples using matplotlib.axis.Axis.get_tightbbox

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