Skip to content

Allow polar scales where zero is not in valid interval #24763

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
Dec 31, 2022

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Dec 18, 2022

PR Summary

This allows scales to be set on polar Axes where 0 is not in the valid scale limits (e.g. a log scale falls into this category). Because there is some special casing in polar radial view limits that tries to include zero all the time, I didn't want to break this, so instead I've gone for the most general check of running the interval [0, 1] through the scale's limit_range_for_scale method, and checking if a 0 comes out. If it doesn't, the deafult behaviour of the locator is used to set the view limits and nonsingular values.

Goes part way to fixing #24383

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

@dstansby dstansby marked this pull request as draft December 18, 2022 13:02
@dstansby dstansby changed the title Remove special nonsingular casing in RadialLocator Allow polar scales where zero is not in valid interval Dec 20, 2022
@dstansby dstansby marked this pull request as ready for review December 20, 2022 18:39
@QuLogic QuLogic merged commit fc5d316 into matplotlib:main Dec 31, 2022
@QuLogic QuLogic added this to the v3.7.0 milestone Dec 31, 2022
@dstansby dstansby deleted the polar-nonsingular branch December 31, 2022 11:03
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.

3 participants