FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/mplot3d/scatter3d_demo.py at master · ryanfreckleton/matplotlib · GitHub
ryanfreckleton
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
mplot3d
/
scatter3d_demo.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (17 loc) · 527 Bytes
Breadcrumbs
matplotlib
/
examples
/
mplot3d
/
scatter3d_demo.py
Copy path
File metadata and controls
22 lines (17 loc) · 527 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
import
numpy
as
np
from
mpl_toolkits
.
mplot3d
import
Axes3D
import
matplotlib
.
pyplot
as
plt
def
randrange
(
n
,
vmin
,
vmax
):
return
(
vmax
-
vmin
)
*
np
.
random
.
rand
(
n
)
+
vmin
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
111
,
projection
=
'3d'
)
n
=
100
for
c
,
m
,
zl
,
zh
in
[(
'r'
,
'o'
,
-
50
,
-
25
), (
'b'
,
'^'
,
-
30
,
-
5
)]:
xs
=
randrange
(
n
,
23
,
32
)
ys
=
randrange
(
n
,
0
,
100
)
zs
=
randrange
(
n
,
zl
,
zh
)
ax
.
scatter
(
xs
,
ys
,
zs
,
c
=
c
,
marker
=
m
)
ax
.
set_xlabel
(
'X Label'
)
ax
.
set_ylabel
(
'Y Label'
)
ax
.
set_zlabel
(
'Z Label'
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL