Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@tacaswell

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).

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