8000 Backport PR #11002: Fix logic error in ScalarMappable.to_rgba · matplotlib/matplotlib@790c210 · GitHub
[go: up one dir, main page]

Skip to content

Commit 790c210

Browse files
efiringMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #11002: Fix logic error in ScalarMappable.to_rgba
1 parent d46e69a commit 790c210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
252252
else:
253253
raise ValueError("third dimension must be 3 or 4")
254254
if xx.dtype.kind == 'f':
255-
if norm and xx.max() > 1 or xx.min() < 0:
255+
if norm and (xx.max() > 1 or xx.min() < 0):
256256
raise ValueError("Floating point image RGB values "
257257
"must be in the 0..1 range.")
258258
if bytes:

0 commit comments

Comments
 (0)
0