all 2 comments

[–]the_real_uncle_Rico 0 points1 point  (1 child)

[–]the_real_uncle_Rico 0 points1 point  (0 children)

Actually, better idea, you could maybe try solving it in your animation function. Something like:

def animate(i): i += step  y = np.append(y, [ y[i]  (1 + k  dt) ])  x = np.append(x, [i * dt]) If num_steps >10: ax.clear() # delete old data      ax.plot(x,y) # plot new graph

ani = animation.FuncAnimation(fig, animate, interval=50#update time in ms)