@@ -150,12 +150,11 @@ def _check_no_collapsed_axes(fig):
150150 return True
151151
152152
153- def _get_margin_from_padding (object , * , w_pad = 0 , h_pad = 0 ,
153+ def _get_margin_from_padding (obj , * , w_pad = 0 , h_pad = 0 ,
154154 hspace = 0 , wspace = 0 ):
155155
156- ss = object ._subplotspec
156+ ss = obj ._subplotspec
157157 gs = ss .get_gridspec ()
158- lg = gs ._layoutgrid
159158
160159 if hasattr (gs , 'hspace' ):
161160 _hspace = (gs .hspace if gs .hspace is not None else hspace )
@@ -220,7 +219,6 @@ def _make_layout_margins(fig, renderer, *, w_pad=0, h_pad=0,
220219
221220 margin = _get_margin_from_padding (ax , w_pad = w_pad , h_pad = h_pad ,
222221 hspace = hspace , wspace = wspace )
223- margin0 = margin .copy ()
224222 pos , bbox = _get_pos_and_bbox (ax , renderer )
225223 # the margin is the distance between the bounding box of the axes
226224 # and its position (plus the padding from above)
@@ -488,9 +486,6 @@ def _reposition_axes(fig, renderer, *, w_pad=0, h_pad=0, hspace=0, wspace=0):
488486
489487 bbox = gs ._layoutgrid .get_inner_bbox (rows = ss .rowspan , cols = ss .colspan )
490488
491- bboxouter = gs ._layoutgrid .get_outer_bbox (rows = ss .rowspan ,
492- cols = ss .colspan )
493-
494489 # transform from figure to panel for set_position:
495490 newbbox = trans_fig_to_subfig .transform_bbox (bbox )
496491 ax ._set_position (newbbox )
@@ -501,8 +496,7 @@ def _reposition_axes(fig, renderer, *, w_pad=0, h_pad=0, hspace=0, wspace=0):
501496 offset = {'left' : 0 , 'right' : 0 , 'bottom' : 0 , 'top' : 0 }
502497 for nn , cbax in enumerate (ax ._colorbars [::- 1 ]):
503498 if ax == cbax ._colorbar_info ['parents' ][0 ]:
504- margin = _reposition_colorbar (
505- cbax , renderer , offset = offset )
499+ _reposition_colorbar (cbax , renderer , offset = offset )
506500
507501
508502def _reposition_colorbar (cbax , renderer , * , offset = None ):
@@ -527,7 +521,6 @@ def _reposition_colorbar(cbax, renderer, *, offset=None):
527521
528522 parents = cbax ._colorbar_info ['parents' ]
529523 gs = parents [0 ].get_gridspec ()
530- ncols , nrows = gs .ncols , gs .nrows
531524 fig = cbax .figure
532525 trans_fig_to_subfig = fig .transFigure - fig .transSubfigure
533526
0 commit comments