Added covariance ellipse animatoin.

This commit is contained in:
Roger Labbe committed 2014-09-15 20:07:26 -07:00
1 parent ee15475c3d
commit d8336ceae7
5 files changed
+527 -59

No files matched your search

+3 -2
View File
@@ -8,7 +8,7 @@ Created on Sun Sep 14 12:41:24 2014
from matplotlib import animation
import matplotlib.pyplot as plt
def animate(filename, func, frames, interval, figsize=(6.5, 6.5)):
def animate(filename, func, frames, interval, fig=None, figsize=(6.5, 6.5)):
""" Creates an animated GIF of a matplotlib.
Parameters
@@ -43,7 +43,8 @@ def animate(filename, func, frames, interval, figsize=(6.5, 6.5)):
return
func(frame)
fig = plt.figure(figsize=figsize)
if fig is None:
fig = plt.figure(figsize=figsize)
forward.first = True
anim = animation.FuncAnimation(fig, forward, frames=frames, interval=interval)
anim.save(filename, writer='imagemagick')