From 11b5e18fe36e34e128ba80cafbd085088bfde35a Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 21 Jul 2020 11:46:00 -0600 Subject: [PATCH] Backport PR #17994: Special case degree-1 Bezier curves. --- lib/matplotlib/bezier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index f2960cfcd25e..b36e2c1aef0a 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -288,10 +288,10 @@ def axis_aligned_extrema(self): 0` """ n = self.degree + if n <= 1: + return np.array([]), np.array([]) Cj = self.polynomial_coefficients dCj = np.arange(1, n+1)[:, None] * Cj[1:] - if len(dCj) == 0: - return np.array([]), np.array([]) dims = [] roots = [] for i, pi in enumerate(dCj.T):