import matplotlib.pyplot as plt
import matplotlib.animation as animation
%matplotlib inline
def updatefig(i):
fig = plt.gcf()
ax = plt.gca()
ax.plot(i,i, "o")
updatefig(10) # works
plt.figure()
# running the following lines (actually the save, which seems to run the functions)
# crashes the interpreter
ani = animation.FuncAnimation(plt.gcf(), updatefig, frames=40)
ani.save('movie.mp4')