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

Add Axis.get_inverted and Axis.set_inverted.#13330

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
jklymak merged 1 commit intomatplotlib:masterfromanntzer:getsetinverted
Feb 2, 2019

Conversation

anntzer
Copy link
Contributor

See rationale in changelog note (basically, Axes.invert_xaxis is fine
for interactive use, but a bit of a pain for library-work).

Note that xaxis_inverted is now implemented in terms of get_inverted and
invert_xaxis in terms of set_inverted, so the new methods are properly
tested.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

See rationale in changelog note (basically, Axes.invert_xaxis is finefor interactive use, but a bit of a pain for library-work).Note that xaxis_inverted is now implemented in terms of get_inverted andinvert_xaxis in terms of set_inverted, so the new methods are properlytested.
Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm concerned about where we are storing the state of the axis. This moves more state intoAxis, but the real home isAxes; the Axis is a slave of that takes care of implimenting the state of the Axes, and indeed all thatAxis.get_view_interval() does is querryAxes.viewLim.intervalx. So I'm against setting the view interval here (though that already exists) and I'm against setting whether that interval is inverted or not here. I think this should all be done at the Axes level...

@anntzer
Copy link
ContributorAuthor

The Axis and Axes classes are obviously tightly coupled, but in my view, methods that logically act on a single Axis should, actually, be implemented as Axis methods, not as pairs of Axes methods. If it was up to me, we'd haveax.xaxis.set_lim() andax.yaxis.set_lim(), notax.set_xlim andax.set_ylim (because this avoids having to further addax.set_rlim,ax.set_thetalim for polar axes,ax.set_zlim for 3d axes, etc.; even though they are just trivial wrappers). (Obviously the ship has sailed for set_lim.)

@jklymak
Copy link
Member

I guessaxis.set_view_interval already exists despite the fact all it does is set the viewelims on the axes 🙄 , so this is fine.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@jklymak@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp