414 questions
0
votes
1
answer
7k
views
cannot import name 'inv' from 'numpy.linalg' (unknown location)
import matplotlib.animation as animation
The error show up when I import matplotlib.animation
I tried to reinstall numpy scipy and matplotlib, but it didn't work
environment list
-torch=1.12.1 ...
2
votes
1
answer
419
views
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 PillowWriter
fig,...
-1
votes
2
answers
4k
views
ValueError: assignment destination is read-only
My goal is to make aliasing in python but actually i have problem ValueError: assignment destination is read-only. This because of this line
numpy_new[:lines * k][:][:] = numpy_last
And I don't know ...
1
vote
1
answer
398
views
How to real-time update a Histogram in a Jupyter notebook?
So i have my initial array 'P' with the same number (500) 100 times
I made a while loop to randomly update two numbers in the P array (number 1 will lose/win 75 points so number 2 will do the opposite)...
1
vote
0
answers
124
views
How to interactively change the parameters of an matplotlib.Animation?
Good morning,
I have set up a code that:
Asks the user to provide the value of a certain parameter through a slider
On the basis of the given parameter, it solves an equation in the time domain
It ...
1
vote
0
answers
152
views
Animated Scatter Plots between two Points at Tkinter Matplotlib Canvas
I have Tkinter Matplotlib canvas with scatter plot with 2 dots inside a polygon once click the "show polygon" button. As a part of my exercise, I have coded to include 4 intermediate dots ...
1
vote
0
answers
86
views
Animating Newton Raphson Iteration using matplotlib
I am trying to create this animation using Matplotlib animation features in Python.
Unfortunately, I am not able to figure out what would be the driving logic for keeping the main curve intact and ...
1
vote
1
answer
204
views
Creating Multi-Scene Animation using consecutive calls to Matplotlib.FuncAnimation creates flickered images
Context: I am trying to create a teaching demo tool to show how the iteration guesses through a set of points to ultimately arrive at the root of an equation
Problem: I want to animate using ...
1
vote
1
answer
138
views
How to animate plt.imshow with text?
I am trying to animate a simulation. I want to include the time of the simulation. I have written the following code:
import matplotlib.animation as animation
fig, ax = plt.subplots()
ims = []
for i ...
0
votes
2
answers
614
views
how to make a multi-colored line in matplotlib
I am trying to make a multicolor line plot using matplotlib. The color would change given a specific value in a column of my datataframe
time
v1
v2
state
0
3.5
8
0
1
3.8
8.5
0
2
4.2
9
1
3
5
12
0
4
8
...
0
votes
1
answer
330
views
How to specify start time in a python matplotlib animation?
I am animating a time series that has 3600 timesteps. I only want to plot timestep 1200 to 1800 in an animation, however I can only get the animation to run from the very first time step onwards. ...
0
votes
0
answers
1k
views
Getting <Figure size 432x288 with 0 Axes> while running matplotlib in anaconda
I wrote a program that should generate a dynamic graph that shows the frequency of each face of the 6-sided dice coming up but when I run my code in the console <Figure size 432x288 with 0 Axes> ...
1
vote
1
answer
595
views
Join successive scatter points when in loop matplotlib
I have a loop of two axes doing a scatter plot with a pause between points.
fig, ax = plt.subplots(2)
for i in range(10):
y = np.random.random()
x = np.random.random()
ax[0].scatter(i, y)
...
0
votes
1
answer
843
views
Interact with a Python plot using keys instead of dragging
Using Matplotlib I made a 3D simulation of some moving objects. Currently, it is defaulted in a way such that if I drag my cursor across the screen I can move the plot around and see the objects in ...
1
vote
1
answer
587
views
Fading animated scatterplot with multiple colors
I have 3 columns of data representing 3 pixels (x1, x2, x3), that update live.
I want to:
animate a scatter with x1 at x=1, x2 at x=2, x3 at x=3
have a distinct color for each of the pixels (x1=red, ...
0
votes
0
answers
242
views
matplotlib FuncAnimation into tkinter produces 2 graphs
I am trying to embed a matplotlib FuncAnimation live updating plot to a tkinter window but I am getting 2 plots (one inside the tkinter window and other as an extra matplotlib plot) as shown below.
...
1
vote
2
answers
671
views
How to remove a list of patches?
I want to make a very simple animation of 3 frames:
In the first frame there are only tree black circle,
In the second the same black circles and an arrow above the last one,
In the last there are 3 ...
0
votes
2
answers
346
views
How to use matplotlib to animate bubble plot along with years
The following dataset needs to be animated with years as a bubble plot. With the year, Life Expectancy(X-Axis) and GDP(Y-Axis) need to be changed.
df.head()
Following Image for the Year of 1960 :
...
0
votes
0
answers
221
views
What do I need in order to save animation videos from matplotlib in mp3 format?
I am using python3.8 on Linux Mint 19.3, and I am trying to save an animation created by a cellular automata model in matplotlib. My actual code for the model is private, but it uses the same code for ...
0
votes
0
answers
576
views
Why does each step of my animation take longer and longer than the last step to load? Is there a more efficient way to create and save an animation?
Here is my code. I'm using matplotlib.animation.FuncAnimation to create an animation that displays a series of images.
# Function that animates the FAI images
# Grabs the i'th member of nir_images ...
0
votes
1
answer
159
views
Adding labels to 3D plotlines in matplotlib.animation
I'm trying to add labels to animated 3D plotlines using matplotlib.animation. The sample code I am using is based on this example from the matplotlib example files
EDIT: full code is here:
import ...
3
votes
2
answers
19k
views
UserWarning: Animation was deleted without rendering anything
Note: only the last code chunk brings an error. The earlier chunks are to give context to the animation that I want. This is all in Jupyter for Windows.
I have a matplotlib pyplot with two line ...
0
votes
1
answer
235
views
matplotlib is returning empty plot
Click Here for the image
trying to plot an animated line chart in python. Why is this code returning to a blank white plot ? a guidance would be appreciated. And also if there is a better way to draw ...
0
votes
1
answer
167
views
Matplotlib animation: update axis ticks in pcolormesh
I'm creating an animation of an image with axis values varying over time.
All_data is a matrix that contains in one axe time frames inside there are 3 quatities which are longitude latitude and pixel ...
1
vote
1
answer
869
views
colorbar in matplotlib animation
I would like to add a colorbar to some data to make an animation.
However, I keep on creating new color bars in the figure and don't know how to remove them.
A reproducible example is:
import numpy as ...
0
votes
1
answer
115
views
I need some help on making an animated plot
I have an array x_trj that has shape (50,12), and I would like to make an animation for all the rows corresponding to certain columns in a 2-D plot (so I can see what direction each line is going). ...
1
vote
0
answers
64
views
Matplotlib FuncAnimation in Tkinter - Axes labels not being displayed/retained
I am using Python with TKinter as GUI; and Matplotlib's FuncAnimation, to display 2 graphs next to each other. These graphs are representing sensor readings (temperature, humidity), and I would like ...
0
votes
1
answer
123
views
Update the color of current rectangle in matplot animation
I want to animate the Bubble Sort algorithm with FuncAnimationfrom matplotlib. My idea is to generate a random list of integers and initialize a bar chart plot with the values. Then I apply the ...
0
votes
1
answer
1k
views
Moving sphere animation
I want to create an animation of a moving sphere in matplotlib. For some reason it isnt working:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib ...
0
votes
1
answer
164
views
Matplotlib not plotting anything
I am trying to animate a figure with 3 subplots for some data from a tensor log. I've made generator and animation functions which appear to yield the correct data, however when I do plt.show(), ...
0
votes
0
answers
48
views
Why do I get an error when running this example code?
I tried to run the example code from following site in Python 3.8:
https://www.demo2s.com/python/python-matplotlib-animation-animate-decay.html
However, I get the following error:
C:\Users\username\...
0
votes
1
answer
94
views
how to iterate on the color in matplotlib in a multiple plot animation
i am trying to plot an current-voltage acquisition from an instrument but for different temperatures. I need to keep the structure as presented but i would like to have for each temperature get the ...
1
vote
1
answer
950
views
Animate 3D surface over an initial 3D plot with matplotlib
I am trying to animate a 3D surface over an initial 3D plot. But am struggling with keeping the initial 3D plot on the animation. I have to call the clafunction to be able to plot the new surface and ...
0
votes
1
answer
223
views
Cleaning background in Matplotlib stackplot animation
I have a basic animation with a basic line plot, aka ax.plot(...). I modified it so it produces a stackplot instead of the lineplot (code snippet below).
Problem is the the plot doesn't seem to clean ...
2
votes
0
answers
1k
views
Matplotlib Animation requires an extreme amount of time to run
I'm working on a fairly simple matplotlib animation using animation.FuncAnimation and it takes a very long time to run; about 0.81s per frame and 180s for the 220 frames in an 11 second long video. I'...
0
votes
1
answer
91
views
Can someone help me write an animation function for this python code?
I am trying to learn how to animate this graph that calculates the integral of a function using the montecarlo method but to no success. I don't have much understanding of python, this is my first ...
0
votes
1
answer
553
views
How to plot data stream in 3D
Program Description: I have a phone sending gyroscope data every 2 seconds to a server. Every second I retrieve data from the server. The purpose of my program is to read this data stream and make a ...
0
votes
0
answers
63
views
Animate a predefined list in with matplotlib with known timestep
I generated two location lists (x and y coordinates).
Now I want to animate the movement(changing x and y) element after element.
The FuncAnimation function of matplotlib seems not to work. The ...
1
vote
0
answers
249
views
Matplotlib button doesn't respond until moving cursor
I have som problems with buttons/animations in matplotlib. I'm trying to make an animation that starts when the button "start" is clicked on and stop when "stop" is clicked on. The ...
0
votes
1
answer
431
views
Not able to animate using Funcanimation
I am using code from geekforgeek and copying it to jupyternotebook.
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation, writers
import numpy as np
fig = plt.figure(...
2
votes
2
answers
2k
views
Matplotlib animation not displaying correctly in Colab
I know there are previous answers to this question but for some reason I cannot seem to get the animation to show. Instead all the frames of the animation are overlayed in a figure that appears below ...
0
votes
0
answers
173
views
Backtrder animated plotting
Im looking for a way to animate backtest plotting of the Backtrder. I searched for appropriate tools and I found FuncAnimation:
FuncAnimation(figure, animation_function, frames=None, init_func=None, ...
2
votes
1
answer
1k
views
Matplotlib (or mplfinance) two animation.FuncAnimation with different intervals
In python matplotlib finance
Is it possible to have two different figures with animation.FuncAnimation in mplfinance where one has 12 axis with different style and another figure has two planes one ...
0
votes
1
answer
879
views
How to animate multiple arrays using matplotlib
I am attempting to show a sort of plot refresh on a sequence of array. Each array is an instance of the sequence and for each of them I want to plot the relative array, plus its smoothed version, like ...
2
votes
1
answer
3k
views
How to update scatter with plot?
I am updating the graph, but can't join to it the scatter, could someone help me, please? I don't understand, how to realize it.
from matplotlib import pyplot as plt
from matplotlib.animation import ...
0
votes
1
answer
276
views
How to set Timestamp (pandas Datetime) to xlim of plot with FunctAnimation?
I want to limit my graph from left and set (the current time - 2 hours) to xlim. I tried to add to the "update" function this
self.ax.set_xlim(left=max(self.data.iloc[0, 0], self.data.iloc[-...
0
votes
1
answer
52
views
Why the view doesn't change with the new data that plotted by FuncAnimation?
I am plotting some data, but see nothink. If you zoom out, you will find, that the data is plotted on other side of fig, and the view doesn't...automatically changed for be able to see data. Could ...
0
votes
1
answer
143
views
How do I animate this graph to just display the next row
enter image description here
So I tried this, I'm working in a jupyter notebook and am wondering how to animate the next row of data.
enter code here
def animate(i):
data = df.iloc[i]
return ...
0
votes
0
answers
187
views
Issue with FuncAnimation of matplotlib
Appreciating your time and effort to go through my code and helping me to find the solution.
I am using FuncAnimation of Matplotlib to refresh/update my plot every 1min.
The Data is extracted using ...
2
votes
0
answers
86
views
Plotting an algorithm with interactive figure in Python
I want to visualise the effect of an algorithm that takes a 2d vector as input and delivers an array of 2d vectors as output (where the array has the k-th iteration value at index k).
The way I would ...