Skip to content

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

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Jun 10, 2021

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

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@jklymak jklymak force-pushed the enh-expose-make_norm_from_scale branch 2 times, most recently from 4e26432 to 8b69d27 Compare June 11, 2021 02:17
@jklymak jklymak marked this pull request as ready for review June 11, 2021 14:47
@jklymak jklymak added this to the v3.5.0 milestone Jun 11, 2021
Comment on lines 4 to 5
Downstream libraries can take advantage of ``make_norm_from_scale`` in
``colors.py`` to create a `~.colors.Normalize` subclass directly from
Copy link
Member

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?

Copy link
Member Author

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...

Copy link
Member

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.

Copy link
Contributor

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`

?

@jklymak jklymak force-pushed the enh-expose-make_norm_from_scale branch from 8b69d27 to ee98a5d Compare June 24, 2021 15:14
@jklymak jklymak force-pushed the enh-expose-make_norm_from_scale branch 2 times, most recently from 72ac1cf to 28b9e4e Compare July 5, 2021 20:15
@jklymak jklymak requested a review from anntzer July 19, 2021 15:49
``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.
Copy link
Contributor

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"

Copy link
Contributor

@anntzer anntzer left a 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.

@jklymak jklymak force-pushed the enh-expose-make_norm_from_scale branch from 28b9e4e to 4ec0bc2 Compare July 19, 2021 17:07
@jklymak jklymak merged commit 739252b into matplotlib:master Jul 19, 2021
@jklymak jklymak deleted the enh-expose-make_norm_from_scale branch July 19, 2021 18:11
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