this is messey - dont hate me later

This commit is contained in:
Lucas Oskorep
2019-11-01 16:46:21 -05:00
parent c9ed476230
commit 6b6455ee2c
9 changed files with 1112 additions and 923 deletions
+29
View File
@@ -0,0 +1,29 @@
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
def animate(i):
graph_data = open('example.txt','r').read()
lines = graph_data.split('\n')
xs = []
ys = []
for line in lines:
if len(line) > 1:
x, y = line.split(',')
xs.append(float(x))
ys.append(float(y))
ax1.clear()
ax1.plot(xs, ys)
ani = animation.FuncAnimation(fig, animate, interval=100)
plt.show()