@@ -4621,7 +4621,9 @@ def twinx(self, **kwargs):
4621
4621
For those who are 'picking' artists while using twinx, pick
4622
4622
events are only called for the artists in the top-most Axes.
4623
4623
"""
4624
- ax2 = self ._make_twin_axes (sharex = self , axes_class = type (self ), ** kwargs )
4624
+ if not {"projection" , "polar" , "axes_class" }.intersection (kwargs ):
4625
+ kwargs ["axes_class" ] = type (self )
4626
+ ax2 = self ._make_twin_axes (sharex = self , ** kwargs )
4625
4627
ax2 .yaxis .tick_right ()
4626
4628
ax2 .yaxis .set_label_position ('right' )
4627
4629
ax2 .yaxis .set_offset_position ('right' )
@@ -4657,7 +4659,9 @@ def twiny(self, **kwargs):
4657
4659
For those who are 'picking' artists while using twiny, pick
4658
4660
events are only called for the artists in the top-most Axes.
4659
4661
"""
4660
- ax2 = self ._make_twin_axes (sharey = self , axes_class = type (self ), ** kwargs )
4662
+ if not {"projection" , "polar" , "axes_class" }.intersection (kwargs ):
4663
+ kwargs ["axes_class" ] = type (self )
4664
+ ax2 = self ._make_twin_axes (sharey = self , ** kwargs )
4661
4665
ax2 .xaxis .tick_top ()
4662
4666
ax2 .xaxis .set_label_position ('top' )
4663
4667
ax2 .set_autoscaley_on (self .get_autoscaley_on ())
0 commit comments