diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index b1b803fafc60..7d72a291d949 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2195,7 +2195,7 @@ def get_tightbbox(self, renderer): def init_layoutbox(self): """ - initilaize the layoutbox for use in constrained_layout. + Initialize the layoutbox for use in constrained_layout. """ if self._layoutbox is None: self._layoutbox = layoutbox.LayoutBox(parent=None, @@ -2207,23 +2207,21 @@ def execute_constrained_layout(self, renderer=None): """ Use ``layoutbox`` to determine pos positions within axes. - See also set_constrained_layout_pads + See also set_constrained_layout_pads. """ - from matplotlib._constrained_layout import (do_constrained_layout) + from matplotlib._constrained_layout import do_constrained_layout _log.debug('Executing constrainedlayout') if self._layoutbox is None: - warnings.warn("Calling figure.constrained_layout, but figure " - "not setup to do constrained layout. " - " You either called GridSpec without the " - "fig keyword, you are using plt.subplot, " - "or you need to call figure or subplots" - "with the constrained_layout=True kwarg.") + warnings.warn("Calling figure.constrained_layout, but figure not " + "setup to do constrained layout. You either called " + "GridSpec without the fig keyword, you are using " + "plt.subplot, or you need to call figure or " + "subplots with the constrained_layout=True kwarg.") return w_pad, h_pad, wspace, hspace = self.get_constrained_layout_pads() # convert to unit-relative lengths - fig = self width, height = fig.get_size_inches() w_pad = w_pad / width