Thanks to visit codestin.com Credit goes to github.com
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 f666d95 commit e2a5dc1Copy full SHA for e2a5dc1
lib/matplotlib/bezier.py
@@ -9,7 +9,12 @@
9
10
import matplotlib.cbook as cbook
11
12
-_comb = np.vectorize(math.comb)
+# same algorithm as 3.8's math.comb
13
+def _comb(n, k):
14
+ k = min(k, n - k)
15
+ i = np.arange(1, k + 1)
16
+ return np.prod((n + 1 - i)/i).astype(int)
17
+_comb = np.vectorize(_comb)
18
19
class NonIntersectingPathException(ValueError):
20
pass
@@ -277,6 +282,7 @@ def polynomial_coefficients(self):
277
282
278
283
"""
279
284
n = self.degree
285
+ # matplotlib uses n <= 4. overflow plausible starting around n = 15.
280
286
if n > 10:
281
287
warnings.warn("Polynomial coefficients formula unstable for high "
288
"order Bezier curves!", RuntimeWarning)
0 commit comments