@@ -116,17 +116,11 @@ class _FixedAxisArtistHelperBase(_AxisArtistHelperBase):
116116 lambda self : {"left" : (0 , 0 ), "right" : (1 , 0 ),
117117 "bottom" : (0 , 0 ), "top" : (0 , 1 )}[self ._loc ]))
118118
119+ @_api .delete_parameter ("3.9" , "nth_coord" )
119120 def __init__ (self , loc , nth_coord = None ):
120121 """``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
121- self .nth_coord = (
122- nth_coord if nth_coord is not None else
123- _api .check_getitem (
124- {"bottom" : 0 , "top" : 0 , "left" : 1 , "right" : 1 }, loc = loc ))
125- if (nth_coord == 0 and loc not in ["left" , "right" ]
126- or nth_coord == 1 and loc not in ["bottom" , "top" ]):
127- _api .warn_deprecated (
128- "3.7" , message = f"{ loc = !r} is incompatible with "
129- "{nth_coord=}; support is deprecated since %(since)s" )
122+ self .nth_coord = _api .check_getitem (
123+ {"bottom" : 0 , "top" : 0 , "left" : 1 , "right" : 1 }, loc = loc )
130124 self ._loc = loc
131125 self ._pos = {"bottom" : 0 , "top" : 1 , "left" : 0 , "right" : 1 }[loc ]
132126 super ().__init__ ()
@@ -184,12 +178,13 @@ def get_line(self, axes):
184178
185179class FixedAxisArtistHelperRectilinear (_FixedAxisArtistHelperBase ):
186180
181+ @_api .delete_parameter ("3.9" , "nth_coord" )
187182 def __init__ (self , axes , loc , nth_coord = None ):
188183 """
189184 nth_coord = along which coordinate value varies
190185 in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
191186 """
192- super ().__init__ (loc , nth_coord )
187+ super ().__init__ (loc )
193188 self .axis = [axes .xaxis , axes .yaxis ][self .nth_coord ]
194189
195190 # TICK
@@ -333,6 +328,8 @@ def __init__(self, axes):
333328 super ().__init__ ()
334329 self .axes = axes
335330
331+ @_api .delete_parameter (
332+ "3.9" , "nth_coord" , addendum = "'nth_coord' is now inferred from 'loc'." )
336333 def new_fixed_axis (self , loc ,
337334 nth_coord = None ,
338335 axis_direction = None ,
@@ -345,8 +342,7 @@ def new_fixed_axis(self, loc,
345342 axes = self .axes
346343 if axis_direction is None :
347344 axis_direction = loc
348-
349- helper = FixedAxisArtistHelperRectilinear (axes , loc , nth_coord )
345+ helper = FixedAxisArtistHelperRectilinear (axes , loc )
350346 axisline = AxisArtist (axes , helper , offset = offset ,
351347 axis_direction = axis_direction )
352348 return axisline
@@ -359,7 +355,6 @@ def new_floating_axis(self, nth_coord, value,
359355 _api .warn_external (
360356 "'new_floating_axis' explicitly requires the axes keyword." )
361357 axes = self .axes
362-
363358 helper = FloatingAxisArtistHelperRectilinear (
364359 axes , nth_coord , value , axis_direction )
365360 axisline = AxisArtist (axes , helper , axis_direction = axis_direction )
@@ -494,21 +489,11 @@ def get_children(self):
494489 return children
495490
496491 def new_fixed_axis (self , loc , offset = None ):
497- gh = self .get_grid_helper ()
498- axis = gh .new_fixed_axis (loc ,
499- nth_coord = None ,
500- axis_direction = None ,
501- offset = offset ,
502- axes = self ,
503- )
504- return axis
492+ return self .get_grid_helper ().new_fixed_axis (loc , offset = offset , axes = self )
505493
506494 def new_floating_axis (self , nth_coord , value , axis_direction = "bottom" ):
507- gh = self .get_grid_helper ()
508- axis = gh .new_floating_axis (nth_coord , value ,
509- axis_direction = axis_direction ,
510- axes = self )
511- return axis
495+ return self .get_grid_helper ().new_floating_axis (
496+ nth_coord , value , axis_direction = axis_direction , axes = self )
512497
513498
514499class AxesZero (Axes ):
0 commit comments