Skip to content

Commit 2366f57

Browse files
authored
Merge pull request matplotlib#30015 from dstansby/nth-coord-depr
Expire deprecation of nth_coord arguments
2 parents 9174093 + 4e75193 commit 2366f57

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*nth_coord* parameter to axisartist helpers for fixed axis
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Helper APIs in `.axisartist` for generating a "fixed" axis on rectilinear axes
5+
(`.FixedAxisArtistHelperRectilinear`) no longer take a *nth_coord* parameter.
6+
That parameter is entirely inferred from the (required) *loc* parameter.
7+
8+
For curvilinear axes, the *nth_coord* parameter remains supported (it affects
9+
the *ticks*, not the axis position itself), but it is now keyword-only.

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def _to_xy(self, values, const):
120120
class _FixedAxisArtistHelperBase(_AxisArtistHelperBase):
121121
"""Helper class for a fixed (in the axes coordinate) axis."""
122122

123-
@_api.delete_parameter("3.9", "nth_coord")
124-
def __init__(self, loc, nth_coord=None):
123+
def __init__(self, loc):
125124
"""``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
126125
super().__init__(_api.check_getitem(
127126
{"bottom": 0, "top": 0, "left": 1, "right": 1}, loc=loc))
@@ -171,12 +170,7 @@ def get_line(self, axes):
171170

172171
class FixedAxisArtistHelperRectilinear(_FixedAxisArtistHelperBase):
173172

174-
@_api.delete_parameter("3.9", "nth_coord")
175-
def __init__(self, axes, loc, nth_coord=None):
176-
"""
177-
nth_coord = along which coordinate value varies
178-
in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
179-
"""
173+
def __init__(self, axes, loc):
180174
super().__init__(loc)
181175
self.axis = [axes.xaxis, axes.yaxis][self.nth_coord]
182176

@@ -311,10 +305,9 @@ def __init__(self, axes):
311305
super().__init__()
312306
self.axes = axes
313307

314-
@_api.delete_parameter(
315-
"3.9", "nth_coord", addendum="'nth_coord' is now inferred from 'loc'.")
316308
def new_fixed_axis(
317-
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
309+
self, loc, *, axis_direction=None, offset=None, axes=None
310+
):
318311
if axes is None:
319312
_api.warn_external(
320313
"'new_fixed_axis' explicitly requires the axes keyword.")

lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ def update_grid_finder(self, aux_trans=None, **kwargs):
316316
self.grid_finder.update(**kwargs)
317317
self._old_limits = None # Force revalidation.
318318

319-
@_api.make_keyword_only("3.9", "nth_coord")
320319
def new_fixed_axis(
321-
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
320+
self, loc, *, axis_direction=None, offset=None, axes=None, nth_coord=None
321+
):
322322
if axes is None:
323323
axes = self.axes
324324
if axis_direction is None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy