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

Skip to content

Implemented __copy__ in Colormap #8314

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

Closed
wants to merge 9 commits into from
Closed
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
Updated __copy__ indentation
  • Loading branch information
vidursatija authored Mar 17, 2017
commit 3ece4cb11f6bfbb39b96e55509e647bb95f6f48a
16 changes: 8 additions & 8 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,14 @@ def __call__(self, X, alpha=None, bytes=False):

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

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