Skip to content

Update and factor out Axis.get_tick_positions. #13335

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2019

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 31, 2019

YAxis.get_ticks_position had not been updated after the deprecation of
label1On (#10088). Fix that by making it share its implementation with
XAxis.get_ticks_position.

Release critical as YAxis.get_ticks_position otherwise emits a DeprecationWarning.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jan 31, 2019
@anntzer anntzer added this to the v3.1 milestone Jan 31, 2019
the first major and the first minor ticks, and return

- 1 if only tick1line and label1 are visible;
- 2 if only tick2line and label2 are visible;
Copy link
Member

Choose a reason for hiding this comment

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

comment here why these are left ambiguous....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

Why they don’t return strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because they become "top"/"bottom" for the x-axis but "left"/"right" for the y-axis? For an abstract Axis, 1 and 2 are the names of the ticks and labels, they don't have string names yet.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I understand, but it took me a bit, and it will be even more mysterious for someone who doesn't have the diff to look at. Just adding a one-line comment here would make it clearer...

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be useful to clarify that 1 means "top" or "bottom" and 2 means "left" or "right" in the docstring here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

👍 on code, docstring could be clarified though

the first major and the first minor ticks, and return

- 1 if only tick1line and label1 are visible;
- 2 if only tick2line and label2 are visible;
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be useful to clarify that 1 means "top" or "bottom" and 2 means "left" or "right" in the docstring here.

YAxis.get_ticks_position had not been updated after the deprecation of
label1On.  Fix that by making it share its implementation with
XAxis.get_ticks_position.
@NelleV NelleV merged commit 78736fa into matplotlib:master Feb 2, 2019
@anntzer anntzer deleted the gettickspos branch February 2, 2019 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants