matplotlib.axes.Axes.get_tightbbox#
- Axes.get_tightbbox(renderer=None, *, call_axes_locator=True, bbox_extra_artists=None, for_layout_only=False)[源码]#
返回 Axes 的紧密边界框,包括轴及其装饰器(xlabel、标题等)。
具有
artist.set_in_layout(False)
的艺术家对象不会包含在边界框中。- 参数:
- renderer
RendererBase
子类 用于绘制图形的渲染器(即
fig.canvas.get_renderer()
)- bbox_extra_artists
Artist
列表或None
要包含在紧密边界框中的艺术家对象列表。如果为
None
(默认),则 Axes 的所有艺术家子对象都将包含在紧密边界框中。- call_axes_locator布尔值, 默认值: True
如果 call_axes_locator 为
False
,则不调用_axes_locator
属性,该属性是获取正确边界框所必需的。call_axes_locator=False
可用于调用者只关心紧密边界框相对于 Axes 边界框的相对大小时。- for_layout_only默认值: False
边界框将 不 包含标题和 x 轴标签的 x 范围,或 y 轴标签的 y 范围。
- renderer
- 返回:
BboxBase
图形像素坐标中的边界框。