Last active
August 2, 2020 03:20
-
-
Save sadimanna/1fdba90cbbabb758479f49f25961c72d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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