File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ dependencies:
29
29
- numpydoc>=0.8
30
30
- packaging
31
31
- pydata-sphinx-theme
32
- - scipy
33
32
- sphinx>=1.8.1,!=2.0.0
34
33
- sphinx-copybutton
35
34
- sphinx-gallery>=0.10
Original file line number Diff line number Diff line change 10
10
11
11
from matplotlib .collections import PolyCollection
12
12
import matplotlib .pyplot as plt
13
+ import math
13
14
import numpy as np
14
- from scipy .stats import poisson
15
15
16
16
# Fixing random state for reproducibility
17
17
np .random .seed (19680801 )
@@ -31,7 +31,9 @@ def polygon_under_graph(x, y):
31
31
lambdas = range (1 , 9 )
32
32
33
33
# verts[i] is a list of (x, y) pairs defining polygon i.
34
- verts = [polygon_under_graph (x , poisson .pmf (l , x )) for l in lambdas ]
34
+ gamma = np .vectorize (math .gamma )
35
+ verts = [polygon_under_graph (x , l ** x * np .exp (- l ) / gamma (x + 1 ))
36
+ for l in lambdas ]
35
37
facecolors = plt .colormaps ['viridis_r' ](np .linspace (0 , 1 , len (verts )))
36
38
37
39
poly = PolyCollection (verts , facecolors = facecolors , alpha = .7 )
You can’t perform that action at this time.
0 commit comments