Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import random
|
2 |
+
import streamlit as st
|
3 |
+
from intertools import count
|
4 |
+
from pandas as pd
|
5 |
+
import matplotlib.pyplot as plt
|
6 |
+
|
7 |
+
plt.style.use('fivethirtyeight')
|
8 |
+
|
9 |
+
x_vals = []
|
10 |
+
y_vals = []
|
11 |
+
|
12 |
+
def animate(i):
|
13 |
+
x_vals.append(next(index))
|
14 |
+
y_vals.append(random.randint(0,5))
|
15 |
+
|
16 |
+
plt.plot(x_vals, y_vals)
|
17 |
+
|
18 |
+
ani = FuncAnimation(plt.gcf(), animate, interterval=1000)
|
19 |
+
|
20 |
+
plt.tight_layout()
|
21 |
+
|
22 |
+
|
23 |
+
st.write(plt.show())
|