Walking through matplotlib\'s animation example on my Mac OSX machine - http://matplotlib.org/examples/animation/simple_anim.html - I am getting this error:-
You can avoid the problem by switching to a different backend:
import matplotlib
matplotlib.use('TkAgg')
Just set
blit=False
when animation.FuncAnimation() is called and it will work.
For instance (from double_pendulum_animated):
ani = animation.FuncAnimation(fig, animate, np.arange(1, len(y)), interval=25, blit=False, init_func=init)
Looks like it's a known (and unresolved at this time of writing) issue - https://github.com/matplotlib/matplotlib/issues/531
As noted at https://mail.python.org/pipermail/pythonmac-sig/2012-September/023664.html use:
import matplotlib
matplotlib.use('TkAgg')
#just *before*
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
This has worked for me with Tkinter installed using the ActiveState Tkinter installation on OSX 10.11.6, Python 2.71 The basic animation example is still a little noisy until blt=False in the line_ani code here:
line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l),
interval=50, blit=False)