-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: expose make_norm_from_scale #20405
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
ENH: expose make_norm_from_scale #20405
Conversation
4e26432
to
8b69d27
Compare
Downstream libraries can take advantage of ``make_norm_from_scale`` in | ||
``colors.py`` to create a `~.colors.Normalize` subclass directly from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should just make this a full-on reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for some reason that wasn't working...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, an entry needs to be added to doc/api/colors_api.rst
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this still needs to be changed to e.g.
take advantage of `.colors.make_norm_from_scale`
?
8b69d27
to
ee98a5d
Compare
72ac1cf
to
28b9e4e
Compare
``colors.py`` to create a `~.colors.Normalize` subclass directly from | ||
an existing scale. Usually norms have a scale, and the advantage of | ||
having a `~.scale.ScaleBase` attached to a norm is to provide a | ||
default scale for the colorbar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps be more explicit: "provide a scale, and associated tick locators and formatters, for the colorbar"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor nit re docs; can self-merge after addressing it.
28b9e4e
to
4ec0bc2
Compare
PR Summary
Internally we now make most norms from scales using
colors._make_norm_from_scale
. This simply hoists that to public API so downstream libraries can use it as well...PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).