matplotlib 3.5.1

ParametersReturns
get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer, pad=1.08, h_pad=None, w_pad=None, rect=None)

Parameters

fig : Figure
axes_list : list of Axes
subplotspec_list : list of `.SubplotSpec`

The subplotspecs of each axes.

renderer : renderer
pad : float

Padding between the figure edge and the edges of subplots, as a fraction of the font size.

h_pad, w_pad : float

Padding (height/width) between edges of adjacent subplots. Defaults to pad.

rect : tuple[float, float, float, float], optional

(left, bottom, right, top) rectangle in normalized figure coordinates that the whole subplots area (including labels) will fit into. Defaults to using the entire figure.

Returns

subplotspec or None

subplotspec kwargs to be passed to :None:None:`.Figure.subplots_adjust` or None if tight_layout could not be accomplished.

Return subplot parameters for tight-layouted-figure with specified padding.

Examples

See :

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/tight_layout.py#251
type: <class 'function'>
Commit: