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

Skip to content

Commit 096d0ac

Browse files
authored
Merge pull request #17994 from anntzer/bez
Special case degree-1 Bezier curves.
2 parents 57c8baa + 1e6352a commit 096d0ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/bezier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ def axis_aligned_extrema(self):
287287
0`
288288
"""
289289
n = self.degree
290+
if n <= 1:
291+
return np.array([]), np.array([])
290292
Cj = self.polynomial_coefficients
291293
dCj = np.arange(1, n+1)[:, None] * Cj[1:]
292-
if len(dCj) == 0:
293-
return np.array([]), np.array([])
294294
dims = []
295295
roots = []
296296
for i, pi in enumerate(dCj.T):

0 commit comments

Comments
 (0)