Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 096d0ac

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

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/bezier.py

Copy file name to clipboardExpand all lines: lib/matplotlib/bezier.py
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.