8000 Fix extra and missing spaces in constrainedlayout warning. by anntzer · Pull Request #10640 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix extra and missing spaces in constrainedlayout warning. #10640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
0