I have some data that are updated in a for-loop. I need to plot them for each iteration of the cycle, in the same graph (that is, clear the old data and plot the new).
For sure this problem is very common and easy to solve, however I can’t find any straightforward example online.
I’m using Jupyter as environment and PyPlot for “static” graphs (I mean, diagrams that don’t change over time).
Here’s a pseudo-code to understand what I need:
for i in 1:100 clear_plot() plot(sin(i*x)) sleep(1) end
The above code should plot a sine wave, wait 1 second, replace it with a different one, wait another second, and so on.
Can you help me? Thanks!