Skip to content

should cm be renamed to colormaps? #1476

Closed

Description

@ivanov

It's a bit confusing to have a proper module have such a short, non-descriptive name.

Looking at code that uses it, if one were to see from matplotlib import cm - they'd be left wondering what those two letters could possibly stand for. Then further down, they'd see it being used with a keyword argument that would shed some light, such as cmap = cm.RdBu, and they would maybe go through the steps of "oh, it's a map... probably a color map"...maybe...

If the import code was written as from matplotlib import colormaps as cm, it'd be more clear. We would retain the dangling plt.cm and have a dummy matplotlib.cm module which would just import everything from matplotlib.colormaps.

as a bonus, I think plt.colormaps should be retained, but the code and documentation for it should live inside this new colormaps module.

Activity

  1. tacaswell commented on Jan 16, 2014

    @tacaswell
    Member

    👍 on doing this

  2. added this to the milestone on Aug 17, 2014
  3. petehuang commented on Dec 29, 2016

    @petehuang
    Contributor

    This is still useful. In the meantime, the docs just need to make sure that any mention of colormap is accompanied by a note saying that the colormap module is indeed named cm. I think this is done fine so far, but something to be aware of.

  4. modified the milestones: , on Oct 3, 2017
  5. added a commit that references this issue on Jun 11, 2018
    bb11c83
  6. efiring commented on Apr 27, 2020

    @efiring
    Member

    Too late. Not worth the disturbance. Decided in the devel meeting on 2020-04-27.

  7. removed this from the needs sorting milestone on Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: changesChanges to the public API, typically requiring deprecation.API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …New feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions