Skip to content

Commit

Permalink
Update lib/matplotlib/colors.py
Browse files Browse the repository at this point in the history
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
  • Loading branch information
timhoffm and greglucas authored Nov 12, 2024
1 parent 6b1ce2a commit 5e48fd8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,10 +1228,7 @@ def monochrome(self):
if not self._isinit:
self._init()

N = len(self._lut) - 3 # disregard over / under / bad
if N <= 1:
return True
return np.all(self._lut[0] == self._lut[1:N])
return self.N <=1 or np.all(self._lut[0] == self._lut[1:self.N])

def resampled(self, lutsize):
"""Return a new colormap with *lutsize* entries."""
Expand Down

0 comments on commit 5e48fd8

Please sign in to comment.