Questions tagged [matplotlib-animation]

This tag is for questions related to the matplotlib animation API

matplotlib.animation API

383 questions
0
votes
0 answers

How to animate animate GeoPandas plot

I want to visualize world population by year using GeoPandas. This is the code I am using : import matplotlib.ticker as ticker import matplotlib.animation as animation from IPython.display import HTML fig,ax=plt.subplots(1,1,figsize=(15,5)) def…
beridzeg45
  • 246
  • 2
  • 11
0
votes
0 answers

Center zero on an 3d animation with Matplotlib

I'm trying to make a simulation of a DC motor made of two orthogonal coils. How can I have the zero of the animation fixed? I already have an equal aspect ratio (using matplotlib 3.6) but right now the animation moves it's origin to center the…
0
votes
1 answer

Update bubble plot using Arduino serial data

Hi I'm new to this Site and appreciate your help. I have a variable resistor and it reads analog value and send to the python script. My objective is to plot this value using bubble plot which indicate the intensity by using radius of the circle.…
0
votes
0 answers

How to make animation of a vector with quaternions

I have data-text-file with lines like: +45.16, +1254.067, +4377.328, -1107.861, -235.2307434, 266.4469299, -261.4131470 We should take 6 numbers, except of the first one. Further we have a filter, which transforms this 6 values into quaternion…
0
votes
1 answer

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 --numpy=1.23.4 --scipy=1.9.2 …
Bo Zhong
  • 11
  • 2
0
votes
1 answer

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): maxInteractions=500 interactions=0 def s():…
0
votes
2 answers

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 10 2 My code for now, which…
Art
  • 132
  • 6
0
votes
1 answer

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. Below is a simplified version of what I've been…
nia
  • 64
  • 4
0
votes
0 answers

Getting
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
shows up instead of generating a window that shows the…
0
votes
1 answer

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 different perspectives. I was wondering if there is…
0
votes
0 answers

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. But I just need one inside the tkinter…
0
votes
0 answers

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 saving the animation as the code shown below,…
0
votes
0 answers

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 list, plt.imshow's it, then repeats def…
0
votes
1 answer

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 numpy as np import matplotlib.pyplot as plt import…
JTM
  • 1
  • 1
0
votes
1 answer

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 an animated line chart in Python, please…