Commit c3c3572c authored by Jacky Lin's avatar Jacky Lin
Browse files

a

parent ebc15b30
%% Cell type:code id: tags:
``` python
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import time
k = np.random.uniform(size = 10)
fig, ax = plt.subplots()
xdata, ydata = [], []
ln, = plt.plot([], [], 'ro')
def init():
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
return ln,
def update(i):
xdata.append(k[i])
ydata.append(k[i])
ln.set_data(k[i],k[i])
time.sleep(1)
return ln,
ani = FuncAnimation(fig, update, frames = len(k) + 1,
init_func=init, blit=True)
plt.show()
```
%%%% Output: display_data
%% Cell type:code id: tags:
``` python
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment