Skip to content

Commit 28dcf3c

Browse files
committed
ENH : move draw_all to Gcf class method
1 parent 51f08cd commit 28dcf3c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/matplotlib/_pylab_helpers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,14 @@ def set_active(cls, manager):
139139
cls._activeQue.append(manager)
140140
cls.figs[manager.num] = manager
141141

142+
@classmethod
143+
def draw_all(cls):
144+
"""
145+
Redraw all figures registered with the pyplot
146+
state machine.
147+
"""
148+
for f_mgr in cls.get_all_fig_managers():
149+
# TODO add logic to check if figure is dirty
150+
f_mgr.canvas.draw()
142151

143152
atexit.register(Gcf.destroy_all)

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,7 @@ def displayhook(*args):
139139

140140
sys.displayhook = displayhook
141141

142-
143-
def draw_all():
144-
"""
145-
Redraw all figures registered with the pyplot
146-
state machine.
147-
"""
148-
for f_mgr in _pylab_helpers.Gcf.get_all_fig_managers():
149-
# TODO add logic to check if figure is dirty
150-
f_mgr.canvas.draw()
142+
draw_all = _pylab_helpers.Gcf.draw_all
151143

152144

153145
@docstring.copy_dedent(Artist.findobj)

0 commit comments

Comments
 (0)