Skip to content

Issue #8299, implemented copy, added test #8375

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

Merged
merged 3 commits into from
May 25, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed _lut from docs, changed to snake_case
  • Loading branch information
vidursatija authored Mar 25, 2017
commit 90f5f15549d4a891849e64d39f070bb8e1eb7c75
11 changes: 5 additions & 6 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,14 @@ def __call__(self, X, alpha=None, bytes=False):
return rgba

def __copy__(self):
"""Create new object with the same class and update attributes
If object is initialized, copy the elements of _lut list
"""Create new object with the same class, update attributes
"""
cls = self.__class__
newCMapObj = cls.__new__(cls)
newCMapObj.__dict__.update(self.__dict__)
cmapobject = cls.__new__(cls)
cmapobject.__dict__.update(self.__dict__)
if self._isinit:
newCMapObj._lut = np.copy(self._lut)
return newCMapObj
cmapobject._lut = np.copy(self._lut)
return cmapobject

def set_bad(self, color='k', alpha=None):
"""Set color to be used for masked values.
Expand Down