We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c43570 commit f24001aCopy full SHA for f24001a
lib/matplotlib/path.py
@@ -681,7 +681,7 @@ def interpolated(self, steps):
681
Path
682
The interpolated path.
683
"""
684
- if steps == 1:
+ if steps == 1 or len(self) == 0:
685
return self
686
687
if self.codes is not None and self.MOVETO in self.codes[1:]:
lib/matplotlib/tests/test_path.py
@@ -617,3 +617,8 @@ def test_interpolated_moveto_closepoly():
617
618
np.testing.assert_allclose(result.vertices, expected_vertices)
619
np.testing.assert_array_equal(result.codes, expected_codes)
620
+
621
622
+def test_interpolated_empty_path():
623
+ path = Path(np.zeros((0, 2)))
624
+ assert path.interpolated(42) is path
0 commit comments