Skip to content

[Bug]: register_cmap deprecation message seems wrong #23719

@mwaskom

Description

@mwaskom

Bug summary

See title

Code for reproduction

import matplotlib as mpl
mpl.cm.register_cmap("test", mpl.colors.ListedColormap(["C0", "C1"]))

Actual outcome

PendingDeprecationWarning: The register_cmap function will be deprecated in a future version.
Use ``matplotlib.colormaps.register_cmap(name)`` instead.

Expected outcome

I think there's two problems here:

  • The function is called matplotlib.colormaps.register
  • The signature for that function is mpl.colormaps.register(cmap, *, name=None, force=False)

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.0.rc1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions