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

Skip to content

Commit 07ef0ff

Browse files
committed
force a copy of the colormap input data
svn path=/branches/v0_98_5_maint/; revision=7054
1 parent c484ac2 commit 07ef0ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/colors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ def __call__(self, X, alpha=1.0, bytes=False):
483483
xa = np.array([X])
484484
else:
485485
vtype = 'array'
486-
xma = ma.asarray(X)
486+
# force a copy here -- the ma.array and filled functions
487+
# do force a cop of the data by default - JDH
488+
xma = ma.array(X, copy=True)
487489
xa = xma.filled(0)
488490
mask_bad = ma.getmask(xma)
489491
if xa.dtype.char in np.typecodes['Float']:

0 commit comments

Comments
 (0)