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

Method set_constrained_layout

lib/matplotlib/figure.py:2921–2940  ·  view source on GitHub ↗

Set whether ``constrained_layout`` is used upon drawing. If None, :rc:`figure.constrained_layout.use` value will be used. When providing a dict containing the keys ``w_pad``, ``h_pad`` the default ``constrained_layout`` paddings will be overridden. These p

(self, constrained)

Source from the content-addressed store, hash-verified

2919 @_api.deprecated("3.6", alternative="set_layout_engine('constrained')",
2920 pending=True)
2921 def set_constrained_layout(self, constrained):
2922 """
2923 Set whether ``constrained_layout`` is used upon drawing.
2924
2925 If None, :rc:`figure.constrained_layout.use` value will be used.
2926
2927 When providing a dict containing the keys ``w_pad``, ``h_pad``
2928 the default ``constrained_layout`` paddings will be
2929 overridden. These pads are in inches and default to 3.0/72.0.
2930 ``w_pad`` is the width padding and ``h_pad`` is the height padding.
2931
2932 Parameters
2933 ----------
2934 constrained : bool or dict or None
2935 """
2936 constrained = mpl._val_or_rc(constrained, 'figure.constrained_layout.use')
2937 _constrained = 'constrained' if bool(constrained) else 'none'
2938 _parameters = constrained if isinstance(constrained, dict) else {}
2939 self.set_layout_engine(_constrained, **_parameters)
2940 self.stale = True
2941
2942 @_api.deprecated(
2943 "3.6", alternative="figure.get_layout_engine().set()",

Callers 2

test_discouraged_apiFunction · 0.80
test_constrained_toggleFunction · 0.80

Calls 1

set_layout_engineMethod · 0.95

Tested by 2

test_discouraged_apiFunction · 0.64
test_constrained_toggleFunction · 0.64