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 plt.show()
and drag
It's a bit of a hack, but if you are using Jupyter notebook you can use cell magics to run the command line version of ffmpeg directly from the notebook itself. In one cell run your script to generate raw frames
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%d.png" % ii)
Now, in a new notebook cell, enter the following and then run the cell
%%bash
ffmpeg -r 30 -i movie%d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4