FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/plot_types/basic/stackplot.py at v3.7.x · matplotlib/matplotlib · GitHub
matplotlib
matplotlib
Repository navigation
Code
Issues
1k
(1k)
Pull requests
425
(425)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
plot_types
/
basic
/
stackplot.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 464 Bytes
Breadcrumbs
matplotlib
/
plot_types
/
basic
/
stackplot.py
Copy path
File metadata and controls
27 lines (21 loc) · 464 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
===============
stackplot(x, y)
===============
See `~matplotlib.axes.Axes.stackplot`
"""
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
plt
.
style
.
use
(
'_mpl-gallery'
)
# make data
x
=
np
.
arange
(
0
,
10
,
2
)
ay
=
[
1
,
1.25
,
2
,
2.75
,
3
]
by
=
[
1
,
1
,
1
,
1
,
1
]
cy
=
[
2
,
1
,
2
,
1
,
2
]
y
=
np
.
vstack
([
ay
,
by
,
cy
])
# plot
fig
,
ax
=
plt
.
subplots
()
ax
.
stackplot
(
x
,
y
)
ax
.
set
(
xlim
=
(
0
,
8
),
xticks
=
np
.
arange
(
1
,
8
),
ylim
=
(
0
,
8
),
yticks
=
np
.
arange
(
1
,
8
))
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL