Skip to content

Instantly share code, notes, and snippets.

@ghamarian
Created June 7, 2022 21:58
Show Gist options
  • Save ghamarian/622f84457063b5ebdb5dbe5d7bc31de1 to your computer and use it in GitHub Desktop.
Save ghamarian/622f84457063b5ebdb5dbe5d7bc31de1 to your computer and use it in GitHub Desktop.
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
xs = []
ys = []
def animate(i):
#df = pd.read_csv('progresshistory.txt', sep=' ', names=['cup', 'fraction', 'date', 'time', 'cest1', "cest2", "m"])
#df.time = pd.to_datetime(df.time).view('int64')/1e6
df = pd.read_csv('amir.txt')
df.columns = ['cup', 'fraction', 'time']
df['time'] = pd.to_datetime(df['time']).view('int64')/1e6
ys = df['time'].diff()[-20:]
ax1.clear()
ax1.plot(ys)
#animate(0)
anim = animation.FuncAnimation(fig, animate, interval=100)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment