We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4b9f9f commit 1139e6aCopy full SHA for 1139e6a
lib/matplotlib/cm.py
@@ -367,10 +367,12 @@ def set_array(self, A):
367
----------
368
A : array-like or None
369
"""
370
- A = cbook.safe_masked_invalid(A, copy=True) if A is not None else None
371
-
372
- if (A is not None and A.dtype != np.uint8 and
373
- not np.can_cast(A.dtype, float, "same_kind")):
+ if A is None:
+ self._A = None
+ return
+
374
+ A = cbook.safe_masked_invalid(A, copy=True)
375
+ if not np.can_cast(A.dtype, float, "same_kind"):
376
raise TypeError("Image data of dtype {} cannot be converted to "
377
"float".format(A.dtype))
378
0 commit comments