Skip to content

Add a method to access the list of registered colormaps #18490

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

Closed
greglucas opened this issue Sep 15, 2020 · 1 comment · Fixed by #18503
Closed

Add a method to access the list of registered colormaps #18490

greglucas opened this issue Sep 15, 2020 · 1 comment · Fixed by #18503

Comments

@greglucas
Copy link
Contributor

Describe the issue

I noticed that the linked issues to PR
#16991
all want a public way to access the registered colormap names without resorting to importing pyplot. That PR removed the cm.cmap_d dictionary, but left nothing in its place.

There were a few suggestions in this thread: #16991 (comment)

Summary

Create a way to access the keys of the colormap registry within the mpl.cm module.

Proposed fix

Some ideas:
mpl.cm.get_cmap_names()
mpl.cm.get_registered_cmaps()
keeping consistency with pyplot: mpl.cm.colormaps()
... something else entirely

@timhoffm
Copy link
Member

IMHO, the colormaps should be accessed via a global colormaps mapping. See #18503 for a rough sketch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants