MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / reset_margins

Function reset_margins

lib/matplotlib/_constrained_layout.py:795–809  ·  view source on GitHub ↗

Reset the margins in the layoutboxes of *fig*. Margins are usually set as a minimum, so if the figure gets smaller the minimum needs to be zero in order for it to grow again.

(layoutgrids, fig)

Source from the content-addressed store, hash-verified

793
794
795def reset_margins(layoutgrids, fig):
796 """
797 Reset the margins in the layoutboxes of *fig*.
798
799 Margins are usually set as a minimum, so if the figure gets smaller
800 the minimum needs to be zero in order for it to grow again.
801 """
802 for sfig in fig.subfigs:
803 reset_margins(layoutgrids, sfig)
804 for ax in fig.axes:
805 if ax.get_in_layout():
806 gs = ax.get_gridspec()
807 if gs in layoutgrids: # also implies gs is not None.
808 layoutgrids[gs].reset_margins()
809 layoutgrids[fig].reset_margins()
810
811
812def colorbar_get_pad(layoutgrids, cax):

Callers 1

do_constrained_layoutFunction · 0.85

Calls 3

get_in_layoutMethod · 0.80
reset_marginsMethod · 0.80
get_gridspecMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…