@@ -4391,29 +4391,26 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
43914391
43924392 return _bbox
43934393
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."""
43984396 # Typically, SubplotBase._make_twin_axes is called instead of this.
4399- # There is also an override in axes_grid1/axes_divider.py.
44004397 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 )
44034400 self .set_adjustable ('datalim' )
44044401 ax2 .set_adjustable ('datalim' )
44054402 self ._twinned_axes .join (self , ax2 )
44064403 return ax2
44074404
44084405 def twinx (self ):
44094406 """
4410- Create a twin Axes sharing the xaxis
4407+ Create a twin Axes sharing the xaxis.
44114408
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
44134410 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`.
44174414
44184415 Returns
44194416 -------
@@ -4437,13 +4434,13 @@ def twinx(self):
44374434
44384435 def twiny (self ):
44394436 """
4440- Create a twin Axes sharing the yaxis
4437+ Create a twin Axes sharing the yaxis.
44414438
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
44434440 x-axis positioned opposite to the original one (i.e. at top). The
44444441 y-axis autoscale setting will be inherited from the original Axes.
44454442 To ensure that the tick marks of both x-axes align, see
4446- `~matplotlib.ticker.LinearLocator`
4443+ `~matplotlib.ticker.LinearLocator`.
44474444
44484445 Returns
44494446 -------
@@ -4455,7 +4452,6 @@ def twiny(self):
44554452 For those who are 'picking' artists while using twiny, pick
44564453 events are only called for the artists in the top-most axes.
44574454 """
4458-
44594455 ax2 = self ._make_twin_axes (sharey = self )
44604456 ax2 .xaxis .tick_top ()
44614457 ax2 .xaxis .set_label_position ('top' )
0 commit comments