Moving objects in matplotlib animation

Published: 09 December 2021
on channel: J O
1,349
7

Link to git repo:
https://github.com/johanoxenstierna/m...

10:30 set_extent()
14:00 set_tranform()
19:20 warpAffine()

I've only managed to get blitting working when the "im_ax" drawables is a list. But if one has to "remove" an ax object each frame (e.g. to use "imshow") a list can be a bit inconvenient. One way to fix it (for larger animation projects), is to have a variable which gives the index inside the "im_ax" where an object is located (index_in_im_ax). Then one can loop through those objects, then for each object check its index_in_im_ax, "del" it and then "insert" it back at its index_in_im_ax, once the object has been redrawn.


On this page of the site you can watch the video online Moving objects in matplotlib animation with a duration of hours minute second in good quality, which was uploaded by the user J O 09 December 2021, share the link with friends and acquaintances, this video has already been watched 1,349 times on youtube and it was liked by 7 viewers. Enjoy your viewing!