2

I'm trying to animate a bunch of constantly updating points over an image (imagine making a plotted dot move diagonally across some image). I've looked at the animate examples here: http://matplotlib.org/examples/animation/dynamic_image.html, but I'm not sure how to keep the same image while clearing out all previous dots, then redrawing them. Any ideas?

victor
  • 6,688
  • 9
  • 44
  • 48

1 Answers1

1

You do not need to clear the figure between every frame

#initial data 
ln, = ax.plot(x,y)
#...some loop code
    ln.set_xdata(new_x)
    ln.set_ydata(new_y)

Can you show some code of what you have tried, it will make it easier to give a more concrete answer.

Also see: using matplotlib's quiver in a loop efficiently, Visualization of 3D-numpy-array frame by frame

Community
  • 1
  • 1
tacaswell
  • 84,579
  • 22
  • 210
  • 199