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

Skip to content

Commit 57bfa34

Browse files
committed
PRF: only draw in plt.pause if stale
Avoids a possibly un-needed re-draw.
1 parent 494e4c7 commit 57bfa34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ def pause(interval):
276276
figManager = _pylab_helpers.Gcf.get_active()
277277
if figManager is not None:
278278
canvas = figManager.canvas
279-
canvas.draw()
279+
if canvas.figure.stale:
280+
canvas.draw()
280281
show(block=False)
281282
canvas.start_event_loop(interval)
282283
return

0 commit comments

Comments
 (0)