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

Simplify colormap plotting #147

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Feb 6, 2024

All the special cases other than Greys are just the size of the colormap themselves. Also, colormaps are at most 256 elements long, so using n=512 is probably not necessary.

Also, use the same algorithm as the Specifying colors tutorial to choose text colour over colour cycles.

@rougier
Copy link
Member

rougier commented Feb 6, 2024

Didn't know about the cmap.N... Looks good to me.

scripts/colormaps.py Outdated Show resolved Hide resolved
All the special cases other than Greys are just the size of the colormap
themselves, but we want to drop that special case as well. Also,
colormaps are at most 256 elements long, so using `n=512` is probably
not necessary.
... and debug a bit.
@timhoffm
Copy link
Member

timhoffm commented Feb 15, 2024

Do we have a one or two approval policy on the cheatsheets?

@timhoffm timhoffm merged commit e8f23b6 into matplotlib:master Feb 19, 2024
2 of 3 checks passed
@QuLogic QuLogic deleted the simplify-colormap branch February 21, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants