8000 colors: ensure masked array data is an ndarray · FrankYu/matplotlib@1fcf591 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fcf591

Browse files
author
Nathan Goldbaum
committed
colors: ensure masked array data is an ndarray
This fixes compatibility for imshow plots with array data that is a unit-aware ndarray subclass, for example data frmo yt.units or astropy.units.
1 parent f3895f9 commit 1fcf591

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
@@ -925,7 +925,7 @@ def __call__(self, value, clip=None):
925925
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
926926
mask=mask)
927927
# ma division is very slow; we can take a shortcut
928-
resdat = result.data
928+
resdat = np.asarray(result.data)
929929
resdat -= vmin
930930
resdat /= (vmax - vmin)
931931
result = np.ma.array(resdat, mask=result.mask, copy=False)

0 commit comments

Comments
 (0)
0