@@ -278,8 +278,14 @@ def __init__(self, parent, userax=True):
278
278
self .outer_ax .tick_params = self .inner_ax .tick_params
279
279
self .outer_ax .set_xticks = self .inner_ax .set_xticks
280
280
self .outer_ax .set_yticks = self .inner_ax .set_yticks
281
- for attr in ["get_position" , "set_position" , "set_aspect" ]:
281
+ for attr in ["get_position" , "set_aspect" ,
282
+ "_remove_method" , "_set_position" ,
283
+ "set_position" ]:
282
284
setattr (self , attr , getattr (self .outer_ax , attr ))
285
+ if hasattr (self .outer_ax , "get_subplotspec" ):
286
+ attr = "get_subplotspec"
287
+ setattr (self , attr , getattr (self .outer_ax , attr ))
288
+
283
289
if userax :
284
290
# point the parent's methods all at this axes...
285
291
parent .__dict__ = self .__dict__
@@ -295,6 +301,7 @@ def draw(self, renderer):
295
301
self .outer_ax .draw (renderer )
296
302
297
303
304
+
298
305
class _ColorbarSpine (mspines .Spine ):
299
306
def __init__ (self , axes ):
300
307
self ._ax = axes
@@ -883,8 +890,7 @@ def set_alpha(self, alpha):
883
890
884
891
def remove (self ):
885
892
"""Remove this colorbar from the figure."""
886
- self .ax .inner_ax .remove ()
887
- self .ax .outer_ax .remove ()
893
+ self .ax .remove ()
888
894
889
895
def _ticker (self , locator , formatter ):
890
896
"""
0 commit comments