8000 Add a test for #1787 · matplotlib/matplotlib@dae730e · GitHub
[go: up one dir, main page]

Skip to content

Commit dae730e

Browse files
committed
Add a test for #1787
1 parent 7226a10 commit dae730e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/matplotlib/tests/test_artist.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import print_function
22

3+
import numpy as np
4+
35
from matplotlib.testing.decorators import cleanup
46

57
import matplotlib.pyplot as plt
@@ -88,6 +90,19 @@ def test_collection_transform_of_none():
8890
assert isinstance(c._transOffset, mtrans.IdentityTransform)
8991

9092

93+
def test_point_in_path():
94+
from matplotlib.path import Path
95+
96+
# Test #1787
97+
verts2 = [(0,0), (0,1), (1,1), (1,0), (0,0)]
98+
99+
path = Path(verts2, closed=True)
100+
points = [(0.5,0.5), (1.5,0.5)]
101+
102+
assert np.all(path.contains_points(points) == [True, False])
103+
104+
105+
91106
if __name__=='__main__':
92107
import nose
93108
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

0 commit comments

Comments
 (0)
0