From f3ff2e741288984d6c4182453f2526eaaab1fbf4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 2 Jul 2020 10:25:04 -0400 Subject: [PATCH] added __iadd__ method --- python/damask/_colormap.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index 2533d4d36..c15befcfa 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -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()