I currently have a simulation process that outputs a data point on each iteration. I would like to animate this with matplotlib, but am unsure if possible with matplotlib.animation.
Many online tutorials/examples I have come across always start with a list of predefined points, e.g. x = [1,2,3,4,5], y=[5.5,3.6,7.1,2.2,3.3], and essentially animate this list. Technically this also works for me, but I will have to first run the simulation and append the results into lists x and y, and then run the animation process on these lists (which would require iterating through the lists again, which is pointless as ideally it should be animating alongside the simulation phase.) This will be cumbersome if I run the simulation with millions of iterations.
I was wondering if mpl.animation can animate data as it comes, e.g. start with x=[], y=[], then on first iteration we get x=[0.1], y=[3.3] and we animate this, and then on second iteration we get x=[0.1,0.52], y=[3.3,4.4] and we animate again, and so on, rather than requiring the entire list to be populated first before animating.
