Thanks to visit codestin.com Credit goes to github.com
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 1a2c4b0 commit ac0c85aCopy full SHA for ac0c85a
lib/matplotlib/colors.py
@@ -884,8 +884,9 @@ def process_value(value):
884
if is_scalar:
885
value = [value]
886
dtype = np.min_scalar_type(value)
887
- dtype = (np.float32 if dtype.itemsize <= 2
888
- else np.promote_types(dtype, float))
+ if np.issubdtype(dtype, np.integer) or dtype.type is np.bool_:
+ # bool_/int8/int16 -> float32; int32/int64 -> float64
889
+ dtype = np.promote_types(dtype, np.float32)
890
result = np.ma.array(value, dtype=dtype, copy=True)
891
return result, is_scalar
892
0 commit comments