You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/pyplot.py", line 2773, in pcolormesh
__ret = gca().pcolormesh(
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/init.py", line 1442, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 6220, in pcolormesh
X, Y, C, shading = self._pcolorargs('pcolormesh', *args,
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 5713, in _pcolorargs
X, Y = [cbook.safe_masked_invalid(a) for a in [X, Y]]
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 5713, in
X, Y = [cbook.safe_masked_invalid(a) for a in [X, Y]]
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/cbook/init.py", line 715, in safe_masked_invalid
xm = np.ma.masked_invalid(x, copy=False)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 2360, in masked_invalid
res = masked_where(~(np.isfinite(a)), a, copy=copy)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 1942, in masked_where
result.mask = _shrink_mask(cond)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 3516, in mask
self.setmask(value)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 3462, in setmask
current_mask.flat = mask
ValueError: array is read-only
Expected outcome
No error
Additional information
The error still exists because I missed the following code in fixing #26093:
Bug summary
When the parameter
X
orY
is a masked array with a read-only mask,pcolor
fails withValueError: array is read-only
Code for reproduction
Actual outcome
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/pyplot.py", line 2773, in pcolormesh
__ret = gca().pcolormesh(
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/init.py", line 1442, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 6220, in pcolormesh
X, Y, C, shading = self._pcolorargs('pcolormesh', *args,
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 5713, in _pcolorargs
X, Y = [cbook.safe_masked_invalid(a) for a in [X, Y]]
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/axes/_axes.py", line 5713, in
X, Y = [cbook.safe_masked_invalid(a) for a in [X, Y]]
File "/Library/Python/3.9/lib/python/site-packages/matplotlib/cbook/init.py", line 715, in safe_masked_invalid
xm = np.ma.masked_invalid(x, copy=False)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 2360, in masked_invalid
res = masked_where(~(np.isfinite(a)), a, copy=copy)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 1942, in masked_where
result.mask = _shrink_mask(cond)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 3516, in mask
self.setmask(value)
File "/Library/Python/3.9/lib/python/site-packages/numpy/ma/core.py", line 3462, in setmask
current_mask.flat = mask
ValueError: array is read-only
Expected outcome
No error
Additional information
The error still exists because I missed the following code in fixing #26093:
matplotlib/lib/matplotlib/axes/_axes.py
Lines 5776 to 5783 in 9fdf6ad
And I will fix it as well if allowed.
Operating system
OS/X
Matplotlib Version
3.7.1
Matplotlib Backend
MacOSX
Python version
3.9
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: