From 7c72bd48fb5092a0f8bbaee275b3fbb505a5af90 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Jan 2022 15:07:47 +0100 Subject: [PATCH] simplified --- python/damask/_colormap.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index 36f9e2d1b..93bd83cdc 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -65,9 +65,7 @@ class Colormap(mpl.colors.ListedColormap): def __mul__(self, factor: int) -> 'Colormap': """Repeat.""" - return Colormap(np.broadcast_to(self.colors,(factor,)+self.colors.shape) - .reshape((factor*self.colors.shape[0],)+self.colors.shape[1:]), - f'{self.name}*{factor}') + return Colormap(np.vstack([self.colors]*factor),f'{self.name}*{factor}') def __imul__(self, factor: int) -> 'Colormap': """Repeat (in-place)."""