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

Method set_constrained_layout_pads

lib/matplotlib/figure.py:2945–2974  ·  view source on GitHub ↗

Set padding for ``constrained_layout``. Tip: The parameters can be passed from a dictionary by using ``fig.set_constrained_layout(**pad_dict)``. See :ref:`constrainedlayout_guide`. Parameters ---------- w_pad : float, default: :rc:`figure.c

(self, **kwargs)

Source from the content-addressed store, hash-verified

2943 "3.6", alternative="figure.get_layout_engine().set()",
2944 pending=True)
2945 def set_constrained_layout_pads(self, **kwargs):
2946 """
2947 Set padding for ``constrained_layout``.
2948
2949 Tip: The parameters can be passed from a dictionary by using
2950 ``fig.set_constrained_layout(**pad_dict)``.
2951
2952 See :ref:`constrainedlayout_guide`.
2953
2954 Parameters
2955 ----------
2956 w_pad : float, default: :rc:`figure.constrained_layout.w_pad`
2957 Width padding in inches. This is the pad around Axes
2958 and is meant to make sure there is enough room for fonts to
2959 look good. Defaults to 3 pts = 0.04167 inches
2960
2961 h_pad : float, default: :rc:`figure.constrained_layout.h_pad`
2962 Height padding in inches. Defaults to 3 pts.
2963
2964 wspace : float, default: :rc:`figure.constrained_layout.wspace`
2965 Width padding between subplots, expressed as a fraction of the
2966 subplot width. The total padding ends up being w_pad + wspace.
2967
2968 hspace : float, default: :rc:`figure.constrained_layout.hspace`
2969 Height padding between subplots, expressed as a fraction of the
2970 subplot width. The total padding ends up being h_pad + hspace.
2971
2972 """
2973 if isinstance(self.get_layout_engine(), ConstrainedLayoutEngine):
2974 self.get_layout_engine().set(**kwargs)
2975
2976 @_api.deprecated("3.6", alternative="fig.get_layout_engine().get()",
2977 pending=True)

Callers

nothing calls this directly

Calls 2

get_layout_engineMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected