I am trying to animate the numpy array C3, this is an array with one channel of electrode data and I want to plot it in real time using matplotlib.
I have created my update function but nothing is printing out, I though the the syntax is you pass i through to loop through the plots and the FuncAnimation should do the rest.
Can someone please point me in the right direction?
Much appreciated!
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
data_skip = 50
def update_plot(i):
plt.cla()
plt.plot(C3[i:i+data_skip], t[i:i+data_skip])
plt.scatter(C3[i], t[i], marker='o', color='r')
plt.tight_layout()
plt.show()
ani = FuncAnimation(plt.gcf(), update_plot, interval=1000)
plt.tight_layout()
plt.show()