added __iadd__ method

This commit is contained in:
Philip Eisenlohr 2020-07-02 10:26:04 -04:00
parent f3ff2e7412
commit 5a96708f41
1 changed files with 1 additions and 2 deletions

View File

@ -26,8 +26,7 @@ class Colormap(mpl.colors.ListedColormap):
def __iadd__(self,other): def __iadd__(self,other):
"""Concatenate colormaps.""" """Concatenate colormaps."""
return Colormap(np.vstack((self.colors,other.colors)), return self.__add__(other)
f'{self.name}+{other.name}')
def __invert__(self): def __invert__(self):
"""Return inverted colormap.""" """Return inverted colormap."""