This tag is for questions related to the matplotlib animation API
Questions tagged [matplotlib-animation]
383 questions
6
votes
8 answers
Matplotlib animation either freezes after a few frames or just doesn't work
I've been trying for hours to get this simple script working, but nothing I do seems to help. It's a slight modification of the most basic animated plot sample code from the Matplotlib website, that should just show a few frames of noise (I have the…

Roger
- 403
- 2
- 5
- 11
6
votes
1 answer
Saving scatterplot animations
I've been trying to save an animated scatterplot with matplotlib, and I would prefer that it didn't require totally different code for viewing as an animated figure and for saving a copy. The figure shows all the datapoints perfectly after the save…

Poik
- 2,022
- 27
- 44
5
votes
1 answer
Animating a line plot over time
Time series data is data over time. I am trying to animate a line plot of time series data in python. In my code below this translates to plotting xtraj as they and trange as the x. The plot does not seem to be working though.
I have found similar…

user4933
- 1,485
- 3
- 24
- 42
4
votes
1 answer
How to animate Poly3DCollection using FuncAnimation with blit=True?
I'm trying to animate a rotating cube. For that I use Poly3DCollection and animate it using FuncAnimation:
anim = animation.FuncAnimation(fig, visualize_rotation, fargs=[collection],
init_func=partial(init_func, ax,…

fdermishin
- 3,519
- 3
- 24
- 45
4
votes
1 answer
Matplotlib animation of a step
I creating a Matplotlib animation of a step function. I am using the following code...
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
fig = plt.figure()
ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))
line, =…

Marmstrong
- 1,686
- 7
- 30
- 54
4
votes
1 answer
Is it possible to update quiver position coordinates in an animation?
I'd like to draw and animate some particles with matplotlib. Each point has a position and velocity. I am able to draw single frames using matplotlib quiver.
But how can I update the quiver data for each frame? (I am using the matplotlib animation…

M-V
- 5,167
- 7
- 52
- 55
3
votes
3 answers
How to move a patch along a path?
I am trying to animate a patch.Rectangle object using matplotlib. I want the said object to move along a path.Arc.
A roundabout way to do this would be (approximately) :
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import…

Adrials
- 55
- 7
3
votes
1 answer
animate network graph
I would like to draw a dynamic network to show how it changes over time as new observations are added.
I've found how to animate a network given two single states (here called s_pos, t_pos), but what i'm looking for goes a little further, as I would…

Kamaloka
- 81
- 5
3
votes
1 answer
Plotting vertical lines in matplotlib.animation over a scatter plot
I am wanting to use matplotlib.annimation to sequentially plot data points and plot vertical lines as they become known.
What I have at the moment is the following:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import…

math111
- 127
- 5
3
votes
1 answer
Suppress display of final frame of animation in jupyter
I am working on a project that involves generating a matplotlib animation using pyplot.imshow for the frames. I am doing this in a jupyter notebook. I have managed to get it working, but there is one annoying bug (or feature?) left. After the…

dpgoldenberg
- 33
- 2
3
votes
2 answers
Matplotlib animation error "Requested MovieWriter (ffmpeg) not available"
I'm trying to run an animation using matplotlib FuncAnimation and I keep running into the error
"Requested MovieWriter (ffmpeg) not available". I realize this question has been asked before, and I have looked at every response to this and none have…

Melissa Ingle
- 69
- 5
3
votes
2 answers
Animating a 3D vector
I need to animate both the magnitude and the position of a vector arrow in a 3D figure with matplotlib. As far as I can tell, I cannot animate the position of the vectors with Axes3D.quiver and there is no matplotlib.pyplot.arrow for a 3D figure. Is…

Muxxy
- 43
- 1
- 3
2
votes
1 answer
How can reproduce animation for rolling window over time?
I'm experimenting with 1D time-series data and trying to reproduce the following approach via animation over my own data in GoogleColab notebook.
It's about reproducing the animation of STS transformation (implemented by series_to_supervised()…

Mario
- 1,631
- 2
- 21
- 51
2
votes
0 answers
Difficulty to insert an interactive figure inside Tkinter
I'm struggling with this issue for some time so I have decided to finally ask here.
First of the code is available at this adress: https://github.com/ChrisZeThird/Game-Of-Life/tree/main/ObjectOriented (it would be too long to copy and paste it).
I…

Chris Ze Third
- 632
- 2
- 18
2
votes
1 answer
How can I make an animation of a surface with a high fps number?
I have the following code in python to convert a plot into an animation.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.animation import…

AmolosRicha1
- 21
- 1