Skip to content

Commit b66d00d

Browse files
authored
Merge pull request #23062 from story645/plot-types
Add stackplot to plot types listing
2 parents dfb7abc + e34f404 commit b66d00d

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

lib/matplotlib/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ ytick.major.size: 0.0
1616

1717
# colors:
1818
image.cmap : Blues
19-
# axes.prop_cycle: cycler('color', ['FF7F0E', '1F77B4', '2CA02C'])
19+
axes.prop_cycle: cycler('color', ['1f77b4', '82bbdb', 'ccdff1'])

lib/matplotlib/mpl-data/stylelib/_mpl-gallery.mplstyle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ ytick.major.size: 0.0
1616

1717
# colors:
1818
image.cmap : Blues
19-
# axes.prop_cycle: cycler('color', ['FF7F0E', '1F77B4', '2CA02C'])
19+
axes.prop_cycle: cycler('color', ['1f77b4', '58a1cf', 'abd0e6'])

plot_types/basic/stackplot.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
===============
3+
stackplot(x, y)
4+
===============
5+
See `~matplotlib.axes.Axes.stackplot`
6+
"""
7+
import matplotlib.pyplot as plt
8+
import numpy as np
9+
10+
plt.style.use('_mpl-gallery')
11+
12+
# make data
13+
x = np.arange(0, 10, 2)
14+
ay = [1, 1.25, 2, 2.75, 3]
15+
by = [1, 1, 1, 1, 1]
16+
cy = [2, 1, 2, 1, 2]
17+
y = np.vstack([ay, by, cy])
18+
19+
# plot
20+
fig, ax = plt.subplots()
21+
22+
ax.stackplot(x, y)
23+
24+
ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
25+
ylim=(0, 8), yticks=np.arange(1, 8))
26+
27+
plt.show()

0 commit comments

Comments
 (0)