matplotlib 3.5.1

ParametersReturnsBackRef
get_tightbbox(self, renderer, call_axes_locator=True, bbox_extra_artists=None, *, for_layout_only=False)

Artists that have artist.set_in_layout(False) are not included in the bbox.

Parameters

renderer : `.RendererBase` subclass

renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer() )

bbox_extra_artists : list of `.Artist` or ``None``

List of artists to include in the tight bounding box. If None (default), then all artist children of the Axes are included in the tight bounding box.

call_axes_locator : bool, default: True

If call_axes_locator is False , it does not call the _axes_locator attribute, which is necessary to get the correct bounding box. call_axes_locator=False can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox.

for_layout_only : default: False

The bounding box will not include the x-extent of the title and the xlabel, or the y-extent of the ylabel.

Returns

`.BboxBase`

Bounding box in figure pixel coordinates.

Return the tight bounding box of the axes, including axis and their decorators (xlabel, title, etc).

See Also

matplotlib.axes.Axes.get_window_extent
matplotlib.axis.Axis.get_tightbbox
matplotlib.spines.Spine.get_window_extent

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.axes._base._AxesBase.get_window_extent

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/axes/_base.py#4561
type: <class 'function'>
Commit: