fig = plt.figure()
plt.hold(True)
plt.pcolormesh(X[0:1], Y[0:1], C[0:1])
anim = animation.FuncAnimation(fig, animate, frames=list(range(2, 155)), blit=False)
plt.show()
plt.hold(False)

def animate(self, i):
    plt.title('Ray: %.2f' % i)
plt.pcolormesh(X[i - 2:i], Y[i - 2:i], C[i - 2:i])
Animating a Quadmesh from pcolormesh with matplotlib