copy a color map object does not isolate changes to cm · Issue #8299 · matplotlib/matplotlib · GitHub
Skip to content

copy a color map object does not isolate changes to cm #8299

Description

@tacaswell

If you do cm2 = copy.copy(cm) and the original color map has been used at least once, then the copy will share a reference to self._lut (which is what is used to __call__ to map from values -> rgba). Any calls to set_over, set_under, or set_bad will be shared by all copies (as they update self._lut in place).

Activity

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

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions