Skip to content

Commit

Permalink
Merge pull request #5451 from andim/pcolormesh-nan-handling
Browse files Browse the repository at this point in the history
[Bug] masking of NaN Z values in pcolormesh
  • Loading branch information
efiring committed Nov 11, 2015
2 parents 57d1343 + 8928311 commit 5ac32f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/matplotlib/axes/_axes.py
Expand Up @@ -4983,6 +4983,7 @@ def _pcolorargs(funcname, *args, **kw):
else:
X, Y = np.meshgrid(np.arange(numCols + 1),
np.arange(numRows + 1))
C = cbook.safe_masked_invalid(C)
return X, Y, C

if len(args) == 3:
Expand Down Expand Up @@ -5015,6 +5016,7 @@ def _pcolorargs(funcname, *args, **kw):
' X (%d) and/or Y (%d); see help(%s)' % (
C.shape, Nx, Ny, funcname))
C = C[:Ny - 1, :Nx - 1]
C = cbook.safe_masked_invalid(C)
return X, Y, C

@unpack_labeled_data(label_namer=None)
Expand Down

0 comments on commit 5ac32f3

Please sign in to comment.