You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify repeat_delay and fix support for it when using iterable frames.
- Simplify the implementation of `repeat_delay`: instead of switching
callbacks back and forth, just set the timer interval at each
iteration to either the normal delay or the end-of-loop delay.
- Fix support for `repeat_delay` when `frames` is an iterable: the
previous implementation handled looping in `iter_frames` and therefore
`_step` never saw the end of the iterable. Instead, just iterate
through `frames` once in `iter_frames`, but still `tee` the iterable
so that `_step` can take care of repeating the animation.
Can be checked with
```python
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
line, = ax.plot(range(10))
def animate(i):
line.set_ydata(range(i, i + 10)) # update the data.
return line,
ani = animation.FuncAnimation(
fig, animate, frames=range(5), interval=1000, repeat_delay=2000, blit=True, save_count=50)
plt.show()
```
Previously repeat_delay would not be applied.
0 commit comments