@@ -287,12 +287,9 @@ def _make_layout_margins(ax, renderer, h_pad, w_pad):
287
287
w_padt = ax ._poslayoutbox .w_pad
288
288
if w_padt is None :
289
289
w_padt = w_pad
290
- ax ._poslayoutbox .edit_left_margin_min (- bbox .x0 +
291
- pos .x0 + w_padt )
292
- ax ._poslayoutbox .edit_right_margin_min (bbox .x1 -
293
- pos .x1 + w_padt )
294
- ax ._poslayoutbox .edit_bottom_margin_min (
295
- - bbox .y0 + pos .y0 + h_padt )
290
+ ax ._poslayoutbox .edit_left_margin_min (- bbox .x0 + pos .x0 + w_padt )
291
+ ax ._poslayoutbox .edit_right_margin_min (bbox .x1 - pos .x1 + w_padt )
292
+ ax ._poslayoutbox .edit_bottom_margin_min (- bbox .y0 + pos .y0 + h_padt )
296
293
ax ._poslayoutbox .edit_top_margin_min (bbox .y1 - pos .y1 + h_padt )
297
294
_log .debug ('left %f' , (- bbox .x0 + pos .x0 + w_pad ))
298
295
_log .debug ('right %f' , (bbox .x1 - pos .x1 + w_pad ))
@@ -309,8 +306,7 @@ def _make_layout_margins(ax, renderer, h_pad, w_pad):
309
306
ax ._layoutbox .constrain_height_min (20 , strength = 'weak' )
310
307
ax ._layoutbox .constrain_width_min (20 , strength = 'weak' )
311
308
ax ._poslayoutbox .constrain_top_margin (0 , strength = 'weak' )
312
- ax ._poslayoutbox .constrain_bottom_margin (0 ,
313
- strength = 'weak' )
309
+ ax ._poslayoutbox .constrain_bottom_margin (0 , strength = 'weak' )
314
310
ax ._poslayoutbox .constrain_right_margin (0 , strength = 'weak' )
315
311
ax ._poslayoutbox .constrain_left_margin (0 , strength = 'weak' )
316
312
@@ -332,12 +328,10 @@ def _align_spines(fig, gs):
332
328
height_ratios = np .ones (nrows )
333
329
334
330
# get axes in this gridspec....
335
- axs = []
336
- for ax in fig .axes :
337
- if (hasattr (ax , 'get_subplotspec' )
338
- and ax ._layoutbox is not None ):
339
- if ax .get_subplotspec ().get_gridspec () == gs :
340
- axs += [ax ]
331
+ axs = [ax for ax in fig .axes
332
+ if (hasattr (ax , 'get_subplotspec' )
333
+ and ax ._layoutbox is not None
334
+ and ax .get_subplotspec ().get_gridspec () == gs )]
341
335
rownummin = np .zeros (len (axs ), dtype = np .int8 )
342
336
rownummax = np .zeros (len (axs ), dtype = np .int8 )
343
337
colnummin = np .zeros (len (axs ), dtype = np .int8 )
@@ -379,15 +373,12 @@ def _align_spines(fig, gs):
379
373
if not alignleft and colnum0min == colnumCmin :
380
374
# we want the _poslayoutboxes to line up on left
381
375
# side of the axes spines...
382
- layoutbox .align ([ax ._poslayoutbox ,
383
- axc ._poslayoutbox ],
376
+ layoutbox .align ([ax ._poslayoutbox , axc ._poslayoutbox ],
384
377
'left' )
385
378
alignleft = True
386
-
387
379
if not alignright and colnum0max == colnumCmax :
388
380
# line up right sides of _poslayoutbox
389
- layoutbox .align ([ax ._poslayoutbox ,
390
- axc ._poslayoutbox ],
381
+ layoutbox .align ([ax ._poslayoutbox , axc ._poslayoutbox ],
391
382
'right' )
392
383
alignright = True
393
384
# Vertically align axes spines if they have the
@@ -398,7 +389,6 @@ def _align_spines(fig, gs):
398
389
layoutbox .align ([ax ._poslayoutbox , axc ._poslayoutbox ],
399
390
'top' )
400
391
aligntop = True
401
-
402
392
if not alignbot and rownum0max == rownumCmax :
403
393
# line up bottom of _poslayoutbox
404
394
_log .debug ('rownum0max == rownumCmax' )
0 commit comments