Skip to content

Commit 4fd36da

Browse files
committed
Merge pull request #1984 from mdboom/rgb_to_hsv
colors.rgb_to_hsv does not work properly with array of int dtype
2 parents 6131cf7 + d834f53 commit 4fd36da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ def rgb_to_hsv(arr):
12211221
convert rgb values in a numpy array to hsv values
12221222
input and output arrays should have shape (M,N,3)
12231223
"""
1224-
out = np.zeros_like(arr)
1224+
out = np.zeros(arr.shape, dtype=np.float)
12251225
arr_max = arr.max(-1)
12261226
ipos = arr_max > 0
12271227
delta = arr.ptp(-1)

0 commit comments

Comments
 (0)