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)
| 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 | |
| 471 | class GridSpecFromSubplotSpec(GridSpecBase): |