Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 085a3be

Browse files
committed
Revert "Simplified conditions"
This reverts commit 94c6304.
1 parent 94c6304 commit 085a3be

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/matplotlib/image.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +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-
# It is important to set scaled_dtype to be float64 even
367-
# if it already scaled_dtype == float64 (on some
368-
# platforms).
369-
if A.dtype not in (np.float64, np.float32, np.float16):
370-
warnings.warn("Casting input data from '{0}' to"
371-
"'float64' for imshow".format(A.dtype))
366+
if A.dtype not in (np.float32, np.float16):
367+
if A.dtype != np.float64:
368+
warnings.warn(
369+
"Casting input data from '{0}' to 'float64'"
370+
"for imshow".format(A.dtype))
372371
scaled_dtype = np.float64
373372
else:
374373
# probably an integer of some type.

0 commit comments

Comments
 (0)