atompy.get_axes_tightbbox_inch#
- atompy.get_axes_tightbbox_inch(ax=None, renderer=None)[source]#
Get bounding box of ax including labels in inches.
Wrapper function for
matplotlib.axes.Axes.get_tightbbox()which converts it to inches.- Parameters:
- ax
matplotlib.axes.Axes, optional If
None, use last active axes.- renderer
matplotlib.backend_bases.RendererBase, optional The renderer used to draw the figure.
Generally not necessary to pass it. If, however, you use a backend that takes a long time to render (e.g., a LuaLaTeX pgf backend), it may increase performance by passing the renderer. Use
get_renderer()to get your current renderer.
- ax
- Returns:
- bbox
matplotlib.transforms.Bbox The bounding box of ax including x/ylabels, titles, etc, in inches.
Useful members:
bbox.x0,bbox.x1Location of the left and right edge in inches. Negative values are left of the figure left edge.
bbox.y0,bbox.y1Lower and upper edge in inches. Negative values are below the figure bottom edge.
bbox.width,bbox.heightWidth and height of the ax, including labels, titles, etc.
- bbox
Notes
This ignores text elements added to ax. In particular, this means if you used
add_abc()to add labels outside of the graph-area of ax, the dimensions returned byget_axes_tightbbox_inchwill not include those.