Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 95d39d3

Browse filesBrowse files
author
Yi Wei
committed
copy mask locally
1 parent 7d3937c commit 95d39d3
Copy full SHA for 95d39d3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-7
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5740,9 +5740,6 @@ def imshow(self, X, cmap=None, norm=None, *, aspect=None,
57405740
self.add_image(im)
57415741
return im
57425742

5743-
def _is_unwritable(self, c):
5744-
return np.ma.is_masked(c) and not c.mask.flags.writeable
5745-
57465743
def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
57475744
# - create X and Y if not present;
57485745
# - reshape X and Y as needed if they are 1-D;
@@ -5767,8 +5764,7 @@ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
57675764
else:
57685765
X, Y = np.meshgrid(np.arange(ncols + 1), np.arange(nrows + 1))
57695766
shading = 'flat'
5770-
copy = self._is_unwritable(C)
5771-
C = cbook.safe_masked_invalid(C, copy=copy)
5767+
C = cbook.safe_masked_invalid(C, copy=True)
57725768
return X, Y, C, shading
57735769

57745770
if len(args) == 3:
@@ -5857,8 +5853,7 @@ def _interp_grid(X):
58575853
Y = _interp_grid(Y.T).T
58585854
shading = 'flat'
58595855

5860-
copy = self._is_unwritable(C)
5861-
C = cbook.safe_masked_invalid(C, copy=copy)
5856+
C = cbook.safe_masked_invalid(C, copy=True)
58625857
return X, Y, C, shading
58635858

58645859
@_preprocess_data()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.