Skip to content

Instantly share code, notes, and snippets.

@sadimanna
Last active August 2, 2020 03:20
Show Gist options
  • Select an option

  • Save sadimanna/1fdba90cbbabb758479f49f25961c72d to your computer and use it in GitHub Desktop.

Select an option

Save sadimanna/1fdba90cbbabb758479f49f25961c72d to your computer and use it in GitHub Desktop.
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_wireframe(X, Y, datapts,color='goldenrod')
def animate(i):
# "i" is updated for each frame i = 10 when frame = 10
# for 360 frames, azim will take 360 values for a round display of the 3D plot
ax.view_init(elev=10., azim=i)
return fig,
# ANIMATE
anim = animation.FuncAnimation(fig, animate, init_func=None,
frames=360, interval=20, blit=True)
anim.save('3D_animated_plot.mp4', fps=10, extra_args=['-vcodec', 'libx264'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment