matplotlib

Table Of Contents

Previous topic

mlab

Next topic

path

This Page

nxutils

matplotlib.nxutils

general purpose numerical utilities, eg for computational geometry, that are not available in numpy

matplotlib.nxutils.pnpoly()

inside = pnpoly(x, y, xyverts)

Return 1 if x,y is inside the polygon, 0 otherwise.

xyverts
a sequence of x,y vertices.

A point on the boundary may be treated as inside or outside. See pnpoly

matplotlib.nxutils.points_inside_poly()

mask = points_inside_poly(xypoints, xyverts)

Return a boolean ndarray, True for points inside the polygon.

xypoints
a sequence of N x,y pairs.
xyverts
sequence of x,y vertices of the polygon.
mask
an ndarray of length N.

A point on the boundary may be treated as inside or outside. See pnpoly