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

Skip to content

Commit 23b51bf

Browse files
authored
Merge pull request #26899 from rcomer/tight_bbox-redundancy
MNT: only account for Artists once in fig.get_tightbbox
2 parents 401d7ce + 1c054c4 commit 23b51bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/figure.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,9 @@ def get_tightbbox(self, renderer=None, bbox_extra_artists=None):
17101710

17111711
bb = []
17121712
if bbox_extra_artists is None:
1713-
artists = self.get_default_bbox_extra_artists()
1713+
artists = [artist for artist in self.get_children()
1714+
if (artist not in self.axes and artist.get_visible()
1715+
and artist.get_in_layout())]
17141716
else:
17151717
artists = bbox_extra_artists
17161718

0 commit comments

Comments
 (0)