Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ac0c85a

Browse filesBrowse files
committed
Fix float normalization too (float32->float32).
1 parent 1a2c4b0 commit ac0c85a
Copy full SHA for ac0c85a

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,9 @@ def process_value(value):
884884
if is_scalar:
885885
value = [value]
886886
dtype = np.min_scalar_type(value)
887-
dtype = (np.float32 if dtype.itemsize <= 2
888-
else np.promote_types(dtype, float))
887+
if np.issubdtype(dtype, np.integer) or dtype.type is np.bool_:
888+
# bool_/int8/int16 -> float32; int32/int64 -> float64
889+
dtype = np.promote_types(dtype, np.float32)
889890
result = np.ma.array(value, dtype=dtype, copy=True)
890891
return result, is_scalar
891892

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.