I'm plotting an animation of circles. It looks and works great as long as speed
is set to a positive number. However, I want to set speed
to 0.0
. When I do that, something changes and it no longer animates. Instead, I have to click the 'x' on the window after each frame. I tried using combinations of plt.draw()
and plt.show()
to get the same effect as plt.pause()
, but the frames don't show up. How do I replicate the functionality of plt.pause()
precisely either without the timer involved or with it set to 0.0
?
speed = 0.0001
plt.ion()
for i in range(timesteps):
fig, ax = plt.subplots()
for j in range(num):
circle = plt.Circle(a[j], b[j]), r[j], color='b')
fig.gca().add_artist(circle)
plt.pause(speed)
#plt.draw()
#plt.show()
plt.clf()
plt.close()