FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/lib/matplotlib/nxutils.py at master · staticfloat/matplotlib · GitHub
staticfloat
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
nxutils.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (36 loc) · 1.23 KB
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
nxutils.py
Copy path
File metadata and controls
50 lines (36 loc) · 1.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import
warnings
from
matplotlib
import
path
def
pnpoly
(
x
,
y
,
xyverts
):
"""
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.
.. deprecated:: 1.2.0
Use :meth:`~matplotlib.path.Path.contains_point` instead.
"""
warings
.
warn
(
"nxutils is deprecated. Use matplotlib.path.Path.contains_point"
" instead."
,
DeprecationWarning
)
p
=
path
.
Path
(
xyverts
)
return
p
.
contains_point
(
x
,
y
)
def
points_inside_poly
(
xypoints
,
xyverts
):
"""
mask = points_inside_poly(xypoints, xyverts)
Returns 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.
A point on the boundary may be treated as inside or outside.
.. deprecated:: 1.2.0
Use :meth:`~matplotlib.path.Path.contains_points` instead.
"""
warnings
.
warn
(
"nxutils is deprecated. Use matplotlib.path.Path.contains_points"
" instead."
,
DeprecationWarning
)
p
=
path
.
Path
(
xyverts
)
return
p
.
contains_points
(
xypoints
)
Back
|
FazBrowse Home
|
New Git URL