From 51c782e177b8162a5ae2e4ec68c497e13a3a505a Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 1 Mar 2018 13:45:32 -0800 Subject: [PATCH] Fix extra and missing spaces in constrainedlayout warning. (Too many spaces between "layout." and "You", missing betwen "subplots" and "with".) --- lib/matplotlib/figure.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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