1

I have a given list with points (x, y), which changes during the course of the given function, for example: arr = [(1, 2), (1, 3), (5, 6), (8, 1)], which is the coordinates of the points (1, 2), (1, 3), (5, 6), (8, 1)

for i in range (5):
     arr = function (arr) # different array

After each loop, I would like to draw a graph of coordinates with marked points, i.e. I want to create an animation from it. How can this be done in Python?

1 Answer 1

1

I would say do not plot them in any loop. Just accumulate all those values, pass it to whatever plotting library you are using (matplotlib does have animation support). Take a look here: https://matplotlib.org/3.3.3/api/animation_api.html

If your data is streaming, maybe use some time windows.

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.