From 7cb429f81a9206fa450cceff21c695faf01fce41 Mon Sep 17 00:00:00 2001 From: Joshua Larsen Date: Thu, 3 Dec 2020 13:41:30 -0800 Subject: [PATCH] Fix(PlotMapView.plot_array()): fix value masking code for masked_values parameter (#1026) --- flopy/plot/map.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flopy/plot/map.py b/flopy/plot/map.py index 324901dffd..eb6b4d47c8 100644 --- a/flopy/plot/map.py +++ b/flopy/plot/map.py @@ -122,6 +122,11 @@ def plot_array(self, a, masked_values=None, **kwargs): # Use the model grid to pass back an array of the correct shape plotarray = self.mg.get_plottable_layer_array(a, self.layer) + # if masked_values are provided mask the plotting array + if masked_values is not None: + for mval in masked_values: + plotarray = np.ma.masked_values(plotarray, mval) + # add NaN values to mask plotarray = np.ma.masked_where(np.isnan(plotarray), plotarray)