Questions tagged [matplotlib-animation]

This tag is for questions related to the matplotlib animation API

matplotlib.animation API

383 questions
102
votes
5 answers

How to animate a scatter plot

I'm trying to do an animation of a scatter plot where colors and size of the points changes at different stage of the animation. For data I have two numpy ndarray with an x value and y value: data.shape = (ntime, npoint) x.shape = (npoint) y.shape =…
Nicola Vianello
  • 1,916
  • 6
  • 21
  • 26
77
votes
10 answers

Matplotlib-Animation "No MovieWriters Available"

Under Linux, I've been checking out matplotlib's animation class, and it seems to work except that I cant initialise the movie writer to write out the movie. Using either of the…
Paradise
  • 1,408
  • 1
  • 14
  • 25
62
votes
6 answers

Inline animations in Jupyter

I have a python animation script (using matplotlib's funcAnimation), which runs in Spyder but not in Jupyter. I have tried following various suggestions such as adding "%matplotlib inline" and changing the matplotlib backend to "Qt4agg", all…
Ari Herman
  • 805
  • 1
  • 7
  • 11
38
votes
2 answers

matplotlib imshow(): how to animate?

i found this wonderful short tutorial on animation: http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/ however i cant produce an animated imshow() plot of same fashion. I tried to replace some lines: # First set up the figure,…
user1805743
  • 1,175
  • 3
  • 13
  • 22
34
votes
5 answers

stop / start / pause in matplotlib animation

I'm using FuncAnimation in matplotlib's animation module for some basic animation. This function perpetually loops through the animation. Is there a way by which I can pause and restart the animation by, say, mouse clicks?
Jaco Vermaak
  • 353
  • 1
  • 3
  • 5
33
votes
1 answer

Animating "growing" line plot

I want to produce a set of frames that can be used to animate a plot of a growing line. In the past, I have always used plt.draw() and set_ydata() to redraw the y-data as it changed over time. This time, I wish to draw a "growing" line, moving…
Blink
  • 1,444
  • 5
  • 17
  • 25
31
votes
4 answers

Animate a rotating 3D graph in matplotlib

I have a scatter plot set up and plotted the way I want it, and I want to create an .mp4 video of the figure rotating in space, as if I had used plt.show() and dragged the viewpoint around. This answer is almost exactly what I want, except to save…
Nate
  • 2,462
  • 1
  • 20
  • 28
27
votes
1 answer

Animation from matplotlib not working in spyder

I'm new to both python and stackoverflow, and I'm going over examples at matplotlib. I've searched for the solution to this problem with no luck, although I was able to locate a previously unanswered question in stackoverflow with the same issue. …
Medalgardr
  • 273
  • 1
  • 3
  • 6
17
votes
2 answers

How to create a 3D animation

I want to make 3D animation with matplotlib, but I don't know how to. Here is my non-working code. from matplotlib import pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import animation from math import…
Yuto
  • 173
  • 1
  • 1
  • 4
16
votes
2 answers

How to create 3D scatter animations

I am graphing out positions in a star cluster, my data is in a dataframe with x,y,z positions as well as a time index. I am able to produce a 3d scatter plot and was trying to produce a rotating plot--I have been somewhat successful, but struggling…
RDS
  • 476
  • 1
  • 6
  • 12
12
votes
1 answer

Remove annotation while keeping plot

I'm producing a series of scatterplots, where I keep most of the plot (besides the scatter plot) between each plot. This is done like so: Keeping map overlay between plots in matplotlib Now I want to add annotation to the plot: for j in…
bjornasm
  • 2,211
  • 7
  • 37
  • 62
12
votes
2 answers

Animating 3d scatterplot

I'm trying to get a 3d animation of a scatterplot in matplotlib, based off the 2d scatterplot animation posted here and the 3d line plot posted here. The problems arise from set_data and set_offsets not working in 3D, so you're supposed to use…
eric p
  • 235
  • 5
  • 13
10
votes
1 answer

Saving an animated Matplotlib graph as a GIF file results in a different looking plot

I created an animated plot using FuncAnimation from the Matplotlib Animation class, and I want to save it as a .gif file. When I run the script, the output looks normal, and looks like this (the animation works fine): However, when I try to save…
Star Man
  • 171
  • 1
  • 2
  • 11
7
votes
2 answers

How to adjust animation duration

the code here below shows and saves an animation of random matrices in succession. My question is how can I adjust the duration of the animation that I save. The only parameters that I have here fps, and dpi control first how many seconds a frame…
Heberto Mayorquin
  • 10,605
  • 8
  • 42
  • 46
6
votes
2 answers

Managing dynamic plotting in matplotlib Animation module

I would like to have an iteratively plotted graph that allows for skipping to the next frame, stopping it and coming back to a previous frame. I have looked at matplotlib Animation module which would be perfect if there was a way to implement the…
LemurPwned
  • 710
  • 10
  • 19
1
2 3
25 26