Skip to content

Commit 9cbed9e

Browse files
committed
FIX: also exclued spines tight layout
1 parent c4a1155 commit 9cbed9e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4162,7 +4162,18 @@ def get_default_bbox_extra_artists(self):
41624162
Artists are excluded either by not being visible or
41634163
``artist.set_in_layout(False)``.
41644164
"""
4165-
return [artist for artist in self.get_children()
4165+
4166+
artists = self.get_children()
4167+
if not (self.axison and self._frameon):
4168+
# don't do bbox on spines if frame not on.
4169+
for spine in self.spines.values():
4170+
artists.remove(spine)
4171+
4172+
if not self.axison:
4173+
for _axis in self._get_axis_list():
4174+
artists.remove(_axis)
4175+
4176+
return [artist for artist in artists
41664177
if (artist.get_visible() and artist.get_in_layout())]
41674178

41684179
def get_tightbbox(self, renderer, call_axes_locator=True,

0 commit comments

Comments
 (0)