10000 Change to just apply to pcolormesh, not pcolor · matplotlib/matplotlib@b6f8923 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6f8923

Browse files
committed
Change to just apply to pcolormesh, not pcolor
1 parent 4733921 commit b6f8923

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5186,18 +5186,18 @@ def _pcolorargs(funcname, *args, **kw):
51865186
X, Y, C = [np.asanyarray(a) for a in args]
51875187
for a in X, Y:
51885188
a = cbook.safe_masked_invalid(a)
5189-
if np.ma.is_masked(a):
5189+
if funcname == 'pcolormesh' and np.ma.is_masked(a):
51905190
raise TypeError(
5191-
'x and y arguments to %s cannot have '
5192-
'non-finite values and cannot be type '
5193-
'numpy.ma.core.MaskedArray with masked values'
5194-
% funcname)
5195-
# if it didn't fail the above it is masked but has no
5196-
# masked values, so strip the mask:
5197-
if type(X) is np.ma.core.MaskedArray:
5198-
X = X.data
5199-
if type(Y) is np.ma.core.MaskedArray:
5200-
Y = Y.data
5191+
'x and y arguments to pcolormesh cannot have '
5192+
'non-finite values and or be of type '
5193+
'numpy.ma.core.MaskedArray with masked values')
5194+
if funcname == 'pcolormesh':
5195+
# if it didn't fail the above it is masked but has no
5196+
# masked values, so strip the mask for pcolormesh
5197+
if type(X) is np.ma.core.MaskedArray:
5198+
X = X.data
5199+
if type(Y) is np.ma.core.MaskedArray:
5200+
Y = Y.data
52015201
numRows, numCols = C.shape
52025202
else:
52035203
raise TypeError(

0 commit comments

Comments
 (0)
0