@@ -4391,29 +4391,26 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
4391
4391
4392
4392
return _bbox
4393
4393
4394
- def _make_twin_axes (self , * kl , ** kwargs ):
4395
- """
4396
- Make a twinx axes of self. This is used for twinx and twiny.
4397
- """
4394
+ def _make_twin_axes (self , * args , ** kwargs ):
4395
+ """Make a twinx axes of self. This is used for twinx and twiny."""
4398
4396
# Typically, SubplotBase._make_twin_axes is called instead of this.
4399
- # There is also an override in axes_grid1/axes_divider.py.
4400
4397
if 'sharex' in kwargs and 'sharey' in kwargs :
4401
- raise ValueError ("Twinned Axes may share only one axis. " )
4402
- ax2 = self .figure .add_axes (self .get_position (True ), * kl , ** kwargs )
4398
+ raise ValueError ("Twinned Axes may share only one axis" )
4399
+ ax2 = self .figure .add_axes (self .get_position (True ), * args , ** kwargs )
4403
4400
self .set_adjustable ('datalim' )
4404
4401
ax2 .set_adjustable ('datalim' )
4405
4402
self ._twinned_axes .join (self , ax2 )
4406
4403
return ax2
4407
4404
4408
4405
def twinx (self ):
4409
4406
"""
4410
- Create a twin Axes sharing the xaxis
4407
+ Create a twin Axes sharing the xaxis.
4411
4408
4412
- Create a new Axes instance with an invisible x-axis and an independent
4409
+ Create a new Axes with an invisible x-axis and an independent
4413
4410
y-axis positioned opposite to the original one (i.e. at right). The
4414
- x-axis autoscale setting will be inherited from the original Axes.
4415
- To ensure that the tick marks of both y-axes align, see
4416
- `~matplotlib.ticker.LinearLocator`
4411
+ x-axis autoscale setting will be inherited from the original
4412
+ Axes. To ensure that the tick marks of both y-axes align, see
4413
+ `~matplotlib.ticker.LinearLocator`.
4417
4414
4418
4415
Returns
4419
4416
-------
@@ -4437,13 +4434,13 @@ def twinx(self):
4437
4434
4438
4435
def twiny (self ):
4439
4436
"""
4440
- Create a twin Axes sharing the yaxis
4437
+ Create a twin Axes sharing the yaxis.
4441
4438
4442
- Create a new Axes instance with an invisible y-axis and an independent
4439
+ Create a new Axes with an invisible y-axis and an independent
4443
4440
x-axis positioned opposite to the original one (i.e. at top). The
4444
4441
y-axis autoscale setting will be inherited from the original Axes.
4445
4442
To ensure that the tick marks of both x-axes align, see
4446
- `~matplotlib.ticker.LinearLocator`
4443
+ `~matplotlib.ticker.LinearLocator`.
4447
4444
4448
4445
Returns
4449
4446
-------
@@ -4455,7 +4452,6 @@ def twiny(self):
4455
4452
For those who are 'picking' artists while using twiny, pick
4456
4453
events are only called for the artists in the top-most axes.
4457
4454
"""
4458
-
4459
4455
ax2 = self ._make_twin_axes (sharey = self )
4460
4456
ax2 .xaxis .tick_top ()
4461
4457
ax2 .xaxis .set_label_position ('top' )
0 commit comments