8000 interpret data to normalize as ndarrays · matplotlib/matplotlib@063bcac · GitHub
[go: up one dir, main page]

Skip to content

Commit 063bcac

Browse files
author
Nathan Goldbaum
committed
interpret data to normalize as ndarrays
1 parent 75fde88 commit 063bcac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ def __call__(self, value, clip=None):
10091009
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
10101010
mask=mask)
10111011
# in-place equivalent of above can be much faster
1012-
resdat = result.data
1012+
resdat = np.asarray(result.data)
10131013
mask = result.mask
10141014
if mask is np.ma.nomask:
10151015
mask = (resdat <= 0)
@@ -1104,7 +1104,7 @@ def __call__(self, value, clip=None):
11041104
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
11051105
mask=mask)
11061106
# in-place equivalent of above can be much faster
1107-
resdat = self._transform(result.data)
1107+
resdat = self._transform(np.asarray(result.data))
11081108
resdat -= self._lower
11091109
resdat /= (self._upper - self._lower)
11101110

@@ -1198,7 +1198,7 @@ def __call__(self, value, clip=None):
11981198
mask = np.ma.getmask(result)
11991199
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
12001200
mask=mask)
1201-
resdat = result.data
1201+
resdat = np.asarray(result.data)
12021202
resdat -= vmin
12031203
np.power(resdat, gamma, resdat)
12041204
resdat /= (vmax - vmin) ** gamma

0 commit comments

Comments
 (0)
0