FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Doc]: Deprecation note in `get_cmap` is non-actionable · Issue #22362 · matplotlib/matplotlib · GitHub

Repository navigation

[Doc]: Deprecation note in get_cmap is non-actionable #22362

Closed

Description

Documentation Link

Docstring of mpl.cm.get_cmap

Problem

There is a note that says:

Notes
-----
Currently, this returns the global colormap object, which is deprecated.
In Matplotlib 3.5, you will no longer be able to modify the global
colormaps in-place.

This is not clear about what is deprecated or how users should update. Will it start returning a copy? Will it start returning an immutable object? Should users be using a different function?

Suggested improvement

No response

Matplotlib Version

3.5.1

Activity

  1. soma2000-lang commented on Jan 30, 2022

    @mwaskom I am working on this.

  2. soma2000-lang commented on Feb 3, 2022

    @mwaskom I could not find the documentation where this warning is mentioned .Please help.

  3. greglucas commented on Feb 3, 2022

    Contributor

    This note is going to be removed for 3.6, so the documentation update would be on the 3.5.x branch. See this PR for the locations of the various pieces of code surrounding this note: #22298

    References to a few other issues/PRs that this has stemmed from: #20853, #20853, #19766, #16991

    The previous versions of Matplotlib would return the same object every time, which caused issues with changing a mutable state for future access of colormaps. In 3.6+ get_cmap() will return a copy of the colormap with each request. If you weren't getting warnings/errors about "modifying the global state of a colormap" within code, then there shouldn't be any updates necessary.

    matplotlib.cm.get_cmap() is still available and there is now a new ColormapRegistry that lives at matplotlib.colormaps which can be used like a dictionary matplotlib.colormaps["viridis"].

  4. jklymak commented on Feb 3, 2022

    Member

    @soma2000-lang Thanks for the willingness to help, but this is pretty subtle, and I think we need someone who understands those subtleties to fix the message.

  5. soma2000-lang commented on Feb 4, 2022

    Ok.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL