8000
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 163aac0 commit 3f6b2edCopy full SHA for 3f6b2ed
lib/matplotlib/colors.py
@@ -1570,15 +1570,11 @@ def hsv_to_rgb(hsv):
1570
1571
def _vector_magnitude(arr):
1572
# things that don't work here:
1573
- # * np.linalg.norm
1574
- # - doesn't broadcast in numpy 1.7
1575
- # - drops the mask from ma.array
1576
- # * using keepdims - broken on ma.array until 1.11.2
1577
- # * using sum - discards mask on ma.array unless entire vector is masked
1578
-
+ # * np.linalg.norm: drops mask from ma.array
+ # * np.sum: drops mask from ma.array unless entire vector is masked
1579
sum_sq = 0
1580
for i in range(arr.shape[-1]):
1581
- sum_sq += np.square(arr[..., i, np.newaxis])
+ sum_sq += arr[..., i, np.newaxis] ** 2
1582
return np.sqrt(sum_sq)
1583
1584
0 commit comments