@@ -3904,16 +3904,16 @@ def twinx(self):
3904
3904
"""
3905
3905
Create a twin Axes sharing the xaxis
3906
3906
3907
- Create a twin of Axes for generating a plot with a shared
3908
- x -axis but independent y-axis. The y-axis of self will have
3909
- ticks on left and the returned axes will have ticks on the
3910
- right. To ensure tick marks of both axis align, see
3907
+ Create a new Axes instance with an invisible x-axis and an independent
3908
+ y -axis positioned opposite to the original one (i.e. at right). The
3909
+ x-axis autoscale setting will be inherited from the original Axes.
3910
+ To ensure that the tick marks of both y-axes align, see
3911
3911
`~matplotlib.ticker.LinearLocator`
3912
3912
3913
3913
Returns
3914
3914
-------
3915
- Axis
3916
- The newly created axis
3915
+ ax_twin : Axes
3916
+ The newly created Axes instance
3917
3917
3918
3918
Notes
3919
3919
-----
@@ -3924,6 +3924,7 @@ def twinx(self):
3924
3924
ax2 .yaxis .tick_right ()
3925
3925
ax2 .yaxis .set_label_position ('right' )
3926
3926
ax2 .yaxis .set_offset_position ('right' )
3927
+ ax2 .set_autoscalex_on (self .get_autoscalex_on ())
3927
3928
self .yaxis .tick_left ()
3928
3929
ax2 .xaxis .set_visible (False )
3929
3930
ax2 .patch .set_visible (False )
@@ -3933,25 +3934,26 @@ def twiny(self):
3933
3934
"""
3934
3935
Create a twin Axes sharing the yaxis
3935
3936
3936
- Create a twin of Axes for generating a plot with a shared
3937
- y-axis but independent x-axis. The x-axis of self will have
3938
- ticks on bottom and the returned axes will have ticks on the
3939
- top.
3937
+ Create a new Axes instance with an invisible y-axis and an independent
3938
+ x-axis positioned opposite to the original one (i.e. at top). The
3939
+ y-axis autoscale setting will be inherited from the original Axes.
3940
+ To ensure that the tick marks of both x-axes align, see
3941
+ `~matplotlib.ticker.LinearLocator`
3940
3942
3941
3943
Returns
3942
3944
-------
3943
- Axis
3944
- The newly created axis
3945
+ ax_twin : Axes
3946
+ The newly created Axes instance
3945
3947
3946
3948
Notes
3947
- ------
3949
+ -----
3948
3950
For those who are 'picking' artists while using twiny, pick
3949
3951
events are only called for the artists in the top-most axes.
3950
3952
"""
3951
-
3952
3953
ax2 = self ._make_twin_axes (sharey = self )
3953
3954
ax2 .xaxis .tick_top ()
3954
3955
ax2 .xaxis .set_label_position ('top' )
3956
+ ax2 .set_autoscaley_on (self .get_autoscaley_on ())
3955
3957
self .xaxis .tick_bottom ()
3956
3958
ax2 .yaxis .set_visible (False )
3957
3959
ax2 .patch .set_visible (False )
0 commit comments