Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expire deprecation of nth_coord arguments#30015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:mainfromdstansby:nth-coord-depr
May 6, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletionsdoc/api/next_api_changes/removals/30015-DS.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
*nth_coord* parameter to axisartist helpers for fixed axis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Helper APIs in `.axisartist` for generating a "fixed" axis on rectilinear axes
(`.FixedAxisArtistHelperRectilinear`) no longer take a *nth_coord* parameter.
That parameter is entirely inferred from the (required) *loc* parameter.

For curvilinear axes, the *nth_coord* parameter remains supported (it affects
the *ticks*, not the axis position itself), but it is now keyword-only.
15 changes: 4 additions & 11 deletionslib/mpl_toolkits/axisartist/axislines.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,8 +120,7 @@ def _to_xy(self, values, const):
class _FixedAxisArtistHelperBase(_AxisArtistHelperBase):
"""Helper class for a fixed (in the axes coordinate) axis."""

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

class FixedAxisArtistHelperRectilinear(_FixedAxisArtistHelperBase):

@_api.delete_parameter("3.9", "nth_coord")
def __init__(self, axes, loc, nth_coord=None):
"""
nth_coord = along which coordinate value varies
in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
"""
def __init__(self, axes, loc):
super().__init__(loc)
self.axis = [axes.xaxis, axes.yaxis][self.nth_coord]

Expand DownExpand Up@@ -311,10 +305,9 @@ def __init__(self, axes):
super().__init__()
self.axes = axes

@_api.delete_parameter(
"3.9", "nth_coord", addendum="'nth_coord' is now inferred from 'loc'.")
def new_fixed_axis(
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
self, loc, *, axis_direction=None, offset=None, axes=None
):
if axes is None:
_api.warn_external(
"'new_fixed_axis' explicitly requires the axes keyword.")
Expand Down
4 changes: 2 additions & 2 deletionslib/mpl_toolkits/axisartist/grid_helper_curvelinear.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -316,9 +316,9 @@ def update_grid_finder(self, aux_trans=None, **kwargs):
self.grid_finder.update(**kwargs)
self._old_limits = None # Force revalidation.

@_api.make_keyword_only("3.9", "nth_coord")
def new_fixed_axis(
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
self, loc, *, axis_direction=None, offset=None, axes=None, nth_coord=None
):
if axes is None:
axes = self.axes
if axis_direction is None:
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp