def simulate(foo):
plt.cla()
for key in plotdata.keys():
plt.plot(plotdata[key],label = key[:-1],color = key[-1])
#do some stuff with data
ani = ani.FuncAnimation(plt.gcf(), simulate, interval = secsbetweengenerations * 100)
plt.legend()
plt.show()
The data is never empty, and the contents of them are always floats between 0 and 1. It shows an empty graph tho
I tried to remove
plt.cla()
and add
plt.axis([0,plotrange-1,0,1])
before the animation