8000 Using `canvas.draw_idle()` inside `plt.pause` · matplotlib/matplotlib@d7f9b6d · GitHub
[go: up one dir, main page]

Skip to content

Commit d7f9b6d

Browse files
Using canvas.draw_idle() inside plt.pause
Instead of `canvas.draw()` we may use `canvas.draw_idle()` inside `plt.pause`. In general using `draw_idle()` has several advantages over `draw()`, so one might also use it here.
1 parent 225a4a0 commit d7f9b6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def pause(interval):
294294
if figManager is not None:
295295
canvas = figManager.canvas
296296
if canvas.figure.stale:
297-
canvas.draw()
297+
canvas.draw_idle()
298298
show(block=False)
299299
canvas.start_event_loop(interval)
300300
return

0 commit comments

Comments
 (0)
0