@@ -2195,7 +2195,7 @@ def get_tightbbox(self, renderer):
2195
2195
2196
2196
def init_layoutbox (self ):
2197
2197
"""
2198
- initilaize the layoutbox for use in constrained_layout.
2198
+ Initialize the layoutbox for use in constrained_layout.
2199
2199
"""
2200
2200
if self ._layoutbox is None :
2201
2201
self ._layoutbox = layoutbox .LayoutBox (parent = None ,
@@ -2207,23 +2207,21 @@ def execute_constrained_layout(self, renderer=None):
2207
2207
"""
2208
2208
Use ``layoutbox`` to determine pos positions within axes.
2209
2209
2210
- See also set_constrained_layout_pads
2210
+ See also set_constrained_layout_pads.
2211
2211
"""
2212
2212
2213
- from matplotlib ._constrained_layout import ( do_constrained_layout )
2213
+ from matplotlib ._constrained_layout import do_constrained_layout
2214
2214
2215
2215
_log .debug ('Executing constrainedlayout' )
2216
2216
if self ._layoutbox is None :
2217
- warnings .warn ("Calling figure.constrained_layout, but figure "
2218
- "not setup to do constrained layout. "
2219
- " You either called GridSpec without the "
2220
- "fig keyword, you are using plt.subplot, "
2221
- "or you need to call figure or subplots"
2222
- "with the constrained_layout=True kwarg." )
2217
+ warnings .warn ("Calling figure.constrained_layout, but figure not "
2218
+ "setup to do constrained layout. You either called "
2219
+ "GridSpec without the fig keyword, you are using "
2220
+ "plt.subplot, or you need to call figure or "
2221
+ "subplots with the constrained_layout=True kwarg." )
2223
2222
return
2224
2223
w_pad , h_pad , wspace , hspace = self .get_constrained_layout_pads ()
2225
2224
# convert to unit-relative lengths
2226
-
2227
2225
fig = self
2228
2226
width , height = fig .get_size_inches ()
2229
2227
w_pad = w_pad / width
0 commit comments