Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a21737f

Browse files
committed
Add test
1 parent da73386 commit a21737f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_path.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ def test_exact_extents(path, extents):
102102
assert np.all(path.get_extents().extents == extents)
103103

104104

105+
def test_extents_with_moveto():
106+
# Check that MOVETO points are ignored when computing get_extents
107+
path = Path([[0, 1],
108+
[10, 10],
109+
[0, 1],
110+
[1, 1]], [Path.MOVETO, Path.MOVETO, Path.MOVETO, Path.LINETO])
111+
assert np.all(path.get_extents().extents == (0., 1., 1., 1.))
112+
113+
105114
def test_point_in_path_nan():
106115
box = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]])
107116
p = Path(box)

0 commit comments

Comments
 (0)