FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/examples/animation/random_data.py at master · abhiip/matplotlib.github.com · GitHub
abhiip
/
matplotlib.github.com
Public
forked from
matplotlib/matplotlib.github.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
examples
/
animation
/
random_data.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (20 loc) · 456 Bytes
Breadcrumbs
matplotlib.github.com
/
examples
/
animation
/
random_data.py
Copy path
File metadata and controls
29 lines (20 loc) · 456 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
28
29
"""
===========
Random data
===========
An animation of random data.
"""
import
numpy
as
np
import
matplotlib
.
pyplot
as
plt
import
matplotlib
.
animation
as
animation
fig
,
ax
=
plt
.
subplots
()
line
,
=
ax
.
plot
(
np
.
random
.
rand
(
10
))
ax
.
set_ylim
(
0
,
1
)
def
update
(
data
):
line
.
set_ydata
(
data
)
return
line
,
def
data_gen
():
while
True
:
yield
np
.
random
.
rand
(
10
)
ani
=
animation
.
FuncAnimation
(
fig
,
update
,
data_gen
,
interval
=
100
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL