simplified
This commit is contained in:
parent
6bd23715b8
commit
7c72bd48fb
|
@ -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)."""
|
||||
|
|
Loading…
Reference in New Issue