Skip to content

Commit 040cae7

Browse files
committed
Drop dependency on scipy in the docs.
1 parent d9ef0a7 commit 040cae7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

environment.yml

-1
Original file line numberDiff line numberDiff 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

examples/mplot3d/polys3d.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
from matplotlib.collections import PolyCollection
1212
import matplotlib.pyplot as plt
13+
import math
1314
import numpy as np
14-
from scipy.stats import poisson
1515

1616
# Fixing random state for reproducibility
1717
np.random.seed(19680801)
@@ -31,7 +31,9 @@ def polygon_under_graph(x, y):
3131
lambdas = 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]
3537
facecolors = plt.colormaps['viridis_r'](np.linspace(0, 1, len(verts)))
3638

3739
poly = PolyCollection(verts, facecolors=facecolors, alpha=.7)

0 commit comments

Comments
 (0)