MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_mask

Method set_mask

lib/matplotlib/tri/_triangulation.py:220–247  ·  view source on GitHub ↗

Set or clear the mask array. Parameters ---------- mask : None or bool array of length ntri

(self, mask)

Source from the content-addressed store, hash-verified

218 return self._neighbors
219
220 def set_mask(self, mask):
221 """
222 Set or clear the mask array.
223
224 Parameters
225 ----------
226 mask : None or bool array of length ntri
227 """
228 if mask is None:
229 self.mask = None
230 else:
231 self.mask = np.asarray(mask, dtype=bool)
232 if self.mask.shape != (self.triangles.shape[0],):
233 raise ValueError('mask array must have same length as '
234 'triangles array')
235
236 # Set mask in C++ Triangulation.
237 if self._cpp_triangulation is not None:
238 self._cpp_triangulation.set_mask(
239 self.mask if self.mask is not None else ())
240
241 # Clear derived fields so they are recalculated when needed.
242 self._edges = None
243 self._neighbors = None
244
245 # Recalculate TriFinder if it exists.
246 if self._trifinder is not None:
247 self._trifinder._initialize()

Callers 15

test_trifinderFunction · 0.95
test_tri_smooth_gradientFunction · 0.95
test_tritoolsFunction · 0.95
test_internal_cpp_apiFunction · 0.95
__init__Method · 0.95
tricontour_demo.pyFile · 0.80

Calls 1

_initializeMethod · 0.80

Tested by 6

test_trifinderFunction · 0.76
test_tri_smooth_gradientFunction · 0.76
test_tritoolsFunction · 0.76
test_internal_cpp_apiFunction · 0.76