File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ dependencies:
2929 - numpydoc>=0.8
3030 - packaging
3131 - pydata-sphinx-theme
32- - scipy
3332 - sphinx>=1.8.1,!=2.0.0
3433 - sphinx-copybutton
3534 - sphinx-gallery>=0.10
Original file line number Diff line number Diff line change 1010
1111from matplotlib .collections import PolyCollection
1212import matplotlib .pyplot as plt
13+ import math
1314import numpy as np
14- from scipy .stats import poisson
1515
1616# Fixing random state for reproducibility
1717np .random .seed (19680801 )
@@ -31,7 +31,9 @@ def polygon_under_graph(x, y):
3131lambdas = range (1 , 9 )
3232
3333# 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 ]
3537facecolors = plt .colormaps ['viridis_r' ](np .linspace (0 , 1 , len (verts )))
3638
3739poly = PolyCollection (verts , facecolors = facecolors , alpha = .7 )
You can’t perform that action at this time.
0 commit comments