Skip to content

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

@greglucas

Description

@greglucas

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy