Skip to content

Commit 682ef5d

Browse files
authored
Merge pull request matplotlib#22120 from anntzer/unscipy
Drop dependency on scipy in the docs.
2 parents 980f313 + d89d3e0 commit 682ef5d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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)

requirements/doc/doc-requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ sphinxcontrib-svg2pdfconverter>=1.1.0
1818
sphinx-gallery>=0.10
1919
sphinx-copybutton
2020
sphinx-panels
21-
scipy

0 commit comments

Comments
 (0)