Skip to content
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

Remove unneeded _update_transScale calls in _init_axis. #24635

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 5, 2022

_init_axis is called only in the Axes constructor, where it is followed by a call to clear, which itself already calls _update_transScale (which is needed to take into account the axis scales that get set in it). So _init_axis doesn't need to call _update_transScale itself. Removing it avoids showcasing a private method in the custom_projection demo, and helps moving towards a system where updating an axis scale directly invalidates whatever is necessary (e.g. via a TransformWrapper) instead of requiring manual invalidation calls (i.e. _update_transScale).

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

_init_axis is called only in the Axes constructor, where it is followed
by a call to clear, which itself already calls _update_transScale (which
is needed to take into account the axis scales that get set in it).  So
_init_axis doesn't need to call _update_transScale itself.  Removing it
avoids showcasing a private method in the custom_projection demo, and
helps moving towards a system where updating an axis scale directly
invalidates whatever is necessary (e.g. via a TransformWrapper) instead
of requiring manual invalidation calls (i.e. _update_transScale).
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.

👍 if tests pass

@timhoffm timhoffm merged commit cf30ce7 into matplotlib:main Dec 6, 2022
@tacaswell tacaswell added this to the v3.7.0 milestone Dec 6, 2022
@anntzer anntzer deleted the uts branch December 6, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants