@@ -4600,7 +4600,7 @@ def _make_twin_axes(self, *args, **kwargs):
4600
4600
self ._twinned_axes .join (self , twin )
4601
4601
return twin
4602
4602
4603
- def twinx (self ):
4603
+ def twinx (self , ** kwargs ):
4604
4604
"""
4605
4605
Create a twin Axes sharing the xaxis.
4606
4606
@@ -4610,6 +4610,11 @@ def twinx(self):
4610
4610
Axes. To ensure that the tick marks of both y-axes align, see
4611
4611
`~matplotlib.ticker.LinearLocator`.
4612
4612
4613
+ Parameters
4614
+ ----------
4615
+ kwargs : dict
4616
+ The keyword arguments passed to ``add_subplot()`` or ``add_axes()``.
4617
+
4613
4618
Returns
4614
4619
-------
4615
4620
Axes
@@ -4620,7 +4625,7 @@ def twinx(self):
4620
4625
For those who are 'picking' artists while using twinx, pick
4621
4626
events are only called for the artists in the top-most Axes.
4622
4627
"""
4623
- ax2 = self ._make_twin_axes (sharex = self )
4628
+ ax2 = self ._make_twin_axes (sharex = self , axes_class = type ( self ), ** kwargs )
4624
4629
ax2 .yaxis .tick_right ()
4625
4630
ax2 .yaxis .set_label_position ('right' )
4626
4631
ax2 .yaxis .set_offset_position ('right' )
@@ -4631,7 +4636,7 @@ def twinx(self):
4631
4636
ax2 .xaxis .units = self .xaxis .units
4632
4637
return ax2
4633
4638
4634
- def twiny (self ):
4639
+ def twiny (self , ** kwargs ):
4635
4640
"""
4636
4641
Create a twin Axes sharing the yaxis.
4637
4642
@@ -4641,6 +4646,11 @@ def twiny(self):
4641
4646
To ensure that the tick marks of both x-axes align, see
4642
4647
`~matplotlib.ticker.LinearLocator`.
4643
4648
4649
+ Parameters
4650
+ ----------
4651
+ kwargs : dict
4652
+ The keyword arguments passed to ``add_subplot()`` or ``add_axes()``.
4653
+
4644
4654
Returns
4645
4655
-------
4646
4656
Axes
@@ -4651,7 +4661,7 @@ def twiny(self):
4651
4661
For those who are 'picking' artists while using twiny, pick
4652
4662
events are only called for the artists in the top-most Axes.
4653
4663
"""
4654
- ax2 = self ._make_twin_axes (sharey = self )
4664
+ ax2 = self ._make_twin_axes (sharey = self , axes_class = type ( self ), ** kwargs )
4655
4665
ax2 .xaxis .tick_top ()
4656
4666
ax2 .xaxis .set_label_position ('top' )
4657
4667
ax2 .set_autoscaley_on (self .get_autoscaley_on ())
0 commit comments