added __iadd__ method

This commit is contained in:
Philip Eisenlohr 2020-07-02 10:25:04 -04:00
parent 3b72d0ec72
commit f3ff2e7412
1 changed files with 5 additions and 0 deletions

View File

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