Questions tagged [matplotlib-animation]

This tag is for questions related to the matplotlib animation API

matplotlib.animation API

383 questions
0
votes
1 answer

(matplot, 3d, plot_surface, Animation) How can I freez z axis from moving in the animaton

I want to make an animation of a drum vibration in python. My problem is that the zero point of the z_axis keeps moving. How can I freeze the z_axis? video link fig, ax = plt.subplots(subplot_kw={"projection": "3d"}) z=sol[0] def init(): …
afshin
  • 1
0
votes
0 answers

Python Animation Error: "Object has no attribute"

I'm trying to simulate a double pendulum using C and python. The following code uses an "animate" function to simulate the trajectory using arrays of value. However, when I try to launch it, it gives me the following error: "AttributeError:…
Ray
  • 1
0
votes
0 answers

Animated scatter plot rendering points in wrong order

I have a bunch of data points each associated with a time, and I want to render them in an animation where I fade points in and out based on this time. The problem I'm running into is that the points are being rendered out of order. I've reduced the…
howard
  • 644
  • 2
  • 7
  • 15
0
votes
1 answer

How to plot a circle that tilts according to a function

import numpy as np import matplotlib.pyplot as plt from io import BytesIO from PIL import Image r = 18 h = 1.7 num_of_steps = 1000 emp = 3 time = np.arange(0, 100, 0.4) phi = [] theta = [] Amp = np.pi/6 fphi = 4 ftheta = 9 pics = [] r1 = 16 for j…
0
votes
0 answers

embedding matplotlib animation into tkinter

I'm learning tkinter and have gone through tutorials on how to embed matplotlib into tkinter but I have had no luck. I typically just end up with a blank canvas and my script does nothing. The script pulls from another script that pulls data from a…
0
votes
0 answers

Animate 2D plane positioned points with non regular data frequency

As stated in the tittle, I'm trying to make a 2D representation of moving markers on a delimited area. The [id,posx,posy,posz,time] is obtained from a SQL database and the theoretical frequency of the hardware is 10Hz. When applying the animation…
Julen
  • 97
  • 2
  • 9
0
votes
0 answers

Animate a numpy array when using multiprocessing

I am currently implementing the Conway's Game of Life in Python. To speed things up, I am using multiprocessing: grid: Grid = Grid(grid_size) grid_array: np.ndarray = grid.grid_init(initialization) living_cells: set[tuple] =…
0
votes
0 answers

plt.show() causes program to hang even after window is closed

I'm working on a program that displays drawings, with the option of animating the drawing to show which order the lines should be drawn in. When I used plt.show() to display the drawing as a still image, everything works as expected: the code…
0
votes
0 answers

Matplotlib animation: altering data points mid animation

I'm making a graph in python with matlibplot that allows users to view temperature over time in heat map. The user should be able to change between temperature per minute and temperature per hour. The animation works great for only minutes and…
0
votes
1 answer

Unable to refresh plt.axhline() in matplotlib

I'm just trying to make a live graph using matplotlib.However I couldn't find a way to draw-remove-redraw axhline(). My aim is to show a horizontal line of newest value of Y axis values and of course remove the recent horizontal line. ` import…
enis
  • 3
  • 2
0
votes
0 answers

multi animation whit subplot

I got some sort of a problem with a pendulum animation, I tried to display my animation (the pendulum's movement) next to a graph in two separate axes, but when I try my code, it barely works displaying two axes that overlap on one another... Here…
0
votes
0 answers

Using plt.show() after saving a FuncAnimation only displays one frame

I'm working on a script that animates the process of drawing a shape and saves the animation to a GIF. However, when I call plt.show() after saving the animation, the popup window only displays the last frame of the animation. Here's the current…
0
votes
0 answers

Animate the midpoints of a 3d "Rhombic dodecahedron"

I need help in animating a Rhombic dodecahedron. I want to enlarge and to shrink the midpoints (center points) with FuncAnimation from Matplotlib. I wanted to use the δ for this (make smaller/bigger) and for this an animation. But just don't know…
0
votes
1 answer

Combining a text update with n curves being updated using matplotlib animation

I have n curves that I draw using matplotlib's animation. Thanks to a previous question and the answer to it, this works well. Now I want to add some text in the plot which is continuously updated, basically the frame number, but I have no idea how…
Alf
  • 1,821
  • 3
  • 30
  • 48
0
votes
0 answers

How to yield the value from the loop into a specific numpy array

I was trying to use the forloop to yield the new value into the a numpy array, then used the generated arry to make an animation of points' movement. However, there are two bugs keep showing up: I was trying to yield new value to data at end of the…
mzzz
  • 11
  • 1