Skip to content

Commit a453ba4

Browse files
committed
Changed to cast anything that is not float16, float32, float64
1 parent 9b3c3f1 commit a453ba4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/image.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,11 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
363363
if inp_dtype.kind == 'f':
364364
scaled_dtype = A.dtype
365365
# Cast to float64
366-
if A.dtype == np.longdouble:
366+
if not (A.dtype == np.float64 or
367+
A.dtype == np.float32 or
368+
A.dtype == np.float16):
367369
warnings.warn(
368-
"Casting input data to float64 for imshow."
370+
'Casting input data to float64 for imshow.'
369371
)
370372
scaled_dtype = np.float64
371373
else:

0 commit comments

Comments
 (0)