This tag is for questions related to the matplotlib animation API
Questions tagged [matplotlib-animation]
383 questions
0
votes
0 answers
Matplotlib Animation Not Saving
I have a Finite Difference Simulation that is plotted with the following command:
anim = ani.FuncAnimation(fig, update, init_func = init, frames = np.linspace(0, t_max, int(t_max / dt + 1)), repeat = False) # repeat = False
plt.show()
This gives a…

Jacob Ivanov
- 77
- 9
0
votes
0 answers
Animation of points on ellipse using matplotlib
I've tried to model the circle shape in presence of gravitational waves, but the points lying on the x-axis don't move.
I computed the dependence of this component by hand, and it should change with time. It seems like something is wrong with the…

MMMikhno
- 1
0
votes
1 answer
Scatterplot animate trajectory with fading trail
I have a df containing x,y coordinates of a mouse's snout that I want to use for an animated scatterplot. Currently, I have the code for a static scatterplot.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import…

Brian Constantinescu
- 113
- 4
0
votes
0 answers
Spinning globe GIF with cartopy
I'm failing to find the most efficient way to generate a simple animation of a spinning globe with a filled contour using cartopy. The following code yields a static gif, probably because the figure is not redrawing itself? Is there a way for the…

Mathieu
- 241
- 1
- 8
0
votes
0 answers
Live Matplotlib plot is empty
def simulate(foo):
plt.cla()
for key in plotdata.keys():
plt.plot(plotdata[key],label = key[:-1],color = key[-1])
#do some stuff with data
ani = ani.FuncAnimation(plt.gcf(), simulate, interval = secsbetweengenerations *…

TadoTheMiner
- 1
- 1
0
votes
0 answers
Matplotlib Animation Saving Errno 22
I have an issue regarding saving animations in matplotlib. In the middle of the process, this error emerges:
anim.save(adress, writer=writervideo)
File "C:\\Users\\Shayan\\anaconda3\\lib\\site-packages\\matplotlib\\animation.py", line 1085, in…
0
votes
1 answer
How to playback audio segments in Python and follow it in a MatPlotLib chart?
OS: Windows 11
Python: 3.9
I can extract a number of audio features from .WAV files by using OpenSMILE and plot them with MatPlotLib. I can also select segments by clicking that chart (like, a segment of 3 seconds starting as second 10).
What I need…

AlexSC
- 1,823
- 3
- 28
- 54
0
votes
1 answer
Change data of matplotlib 3D scatterplot after construction
I have a 3d scatterplot that needs updating.
however, there is no variable that lets me address single datapoints.
self.fig = plt.figure(figsize=(8, 8))
self.ax = self.fig.add_subplot(111, projection='3d')
data_point = self.ax.scatter(xs=0, ys=0,…

I Me
- 3
- 4
0
votes
1 answer
Bar Chart Race with matplotlib: Bars changing colors
I’m trying to write a Bar Chart Race with matplot. I don’t use the "bar_chart_race" library because I need more options for customization later. But I use the basic explanations of the same autor:…

Palladium46
- 3
- 2
0
votes
0 answers
Live-Updating Graph
So I have the following code:
class GooglePage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
label = tk.Label(self, text="Google (GOOG)", font=LARGEFONT)
label.pack(pady=10,padx=10)
…

Skyboy112
- 1
- 1
0
votes
1 answer
FuncAnimation doesn't display animation
I have code that is running on a different machine.
%matplotlib widget
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
n = 100
x = np.random.randn(n)
def update(curr):
if curr == n:
…

Николай Чурилов
- 1
- 1
0
votes
1 answer
How to matplotlib blit artist outside axes?
https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html
Im trying to make a cross hair cursor with a annotation on the right axis to show the Y-value
everything works fine except when the artist / annotation is drawn outside the…

Beginner
- 1
0
votes
0 answers
Adding time spending indication on a matplotlib funcanimation window
I'm asking my question here because I haven't find any information that could solve my problem. With FuncAnimation, I'm plotting the coordinates of a moving point on a world map. Every coordinates that I take from a CSV file come from a function…

rom1
- 1
- 1
0
votes
0 answers
Why does matplotlib draw `Title` artists over one another in an animation using `FuncAnimation` (but the same doesn't happen with a `plot`)?
Consider the following animation in python written in a file test.py
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
fig, ax = plt.subplots()
title = fig.suptitle("Test _")
p, = ax.plot([0,2],…

evianpring
- 3,316
- 1
- 25
- 54
0
votes
1 answer
Animated MatPlotLib Frame Update Bug
I am attempting to make an animated plot of a theoretical Falcon 9 disaster trajectory due to an engine failure. However, my code, shown below:
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from…

Jacob Ivanov
- 77
- 9