-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
copy a color map object does not isolate changes to cm #8299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Difficulty: Medium
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Milestone
Comments
Exact work:
Tagging as medium because the color map code is a bit convoluted . |
I can reproduce this issue with:
In the second plot the image contains blue when it should remain white. copy.deepcopy works as expected, though. Would the solution be to have copy call deepcopy? |
Implementing |
vidursatija
added a commit
to vidursatija/matplotlib
that referenced
this issue
Mar 24, 2017
vidursatija
added a commit
to vidursatija/matplotlib
that referenced
this issue
May 14, 2017
Implemented with no leak into Reds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 toself._lut
(which is what is used to__call__
to map from values -> rgba). Any calls toset_over
,set_under
, orset_bad
will be shared by all copies (as they updateself._lut
in place).The text was updated successfully, but these errors were encountered: