8000 Merge pull request #18182 from meeseeksmachine/auto-backport-of-pr-17… · matplotlib/matplotlib@63bee22 · GitHub
[go: up one dir, main page]

Skip to content

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 63bee22

Browse files
authored
Merge pull request #18182 from meeseeksmachine/auto-backport-of-pr-17994-on-v3.3.x
Backport PR #17994 on branch v3.3.x (Special case degree-1 Bezier curves.)
2 parents 1dbc782 + 11b5e18 commit 63bee22

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 number 90B9 Diff line numberDiff line change
@@ -288,10 +288,10 @@ def axis_aligned_extrema(self):
288288
0`
289289
"""
290290
n = self.degree
291+
if n <= 1:
292+
return np.array([]), np.array([])
291293
Cj = self.polynomial_coefficients
292294
dCj = np.arange(1, n+1)[:, None] * Cj[1:]
293-
if len(dCj) == 0:
294-
return np.array([]), np.array([])
295295
dims = []
296296
roots = []
297297
for i, pi in enumerate(dCj.T):

0 commit comments

Comments
 (0)
0