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

Method tight_layout

lib/matplotlib/gridspec.py:439–468  ·  view source on GitHub ↗

Adjust subplot parameters to give specified padding. Parameters ---------- figure : `.Figure` The figure. renderer : `.RendererBase` subclass, optional The renderer to be used. pad : float Padding between the figu

(self, figure, renderer=None,
                     pad=1.08, h_pad=None, w_pad=None, rect=None)

Source from the content-addressed store, hash-verified

437 return [k for k in self._AllowedKeys if getattr(self, k)]
438
439 def tight_layout(self, figure, renderer=None,
440 pad=1.08, h_pad=None, w_pad=None, rect=None):
441 """
442 Adjust subplot parameters to give specified padding.
443
444 Parameters
445 ----------
446 figure : `.Figure`
447 The figure.
448 renderer : `.RendererBase` subclass, optional
449 The renderer to be used.
450 pad : float
451 Padding between the figure edge and the edges of subplots, as a
452 fraction of the font-size.
453 h_pad, w_pad : float, optional
454 Padding (height/width) between edges of adjacent subplots.
455 Defaults to *pad*.
456 rect : tuple (left, bottom, right, top), default: None
457 (left, bottom, right, top) rectangle in normalized figure
458 coordinates that the whole subplots area (including labels) will
459 fit into. Default (None) is the whole figure.
460 """
461 if renderer is None:
462 renderer = figure._get_renderer()
463 kwargs = _tight_layout.get_tight_layout_figure(
464 figure, figure.axes,
465 _tight_layout.get_subplotspec_list(figure.axes, grid_spec=self),
466 renderer, pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
467 if kwargs:
468 self.update(**kwargs)
469
470
471class GridSpecFromSubplotSpec(GridSpecBase):

Callers 1

test_tight_layout6Function · 0.95

Calls 2

updateMethod · 0.95
_get_rendererMethod · 0.45

Tested by 1

test_tight_layout6Function · 0.76