Modified animation script to be compatible with OSX version of matplotlib