mpl.tight_layout

This module provides routines to adjust subplot params so that subplots are nicely fit in the figure. In doing so, only axis labels, tick labels, axes titles and offsetboxes that are anchored to axes are currently considered.

Internally, it assumes that the margins (left_margin, etc.) which are differences between ax.get_tightbbox and ax.bbox are independent of axes position. This may fail if Axes.adjustable is datalim. Also, This will fail for some cases (for example, left or right margin is affected by xlabel).

Functions

auto_adjust_subplotpars(fig, renderer, ...) Return a dictionary of subplot parameters so that spacing between subplots are adjusted.
get_renderer(fig)
get_subplotspec_list(axes_list[, grid_spec]) Return a list of subplotspec from the given list of axes.
get_tight_layout_figure(fig, axes_list, ...) Return subplot parameters for tight-layouted-figure with specified padding.

Classes

Bbox(points, **kwargs) A mutable bounding box.
FontProperties([family, style, variant, ...]) A class for storing and manipulating font properties.
TransformedBbox(bbox, transform, **kwargs) A Bbox that is automatically transformed by a given transform.