So I have some phone accelerometry data and I would like to basically make a video of what the motion of the phone looked like. So I used matplotlib to create a 3D graph of the data:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import pandas as pd
import pickle
def pickleLoad(pickleFile):
pkl_file = open(pickleFile, 'rb')
data = pickle.load(pkl_file)
pkl_file.close()
return data
data = pickleLoad('/Users/ryansaxe/Desktop/kaggle_parkinsons/accelerometry/LILY_dataframe')
data = data.reset_index(drop=True)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
xs = data['x.mean']
ys = data['y.mean']
zs = data['z.mean']
ax.scatter(xs, ys, zs)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
Now time is important and is actually also a factor that I only see one point at a time because time is also a factor and it lets me watch the progression of the accelerometry data!
What can I do with this to make it a live updating graph?
Only thing I can think of is to have a loop that goes through row by row and makes the graph from the row, but that will open so many files that it would be insane because I have millions of rows.
So how can I create a live updating graph?