'Manipulating quaternions in a 3D plot with Python and putting the animation in a LaTeX PDF document

I'm currently working on a project that combines Python, Latex and Quaternions. Right now, I'm building a report with LaTeX while using Python. In the near future, I will simulate the rotations of a gyroscope with my knowledge of quaternions but I want to be able to set up everything in the first place.

I want to be able to put an animated 3D plot in a PDF build with LaTeX but I do not know how

here's my plot but the animation won't show up

Here's a link of what the demo is supposed to look like (upload by the user Ophir Carmi: 3D animation using matplotlib)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source