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

Method contains_points

lib/matplotlib/patches.py:245–284  ·  view source on GitHub ↗

Return whether the given points are inside the patch. Parameters ---------- points : (N, 2) array The points to check, in target coordinates of ``self.get_transform()``. These are display coordinates for patches that are added to

(self, points, radius=None)

Source from the content-addressed store, hash-verified

243 radius)
244
245 def contains_points(self, points, radius=None):
246 """
247 Return whether the given points are inside the patch.
248
249 Parameters
250 ----------
251 points : (N, 2) array
252 The points to check, in target coordinates of
253 ``self.get_transform()``. These are display coordinates for patches
254 that are added to a figure or Axes. Columns contain x and y values.
255 radius : float, optional
256 Additional margin on the patch in target coordinates of
257 `.Patch.get_transform`. See `.Path.contains_point` for further
258 details.
259
260 If `None`, the default value depends on the state of the object:
261
262 - If `.Artist.get_picker` is a number, the default
263 is that value. This is so that picking works as expected.
264 - Otherwise if the edge color has a non-zero alpha, the default
265 is half of the linewidth. This is so that all the colored
266 pixels are "in" the patch.
267 - Finally, if the edge has 0 alpha, the default is 0. This is
268 so that patches without a stroked edge do not have points
269 outside of the filled region report as "in" due to an
270 invisible edge.
271
272 Returns
273 -------
274 length-N bool array
275
276 Notes
277 -----
278 The proper use of this method depends on the transform of the patch.
279 See the notes on `.Patch.contains_point`.
280 """
281 radius = self._process_radius(radius)
282 return self.get_path().contains_points(points,
283 self.get_transform(),
284 radius)
285
286 def update_from(self, other):
287 # docstring inherited.

Callers

nothing calls this directly

Calls 3

_process_radiusMethod · 0.95
get_pathMethod · 0.95
get_transformMethod · 0.95

Tested by

no test coverage detected