FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[MNT]: Deprecated / discourage less used Axes methods forwarding to Axis methods · Issue #23633 · matplotlib/matplotlib · GitHub

Repository navigation

[MNT]: Deprecated / discourage less used Axes methods forwarding to Axis methods #23633

Closed

Description

Summary

Discourage or deprecate

  • Axes.invert_xaxis() / Axes.invert_yaxis(). Use ax.xaxis.set_inverted(bool) instead.
  • Axes.xaxis_inverted() / Axes.yaxis_inverted(). Use ax.xaxis.get_inverted() instead.

These are simple and rare enough so that we do not need to lift the API from the Axis to the Axes.

I'm still not decided whether we should only discourage or deprecate. - It's the usual trade-off between backward-compatibility and making the API simpler / less redundant.

Activity

  1. story645 commented on Aug 15, 2022

    Member

    I'm kinda surprised there isn't an Axes.invert(which={x, y, both}) method since that seems like it'd be more consistent with the other methods on axes. Also what I'd propose replacing invert_{xy}axis with if you're going to deprecate those so there is still a method on axes and it is therefore discoverable in those docs.

  2. jklymak commented on Aug 16, 2022

    Member

    My problem with this is the axis API page is somewhat hard to discover. Maybe the API top level page needs to mention this and a couple other modules as being key to understanding the library (we have Axes and Figure already mapped out pretty well)

  3. anntzer commented on Aug 18, 2022

    Contributor

    The problem of Axes.invert (or Axes.invert_xaxis) is that it can easily make code less robust, because if you factor out your block of code into a library function that takes an ax parameter, things will typically go wrong if the axis was already inverted to start with (see the changelog entry in #13330). So I think we should just encourage the more robust pattern (set_inverted(True)).
    I think invert_xaxis has been around for long enough that we should just discourage it without deprecating it.

  4. story645 commented on Aug 18, 2022

    Member

    set_inverted(True)

    can this be added as a kwarg to .set_tick_params? Also then what about Axes.inverted(inverted=False, which='both') which mirrors grid and calls out to set_inverted

  5. anntzer commented on Aug 18, 2022

    Contributor

    It's certainly not a tick param. I guess I don't really like Axes.inverted(bool, which=...), but I probably don't feel as strongly about it.

  6. story645 commented on Aug 18, 2022

    Member

    It's certainly not a tick param.

    .set_tick_params` also includes bulk operations on ticks and this flips them? though I do hear you that that might be pushing the scope of that function too far.

  7. anntzer commented on Aug 18, 2022

    Contributor

    Not really, at least not any more than plot([3, 4]) is a ticks operation in that it sets visible ticks at 3 and 4, I would say.

  8. timhoffm commented on Aug 19, 2022

    MemberAuthor

    To make the discussion short, with my API authority I claim: We're not going to introduce any new Axes-level API for this. It's either the existing methods or going down to Axis via ax.xaxis / ax.yaxis.

    Sorry for being terse, I can motivate this in detail if there is interest, but I don't have the time right now.

  9. story645 commented on Aug 19, 2022

    Member

    I think consensus is discourage not deprecate - Jody and me for discoverability reasons, Anthony 'cause it's too widely used?

  10. github-actions commented on Dec 19, 2025

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  11. timhoffm commented on Dec 19, 2025

    MemberAuthor

    Closed by #29074.

  12. added this to the v3.11.0 milestone on Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL