@@ -3902,18 +3902,18 @@ def _make_twin_axes(self, *kl, **kwargs):
3902
3902
3903
3903
def twinx (self ):
3904
3904
"""
3905
- Create a twin Axes sharing the xaxis
3905
+ Create a twin Axes instance sharing the x-axis with self
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
3911
- `~matplotlib.ticker.LinearLocator`
3907
+ Create a twin Axes instance for generating a plot with a shared
3908
+ x-axis but independent y-axis. The y-ticks on the returned Axes will
3909
+ be on the right, opposite those of the original Axes. The x-axis
3910
+ autoscale setting will be inherited from the parent Axes. To ensure
3911
+ tick marks of both axis align, see `~matplotlib.ticker.LinearLocator`
3912
3912
3913
3913
Returns
3914
3914
-------
3915
- Axis
3916
- The newly created axis
3915
+ Axes
3916
+ The newly created Axes instance
3917
3917
3918
3918
Notes
3919
3919
-----
@@ -3924,34 +3924,36 @@ 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 )
3930
3931
return ax2
3931
3932
3932
3933
def twiny (self ):
3933
3934
"""
3934
- Create a twin Axes sharing the yaxis
3935
+ Create a twin Axes instance sharing the y-axis with self
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 twin Axes instance for generating a plot with a shared
3938
+ y-axis but independent x-axis. The x-ticks on the returned Axes will
3939
+ be on the top, opposite those of the original Axes. The y-axis
3940
+ autoscale setting will be inherited from the parent Axes. To ensure
3941
+ tick marks of both axis align, see `~matplotlib.ticker.LinearLocator`
3940
3942
3941
3943
Returns
3942
3944
-------
3943
- Axis
3944
- The newly created axis
3945
+ 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