FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/mplot3d/bars3d_demo.py at master · staticfloat/matplotlib · GitHub
staticfloat
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
mplot3d
/
bars3d_demo.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (17 loc) · 560 Bytes
Breadcrumbs
matplotlib
/
examples
/
mplot3d
/
bars3d_demo.py
Copy path
File metadata and controls
22 lines (17 loc) · 560 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
from
mpl_toolkits
.
mplot3d
import
Axes3D
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
111
,
projection
=
'3d'
)
for
c
,
z
in
zip
([
'r'
,
'g'
,
'b'
,
'y'
], [
30
,
20
,
10
,
0
]):
xs
=
np
.
arange
(
20
)
ys
=
np
.
random
.
rand
(
20
)
# You can provide either a single color or an array. To demonstrate this,
# the first bar of each set will be colored cyan.
cs
=
[
c
]
*
len
(
xs
)
cs
[
0
]
=
'c'
ax
.
bar
(
xs
,
ys
,
zs
=
z
,
zdir
=
'y'
,
color
=
cs
,
alpha
=
0.8
)
ax
.
set_xlabel
(
'X'
)
ax
.
set_ylabel
(
'Y'
)
ax
.
set_zlabel
(
'Z'
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL