diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index f679937bf940..dd5e3fc0908a 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -2329,7 +2329,8 @@ def get_default_bbox_extra_artists(self): if ax.get_visible(): bbox_artists.extend(ax.get_default_bbox_extra_artists()) # we don't want the figure's patch to influence the bbox calculation - bbox_artists.remove(self.patch) + if self.patch in bbox_artists: + bbox_artists.remove(self.patch) return bbox_artists def get_tightbbox(self, renderer, bbox_extra_artists=None):