All Questions
2,047 questions
0
votes
1
answer
38
views
FuncAnimation only shows one frame
I am trying to implement a genetic algorithm in Python and to display the result of my algorithm I wanted to create an animation using FuncAnimation from matplotlib.animation.
However, I ran into the ...
2
votes
1
answer
40
views
An iterative plot is not drawn in jupyter notebook while python works fine. Why?
I have written an iterative plot code for python using plt.draw(). While it works fine for python interpreter and ipython also, but it does not work in jupyter notebook. I am running python in ...
-1
votes
0
answers
42
views
How do I make the bars visible in a plotly bar chart animation?
I'm trying to make a bar chart animation that slowly shows each bar, but I can't make it work as intended. When I run the code, the bar appears extremelly thin and then disappears to show the next ...
0
votes
0
answers
48
views
Insert a new frame in the end of animated WEBP
I have a JPEG image I and a transform function F which has some state S. Every N minutes function's state changes and after that F is applied to my image I. So for the K'th change we have output image ...
0
votes
1
answer
62
views
How can I animate object A thrown upwards from an given height then free-falling with matplotlib?
Using Python 3.12, Matplotlib 3.9.2,
From height h=20(m), throw object A upwards with a given velocity v and drop object B to let it free-falling. Air resistance is neglectable. Calculate v so that ...
0
votes
0
answers
25
views
How to Prevent Glitching in bar_chart_race Animation with Dynamic x-Axis Scaling (fixed_max=False)
I'm creating a bar chart race video using the bar_chart_race package in Python, but I'm encountering an issue when toggling the fixed_max setting. When fixed_max is set to True, the video looks smooth ...
1
vote
1
answer
48
views
Speed-up matplotlib creation of frame images for animation
I am simulating some physical processes with Python and wish to regularly plot the situation of the system in order to make an animation. What I have been doing so far is to draw a snapshot of the ...
0
votes
0
answers
72
views
Media pipe pose estimated key points to blender
I extracted pose landmarks from a video and sent those coordinates to a 3D avatar in Blender using a socket. However, the avatar's movement differs significantly from the original movement of the ...
0
votes
1
answer
105
views
How do I create a copy of something (A Mobject)? (Manim)
from manim import *
class CreateExample(Scene):
def construct(self):
tr_1 = Polygon([-3, -2, 0], [-3, 3, 0], [2, -2, 0])
cc_1 = Circle().shift(2.5*LEFT+1.75*UP).scale(0.4)
...
0
votes
0
answers
54
views
Python Tkinter GIFs Overlapping
I am using tkinter to create a project. It runs fine, until f9 is pressed of which multiple instances of a gif sometimes overlap themself. I have no idea why this is happening, I have tried different ...
0
votes
0
answers
37
views
How to forcefully trigger updates for dynamic plots in Google Colab without user interaction?
I'm trying to create responsive dynamic plots in Google Colab, but I'm running into performance issues with the updates.
For a minimal example, I made a simple scatter plot of random values with a ...
0
votes
0
answers
25
views
Python Tkinter Row Stacking Animation
I want to make an animation where a row of objects moves down the screen until they reach a specified row and then generate the next row that moves down from the same starting position and stops a row ...
1
vote
1
answer
85
views
Epicycloid animation with Matplotlib in Python
I want the animation epicycloid.gif to be framed depending in the size of the epicycloid, so depending on the radio of the spinning circule. As you see at ratio = 2 the animation in format .gif does ...
0
votes
0
answers
34
views
MatPlotLib dynamical resizing of y-axis not working in animation?
I have the following animation code:
# Update function for animation
def update(frame):
line.set_ydata(psi_vals[frame]) # Update the y-data for each time step
# ax.set_ylim(0, np.max(psi_vals[...
1
vote
2
answers
48
views
Changing colorbar and title in animated plot
I'd like to change the title and the colorbar for each plot in my Artist animation. But in the final .gif it is only showing the title and colorbar of the last frame.
Any idea what I am missing here?
...
0
votes
1
answer
55
views
How to dynamically update a bar plot in Python
I have a barplot that I'd like to update dynamically using data from a dataframe.
The original plot is based on dataframe, d:
d
Position Operation Side Price Size
1 9 0 1 0.7289 -19
...
0
votes
0
answers
24
views
Animated emojies in python-telegram-bot
how to add animated emojies in python-telegram-bot?
The normal emojies are working, but how to add the animated ones? I am stuck in this trouble.
I am using the python-telegram-bot async module.
I ...
1
vote
0
answers
50
views
Plotly line series animation: draw line continously instead of in steps?
I'm trying to produce an animated chart that will draw a couple of time-based line series smoothly over time.
I've managed to animate the line series using graph_objects. However, instead of having ...
0
votes
1
answer
41
views
Python/kivy: rotating animation is not working
Problem is that
Animation of kivy is not working perfectly.rotate_value_angle is not getting change.
if not replaced:
if self.ids.battelground.collide_point(*touch.pos):
...
0
votes
1
answer
22
views
Animating a cluster column and line chart with matplotlib
I am trying to make an animated chart that updates frame by frame to have the end result has two columns for each x-axis entry (which does vary between years or years and Q, but either way are strings)...
0
votes
1
answer
55
views
Animating line charts
I have the following data, here is a section of it
[{'Date': '2017 Q1', 'Saudi Arabia': 3.5080621303094413, 'Oman': 2.0803722435647836, 'Yemen': 1.9636651338439473, 'Israel': 3.0247692259733565}, {'...
0
votes
1
answer
99
views
Update tile/image based on extent using Cartopy and Matplotlib FuncAnimation
I want to create an animation of a trajectory using Cartopy and FuncAnimation. I have the trajectory stored in a GeoDataFrame with latitude, longitude and date time columns, which I want to visualise.
...
0
votes
2
answers
94
views
How do I create an animated stacked bar chart using matplotlib
I have been trying to create an animated stacked bar chart using matplotlib. Although I have managed to animate each stack element, the output only shows one element at a time. I was also able to ...
-1
votes
1
answer
30
views
I am trying to animate an object in ursina but it doesn't work for me. How to fix?
door1.animate_y = (18, duration=5)
I heard from another post to use 1 equal sign for duration.
I used 1 equal sign for duration and I though it would work, but it said invalid syntax.
When I use 2 ...
0
votes
0
answers
14
views
Need help setting rms values with code. trying to animate talking with pictures
import cv2
import numpy as np
import wave
import os
import shutil
# Constants
AUDIO_FILE = "/home/kit/sfml_project/sound_test/Start-1.wav"
IMAGE_PATH_CLOSED_1 = "images/Start4.png"...
0
votes
0
answers
46
views
When saving WebP using PIL in Python, the last pixel (bottom-right) becomes black
Problem: When saving a sequence of images as a lossless WebP animation using PIL, the last pixel (bottom-right) becomes black.
from PIL import Image
for png_file in png_files:
image = Image.open(...
0
votes
0
answers
11
views
Varying the number of points per frame in FuncAnimation
I'm trying to create a 3D animation of the moon's orbit around the Earth. Each point in the time vector ('times') that is used to create the orbit data is not equally spaced, however, I would like to ...
0
votes
1
answer
77
views
Combine time slider with drop down menu in plotly python
I am trying to create a choropleth map with a time slider to pick a date. I now also want to add a dropdown menu to chose a dataset to display the data of. Here is a minimal example:
import plotly....
0
votes
1
answer
29
views
Scatter 3d animation frames dont display all traces
I have searched for proper animation script and come up with following function on how to add traces:
from plotly import graph_objects as go
def add_anim_frames(figure: go.Figure, traces):
...
3
votes
1
answer
69
views
Making an image move in matplotlib
I'm trying to have an image rotate and translate in matplotlib according to a predefined pattern.
I'm trying to use FuncAnimation and Affine2D to achieve this. My code looks something like this :
from ...
0
votes
1
answer
42
views
Patches animation in matplotlib
I'm trying to create a simple particle animation using matplotlib, like this:
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
fig = plt.figure()
fig.set_dpi(...
0
votes
1
answer
31
views
How to animate the title using FuncAnimation in Python?
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig = plt.figure()
axis = plt.axes(xlim=(-4, 4), ylim=(-3, 3))
line, = axis.plot([], [],'r+', lw=2)
...
0
votes
0
answers
17
views
Modify Python Code FuncAnimation for changing color and markerplot of animated graph
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig = plt.figure()
axis = plt.axes(xlim=(-4, 4), ylim=(-3, 3))
line, = axis.plot([], [], lw=2)
def ...
1
vote
1
answer
50
views
Animation for plotting y=omega*x^2 with omega varying from -3 to 3
I want to plot y = omega*x^2 with omega varying from -3 to 3 with a step size of 0.25 (and x spanning -4 to 4 with a step size of 0.001). The current version of my code (below) only has omega start at ...
0
votes
1
answer
87
views
Make animation using Python but give me an error, animation can't appear
I want to plot animation of y=omega*x^2, which omega is -3 into 3 with step size 0.25, x from -4 into 4 with step size 0.001. I'm new studying plot animation in Python.
I try to make a code but give ...
2
votes
1
answer
73
views
How to show one figure in loop in Python?
I want to show a figure that is calculated in a loop, let say with 5 iterations.
This is the code that I wrote
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,1,100)
y = np....
0
votes
1
answer
50
views
Python animation beginner errors with AFTER and Canvas display
My code just draws a set of horizontal lines within a circle in a window. I wrote it so that there would be a pause between the drawing of the lines. I used the "AFTER" function for this. ...
0
votes
1
answer
53
views
Matplotlib animation by using for loop
I have a project about robotics arm and I need to visualize motion of robotic arm. I have a code for taking coordinates and visualize it but I want a animation for it. I used for loop but I couldn't ...
0
votes
1
answer
43
views
How to stop animation with kivy -python
I'm using kivy to develop a small project. Currently, I use the animation utility to animate Widgets (change size). Everything works great so far, but I have no idea how I am supposed to stop ...
1
vote
1
answer
80
views
How to create an animated 2D histogram chart in python
I have the code to create my 2D histogram as below. It works for creating a statics chart but I need to create an animated heatmap which change with 'minute_play' column. How can I do that? The ...
1
vote
1
answer
297
views
Best way to make an animated line plot in streamlit?
I'm new to Streamlit and am trying to create an animated line plot. However, my data is quite heavy: I have 40 data points on the x-axis, and at each time instance, I am plotting 50 lines (the ...
1
vote
0
answers
34
views
Matplotlib stackplot animation
I'm creating an animation of a line plot using the attached code. I want to display the data as a stackplot instead of multiple lines on the same plot. When I change the plot type to a stackplot I ...
3
votes
2
answers
168
views
Matplotlib's `line.set_data_3d()` is slower upon reloading the graph
I'm making a website in which users can input one NBA player and get an animation of their shots. The code is working properly, but when I load another NBA player (or the same NBA player the second ...
0
votes
0
answers
91
views
Creating table in manim with unicode characters
I want to create a table in manim and write persian alphabet in its cells, but the table doesn't get created, i can create a table with the exact same code only passing it english alphabet. So i know ...
1
vote
1
answer
184
views
Reading each cell value in a table in manim
I have created a table using Table in manim, and i want to simply read the value in one of the cells.
As an example imagine i have written "a" in row 0 column 0, i want to say:
If mytable....
0
votes
0
answers
21
views
why is python animation changing lengths?
So I'm quit new to simulations in python and I tried to simulate the cart and pendulum problem as shown here
I don't know why but the animation is distorting the length of the pendulum rope.
It ...
0
votes
0
answers
16
views
Can I animate a Poly3DCollection in matplotlib with blit=True
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.spatial.transform import Rotation
import matplotlib.animation as animation
...
1
vote
0
answers
186
views
MediaPipe Landmarks to BVH
I am doing a project about transferring the image taken from the camera to animation. I want to transfer the body pose movements I detected with Mediapipe to the blender environment as animation. I ...
0
votes
0
answers
25
views
How to play (Create(mobject)) that is being updated dynamically?
phase = ValueTracker(0)
def waver(phase, dt):
phase.set_value(phase.get_value() - dt)
phase.add_updater(waver)
graph = always_redraw(
lambda: ax.plot(
...
0
votes
1
answer
36
views
Is there a way to animate a line plot based on rows in a numpy array? [duplicate]
I have a 2d array (39, 57601) where the columns represent time (57601 time points in total) and rows represent temperature at specific nodal positions (39 nodes in total). In other words, each column ...