File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -4162,7 +4162,18 @@ def get_default_bbox_extra_artists(self):
4162
4162
Artists are excluded either by not being visible or
4163
4163
``artist.set_in_layout(False)``.
4164
4164
"""
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
4166
4177
if (artist .get_visible () and artist .get_in_layout ())]
4167
4178
4168
4179
def get_tightbbox (self , renderer , call_axes_locator = True ,
Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ def __init__(
126
126
127
127
self .figure .add_axes (self )
128
128
129
+ # mplot3d currently manages its own spines and needs these turned off
130
+ # for bounding box calculations
131
+ for k in self .spines .keys ():
132
+ self .spines [k ].set_visible (False )
133
+
129
134
def set_axis_off (self ):
130
135
self ._axis3don = False
131
136
self .stale = True
You can’t perform that action at this time.
0 commit comments