Skip to content

DOC: use start_event_loop rather than plt.pause in example #9061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions doc/api/animation_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ The inner workings of `FuncAnimation` is more-or-less::
for d in frames:
artists = func(d, *fargs)
fig.canvas.draw_idle()
plt.pause(interval)
fig.canvas.start_event_loop(interval)


with details to handle 'blitting' (to dramatically improve the live
performance), to be non-blocking, handle repeats, multiple animated
axes, and easily save the animation to a movie file.
performance), to be non-blocking, not repeatedly start/stop the GUI
event loop, handle repeats, multiple animated axes, and easily save
the animation to a movie file.

'Blitting' is a `old technique
<https://en.wikipedia.org/wiki/Bit_blit>`__ in computer graphics. The
Expand Down Expand Up @@ -86,7 +87,7 @@ time. When using blitting (by passing ``blit=True``) the core loop of
for f in frames:
artists = func(f, *fargs)
update_blit(artists)
plt.pause(interval)
fig.canvas.start_event_loop(interval)

This is of course leaving out many details (such as updating the
background when the figure is resized or fully re-drawn). However,
Expand Down