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)
| 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 | """ |
no test coverage detected