@@ -116,17 +116,11 @@ class _FixedAxisArtistHelperBase(_AxisArtistHelperBase):
116
116
lambda self : {"left" : (0 , 0 ), "right" : (1 , 0 ),
117
117
"bottom" : (0 , 0 ), "top" : (0 , 1 )}[self ._loc ]))
118
118
119
+ @_api .delete_parameter ("3.9" , "nth_coord" )
119
120
def __init__ (self , loc , nth_coord = None ):
120
121
"""``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 )
130
124
self ._loc = loc
131
125
self ._pos = {"bottom" : 0 , "top" : 1 , "left" : 0 , "right" : 1 }[loc ]
132
126
super ().__init__ ()
@@ -184,12 +178,13 @@ def get_line(self, axes):
184
178
185
179
class FixedAxisArtistHelperRectilinear (_FixedAxisArtistHelperBase ):
186
180
181
+ @_api .delete_parameter ("3.9" , "nth_coord" )
187
182
def __init__ (self , axes , loc , nth_coord = None ):
188
183
"""
189
184
nth_coord = along which coordinate value varies
190
185
in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
191
186
"""
192
- super ().__init__ (loc , nth_coord )
187
+ super ().__init__ (loc )
193
188
self .axis = [axes .xaxis , axes .yaxis ][self .nth_coord ]
194
189
195
190
# TICK
@@ -333,6 +328,8 @@ def __init__(self, axes):
333
328
super ().__init__ ()
334
329
self .axes = axes
335
330
331
+ @_api .delete_parameter (
332
+ "3.9" , "nth_coord" , addendum = "'nth_coord' is now inferred from 'loc'." )
336
333
def new_fixed_axis (self , loc ,
337
334
nth_coord = None ,
338
335
axis_direction = None ,
@@ -345,8 +342,7 @@ def new_fixed_axis(self, loc,
345
342
axes = self .axes
346
343
if axis_direction is None :
347
344
axis_direction = loc
348
-
349
- helper = FixedAxisArtistHelperRectilinear (axes , loc , nth_coord )
345
+ helper = FixedAxisArtistHelperRectilinear (axes , loc )
350
346
axisline = AxisArtist (axes , helper , offset = offset ,
351
347
axis_direction = axis_direction )
352
348
return axisline
@@ -359,7 +355,6 @@ def new_floating_axis(self, nth_coord, value,
359
355
_api .warn_external (
360
356
"'new_floating_axis' explicitly requires the axes keyword." )
361
357
axes = self .axes
362
-
363
358
helper = FloatingAxisArtistHelperRectilinear (
364
359
axes , nth_coord , value , axis_direction )
365
360
axisline = AxisArtist (axes , helper , axis_direction = axis_direction )
@@ -494,21 +489,11 @@ def get_children(self):
494
489
return children
495
490
496
491
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 )
505
493
506
494
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 )
512
497
513
498
514
499
class AxesZero (Axes ):
0 commit comments