Rotation animation of 3D graph
Code
Since this version does not work well on jupyter notebook, I rewrite it using by FuncAnimation.
Code (using FuncAnimation)
Explanation
Test data was loaded.
This is the setting of the animation graph to display first.
This is a setting of animation, setting to change viewpoint.
elev is an abbreviation for Elevation viewing angle, setting the height of the viewpoint. (default = 30).
azim is an abbreviation for Azimuthal viewing angle, setting the azimuth angle. (default = -60).
fig is a figure object that displays animation.
animate is a function related to animation, which is set to rotate horizontally by 3.6 °.
init_func is the setting of fig initialization.
frame is the number of frames of the entire animation.
interval is the display interval, interval is 100 [ms] and frames is 100, it is animation of 10 [s].
If blit is set to True, animation will be optimized and it will not be stiff.
Output ani as HTML5 video.
When blit = False
Although image quality improves, the file is heavy. (1.1 M)
Hide axis and grid
The grid disappears with grid (False), the axis disappears with set_axis_off ().
Reference
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fcdn.qiita.com%2Fassets%2Fpublic%2Farticle-ogp-background-412672c5f0600ab9a64263b751f1bc81.png?ixlib=rb-4.0.0&w=1200&mark64=aHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTk3MiZoPTM3OCZ0eHQ9TWF0cGxvdGxpYiUyMCUzRSUyMHZpZXdfaW5pdCUyOGVsZXYlM0ROb25lJTJDJTIwYXppbSUzRE5vbmUlMjklRTMlODElQUUlRTMlODMlODclRTMlODMlOTUlRTMlODIlQTklRTMlODMlQUIlRTMlODMlODglRTUlODAlQTQlMjAlM0UlMjBlbGV2JTIwJTNEJTIwMzAlMkMlMjBhemltJTIwJTNEJTIwLTYwJnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmcz0zZmRiYTg5NmI3NDFjOWM2YTg0ODI0OWIwZWJlNmNhYg&mark-x=142&mark-y=57&blend64=aHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZoPTc2Jnc9NzcwJnR4dD0lNDA3b2Y5JnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz0xZTA5Yzg5MmE1OTkxM2RhNDZlNzI0OTRmYjA4ZTEyOQ&blend-x=142&blend-y=486&blend-mode=normal&s=01d9e617203ce3b8c31c30286fe6ddfe)
コメント