Skip to content

Commit 6a6f8d9

Browse files
committed
ENH : add force logic to draw_all
Add kwarg to Gcf.draw_all to force redraw of all figures (even if the figure does not think it needs it).
1 parent f9ac8d0 commit 6a6f8d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/_pylab_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ def set_active(cls, manager):
140140
cls.figs[manager.num] = manager
141141

142142
@classmethod
143-
def draw_all(cls):
143+
def draw_all(cls, force=False):
144144
"""
145145
Redraw all figures registered with the pyplot
146146
state machine.
147147
"""
148148
for f_mgr in cls.get_all_fig_managers():
149149
# TODO add logic to check if figure is dirty
150-
if f_mgr.canvas.figure.dirty:
150+
if force or f_mgr.canvas.figure.dirty:
151151
f_mgr.canvas.draw()
152152

153153
atexit.register(Gcf.destroy_all)

0 commit comments

Comments
 (0)