Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b08000

Browse files
committed
FIX: allow non bbox_extra_artists calls
1 parent e4ba4f2 commit 5b08000

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/matplotlib/figure.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,9 +2296,15 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
22962296
if bbox is not None and (bbox.width != 0 or bbox.height != 0):
22972297
bb.append(bbox)
22982298

2299-
bb.extend(
2300-
ax.get_tightbbox(renderer, bbox_extra_artists=bbox_extra_artists)
2301-
for ax in self.axes if ax.get_visible())
2299+
for ax in self.axes:
2300+
if ax.get_visible():
2301+
try:
2302+
bbox = ax.get_tightbbox(renderer,
2303+
bbox_extra_artists=bbox_extra_artists)
2304+
except TypeError:
2305+
bbox = ax.get_tightbbox(renderer)
2306+
bb.extend([bbox])
2307+
23022308

23032309
if len(bb) == 0:
23042310
return self.bbox_inches

0 commit comments

Comments
 (0)