Skip to content

Commit 820c0fb

Browse files
committed
don't take values twice for masked arrays
1 parent 19b5c68 commit 820c0fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xarray/plot/plot.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,10 +1161,9 @@ def newplotfunc(
11611161
# better to pass the ndarrays directly to plotting functions
11621162
xval = xval.to_numpy()
11631163
yval = yval.to_numpy()
1164-
zarray = darray.as_numpy()
11651164

1166-
# Pass the data as a masked ndarray too
1167-
zval = zarray.to_masked_array(copy=False)
1165+
# Pass the data as a masked ndarray too
1166+
zval = darray.to_masked_array(copy=False)
11681167

11691168
# Replace pd.Intervals if contained in xval or yval.
11701169
xplt, xlab_extra = _resolve_intervals_2dplot(xval, plotfunc.__name__)

0 commit comments

Comments
 (0)