Skip to content
Advertisement

Matplotlib – Delete lines from a 3d quiver plot

I would like to graphically represent the time trend of a three-dimensional reference frame using Matplotlib and the quiver function. In an event, I simulated the data representing the reference frame through the definition of a 3×3 rotation matrix. Each time the event occurs, it should delete the previous reference frame and display the new one. Here is my code in Python:

JavaScript

This code works fine except for the missing delete function. In a 2d plot, I used this code to delete annotations

JavaScript

and this command to delete the first plotted line

JavaScript

Any suggestion? Thank you in advance!

Advertisement

Answer

If you keep track of the quiver artists, you can use them to remove the previously plotted quivers:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement