From d7f9b6d2239925f82e0df43b2b481362a8338f1e Mon Sep 17 00:00:00 2001 From: Importance of Being Ernest Date: Mon, 21 Aug 2017 12:11:42 +0200 Subject: [PATCH] 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. --- lib/matplotlib/pyplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 1b694498e62d..5c78047db80b 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -294,7 +294,7 @@ def pause(interval): if figManager is not None: canvas = figManager.canvas if canvas.figure.stale: - canvas.draw() + canvas.draw_idle() show(block=False) canvas.start_event_loop(interval) return