I have the following animated subplots that simulate histograms of four different distributions:
import numpy
from matplotlib.pylab import *
import matplotli
Got it!
My iterating over n was the culprit. This does what I expected:
def updateData(curr):
curr2=100+curr*5
#if curr == n:
# a.event_source.stop()
ax1.hist(x1[:curr2], normed=True, bins=20, alpha=0.5)
ax2.hist(x2[:curr2], normed=True, bins=20, alpha=0.5)
ax3.hist(x3[:curr2], normed=True, bins=20, alpha=0.5)
ax4.hist(x4[:curr2], normed=True, bins=20, alpha=0.5)
simulation = animation.FuncAnimation(fig, updateData, frames=900, interval=10)
plt.show()