@@ -4192,25 +4192,9 @@ def _make_twin_axes(self, *kl, **kwargs):
41924192 if 'sharex' in kwargs and 'sharey' in kwargs :
41934193 raise ValueError ("Twinned Axes may share only one axis." )
41944194 ax2 = self .figure .add_axes (self .get_position (True ), * kl , ** kwargs )
4195-
41964195 self .set_adjustable ('datalim' )
41974196 ax2 .set_adjustable ('datalim' )
41984197 self ._twinned_axes .join (self , ax2 )
4199- # check if we have a layoutbox. If so, then set this axis
4200- # gets the same poslayoutbox and layoutbox...
4201- if self ._layoutbox is not None :
4202- name = self ._layoutbox .name + 'twin' + layoutbox .seq_id ()
4203- ax2 ._layoutbox = layoutbox .LayoutBox (
4204- parent = self ._subplotspec ._layoutbox ,
4205- name = name ,
4206- artist = ax2 )
4207- ax2 ._poslayoutbox = layoutbox .LayoutBox (
4208- parent = ax2 ._layoutbox ,
4209- name = ax2 ._layoutbox .name + '.pos' ,
4210- pos = True , subplot = True , artist = ax2 )
4211- # make the layout boxes be the same
4212- ax2 ._layoutbox .constrain_same (self ._layoutbox )
4213- ax2 ._poslayoutbox .constrain_same (self ._poslayoutbox )
42144198 return ax2
42154199
42164200 def twinx (self ):
@@ -4263,6 +4247,7 @@ def twiny(self):
42634247 For those who are 'picking' artists while using twiny, pick
42644248 events are only called for the artists in the top-most axes.
42654249 """
4250+
42664251 ax2 = self ._make_twin_axes (sharey = self )
42674252 ax2 .xaxis .tick_top ()
42684253 ax2 .xaxis .set_label_position ('top' )
0 commit comments