title: Animate a rotating 3D graph in matplotlib
body: <p>I have a scatter plot set up and plotted the way I want it, and I want to create an .mp4 video of the figure rotating in space, as if I had used <code>plt.show()</code> and dragged the viewpoint around. </p>
  
  <p><a href="https://stackoverflow.com/a/12905458/326402">This answer</a> is almost exactly what I want, except to save a movie I would have to manually call into FFMpeg with a folder of images. Instead of saving individual frames I'd prefer to use Matplotlib's built in animation support. Code reproduced below:</p>
  
  <pre><code>from mpl_toolkits.mplot3d import Axes3D
  ax = Axes3D(fig)
  ax.scatter(xx,yy,zz, marker='o', s=20, c="goldenrod", alpha=0.6)
  for ii in xrange(0,360,1):
      ax.view_init(elev=10., azim=ii)
      savefig("movie"%ii+".png")
  </code></pre>