Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3eef890

Browse files
authored
Merge pull request #9061 from tacaswell/doc_tweak_animation_docs
DOC: use start_event_loop rather than plt.pause in example
2 parents 225a4a0 + 1f083e4 commit 3eef890

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/api/animation_api.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ The inner workings of `FuncAnimation` is more-or-less::
5050
for d in frames:
5151
artists = func(d, *fargs)
5252
fig.canvas.draw_idle()
53-
plt.pause(interval)
53+
fig.canvas.start_event_loop(interval)
5454

5555

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

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

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

0 commit comments

Comments
 (0)