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

Method execute

lib/matplotlib/layout_engine.py:168–193  ·  view source on GitHub ↗

Execute tight_layout. This decides the subplot parameters given the padding that will allow the Axes labels to not be covered by other labels and Axes. Parameters ---------- fig : `.Figure` to perform layout on. See Also ---

(self, fig)

Source from the content-addressed store, hash-verified

166 self.set(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
167
168 def execute(self, fig):
169 """
170 Execute tight_layout.
171
172 This decides the subplot parameters given the padding that
173 will allow the Axes labels to not be covered by other labels
174 and Axes.
175
176 Parameters
177 ----------
178 fig : `.Figure` to perform layout on.
179
180 See Also
181 --------
182 .figure.Figure.tight_layout
183 .pyplot.tight_layout
184 """
185 info = self._params
186 renderer = fig._get_renderer()
187 with getattr(renderer, "_draw_disabled", nullcontext)():
188 kwargs = get_tight_layout_figure(
189 fig, fig.axes, get_subplotspec_list(fig.axes), renderer,
190 pad=info['pad'], h_pad=info['h_pad'], w_pad=info['w_pad'],
191 rect=info['rect'])
192 if kwargs:
193 fig.subplots_adjust(**kwargs)
194
195 def set(self, *, pad=None, w_pad=None, h_pad=None, rect=None):
196 """

Callers 1

tight_layoutMethod · 0.95

Calls 4

get_tight_layout_figureFunction · 0.90
get_subplotspec_listFunction · 0.90
subplots_adjustMethod · 0.80
_get_rendererMethod · 0.45

Tested by

no test coverage detected