@@ -4363,7 +4363,6 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
4363
4363
matplotlib.axes.Axes.get_window_extent
4364
4364
matplotlib.axis.Axis.get_tightbbox
4365
4365
matplotlib.spines.Spine.get_window_extent
4366
-
4367
4366
"""
4368
4367
4369
4368
bb = []
@@ -4388,18 +4387,13 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
4388
4387
bb .append (bb_yaxis )
4389
4388
4390
4389
self ._update_title_position (renderer )
4390
+
4391
4391
axbbox = self .get_window_extent (renderer )
4392
4392
bb .append (axbbox )
4393
4393
4394
- self ._update_title_position (renderer )
4395
- if self .title .get_visible ():
4396
- bb .append (self .title .get_window_extent (renderer ))
4397
- if self ._left_title .get_visible ():
4398
- bb .append (self ._left_title .get_window_extent (renderer ))
4399
- if self ._right_title .get_visible ():
4400
- bb .append (self ._right_title .get_window_extent (renderer ))
4401
-
4402
- bb .append (self .get_window_extent (renderer ))
4394
+ for title in [self .title , self ._left_title , self ._right_title ]:
4395
+ if title .get_visible ():
4396
+ bb .append (title .get_window_extent (renderer ))
4403
4397
4404
4398
bbox_artists = bbox_extra_artists
4405
4399
if bbox_artists is None :
@@ -4422,10 +4416,9 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
4422
4416
and 0 < bbox .width < np .inf
4423
4417
and 0 < bbox .height < np .inf ):
4424
4418
bb .append (bbox )
4425
- _bbox = mtransforms .Bbox .union (
4426
- [b for b in bb if b .width != 0 or b .height != 0 ])
4427
4419
4428
- return _bbox
4420
+ return mtransforms .Bbox .union (
4421
+ [b for b in bb if b .width != 0 or b .height != 0 ])
4429
4422
4430
4423
def _make_twin_axes (self , * args , ** kwargs ):
4431
4424
"""Make a twinx axes of self. This is used for twinx and twiny."""
0 commit comments