1

I have file which contains a list of coordinates. I would like to take each point and plot it one after another, creating some sort of animation.

Assuming I am getting the data like this, what should I do in order to have each point plotted for a split second and then replaced with the next one?

...
for line in f:
    data = line.split(',')
    x_coord = data[0]
    y_coord = data[1]
    ...
2

1 Answer 1

1

Plotting one by one isn't the answer - you're unlikely to be able to control the speed at which each plot call pops up on the screen, as that may be window-manager dependent and won't create a good user experience.

If you don't need a live animation, you could render each plot as a PNG, then use mencoder to generate the animation, as described in the Matplotlib FAQ.

If you do want a live animation, that's what matplotlib's animation is for. Steinar Lima links to a good Stack Overflow answer above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.