matplotlib 3.5.1

match_submerged_margins(layoutgrids, fig)

This allows axes that span two columns (or rows) that are offset from one another to have the same size.

This gives the proper layout for something like fig = plt.figure(constrained_layout=True)

axs = fig.subplot_mosaic("AAAB

CCDD")

Without this routine, the axes D will be wider than C, because the margin width between the two columns in C has no width by default, whereas the margins between the two columns of D are set by the width of the margin between A and B. However, obviously the user would like C and D to be the same size, so we need to add constraints to these "submerged" margins.

This routine makes all the interior margins the same, and the spacing between the three columns in A and the two column in C are all set to the margins between the two columns of D.

See test_constrained_layout::test_constrained_layout12 for an example.

Make the margins that are submerged inside an Axes the same size.

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