8000 fix bad indexing when returning a scalar · matplotlib/matplotlib@ab11380 · GitHub
[go: up one dir, main page]

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 ab11380

Browse files
committed
fix bad indexing when returning a scalar
1 parent 633505d commit ab11380

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)
0