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

Skip to content

Commit d95db3c

Browse files
phobsonOceanWolf
authored andcommitted
fix bad indexing when returning a scalar
1 parent 62c9efc commit d95db3c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/matplotlib/colors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,11 +1034,9 @@ def __call__(self, value, clip=None):
10341034
mask=mask)
10351035

10361036
x, y = [vmin, vcenter, vmax], [0, 0.5, 1]
1037+
# returns a scalar if shape == (1,)
10371038
result = np.ma.masked_array(np.interp(value, x, y))
10381039

1039-
if is_scalar:
1040-
result = result[0]
1041-
10421040
return result
10431041

10441042
def autoscale_None(self, A):

0 commit comments

Comments
 (0)