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 make Matplotlib Animation for a computer simulation of Earth, Moon and Asteroid (only animation part) in Python?

I'm trying to make a computer simulation for Earth, Moon and Asteroid as they orbit around the Sun. The data r_earth, r_moon and the r_asteroid are already given (they are an array). The xlim and ylim are so big because I have to use real values…
thunder
  • 113
  • 4
0
votes
1 answer

plt.pause not working after calling plt.subplots()

Basically just what I said in the title. I have an absurdly simple example of this happening for me: print("test 1") plt.pause(2) print("test 2") fig, ax = plt.subplots() print("test 1") plt.pause(2) print("test 2") When I run this, it pauses…
Tarnarmour
  • 115
  • 1
  • 6
0
votes
0 answers

How do we add a cursor on an animated plot with matplotlib?

I am trying to build some kind of a game where you have to keep the cursor as close as possible to a line. For this I animated a piecewise function with animation.FuncAnimation and added a crosshair cursor. The problem is that the cursor disappears…
0
votes
1 answer

FuncAnimation now rescales axes limits at every frame after matplotlib update (3.2.2 -> 3.3.4)

I am using matplotlib FuncAnimation to display data received in real time from sensors. Before updating matplotlib, I was using matplotlib 3.2.2 and the behavior was the following: graph opens and autoscales axes limits to the data coming in from…
0
votes
1 answer

Variable date ticks matplotlib animation

I'm currently reading data points from a CSV file every 2 seconds and plotting it using matplotlib Funcanimation. However, the date ticks on the x-axis are stacking on top of each other and are therefore unreadable. I'm looking for an efficient way…
Gracias
  • 45
  • 1
  • 2
  • 6
0
votes
0 answers

I want to animate the trajectory of a ball (really just a circle) using Matplotlib animation

I want to animate the trajectory of a circle (ball) defined by y = -t^2 + 11t - 18. Basically it would just be bouncing up and down (i.e. no change in x). Its intercepts are (2,0) and (9,0) so the animation should start at time t = 2 as it leaves…
0
votes
0 answers

How do I plot an animated graphic on the interface built in PySimpleGui?

I am triyng to make a graphic interface to interact with my arduino uno, in order to generate graphs of temperature, humidity and weight sensors. I've already managed to generate the animated graphics that update every second, but I'd like them to…
0
votes
0 answers

How to make the subplot axis labels and subplot titles appear and fix axis limits in an animated line chart?

I am using the following code to animate a line chart from a CSV file that has two columns - which would look like a list of dates and closing stock prices. I would like to add axis labels and a chart title to the sub plot, but I am unable to make…
Ian Chan
  • 1
  • 1
0
votes
0 answers

Matplotlib bar chart animation stops after first run

I am trying to run this matplotlib animation python code but it keeps crashing after first run. It should repeat like animation so later I can take it out as gif/movie file. After crash error : "Process finished with exit code -1073740791…
leo
  • 1
0
votes
1 answer

matplotlib throwing ZeroDivisionError when saving an animation

I have the following Python script (with some irrelevant bits removed): import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation #constants xRange = 50 dx = 0.1 tMax = 50 dt = 0.1 c=1 #init Nx = int(xRange/dx) Nt…
0
votes
1 answer

Matplotlib Animation : Graph can't appear

Recently I have managed to do the animation. But now I can't make the tangent line went as I want (not even displayed yet). The formula of the tangent line is y=(2/r)(sqrt(1-((r^2)/4))-1)x +r. The formula is obtained from 2 circles equation (C1 and…
Q-Max_Lu
  • 15
  • 4
0
votes
1 answer

Python Realtime Plotting from csv file

This code I get from a GitHub Link here. I used the data_gen code to generate random numbers and continually write these numbers into the CSV file. Then, I used the code inside snippets.txt to do real-time plotting. I am using the Colab environment…
0
votes
1 answer

Real time ploting with matplotlib and tkinter

I'm currently working on a project in Python and I need to plot some data in real time. I would like to make a GUI, thinking of using Tkinter library. I am using matplotlib for ploting. The program has a for loop in main in which i call a function…
0
votes
1 answer

Function for subplots for real time plotting

I have a code which gives me 4 individual live plotting graphs for 4 different sensors. But, I want them in a single frame using subplots. Pasting 2 pieces of code which are plotting my graphs. How should I modify them for my output to be a subplots…
0
votes
0 answers

Networkx : Live ploting the shortest path

Good afternoon. I'm on an a* shortest path finder based on osmnx data in python. Actually, I'm plotting my shortest path at the end of my computation. But I would like to try to liveplotting this path (even if this means to go back and erase a piece…