Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b66d00d

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

File tree

Expand file treeCollapse file tree

3 files changed

+29
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+29
-2
lines changed

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

Copy file name to clipboardExpand all lines: lib/matplotlib/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboardExpand all lines: lib/matplotlib/mpl-data/stylelib/_mpl-gallery.mplstyle
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboard
+27Lines changed: 27 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.