Skip to content

Commit 30f5f7e

Browse files
author
Chris
committed
Import pyplot explicitly before closing figures in show() (fixes #24)
1 parent 9eb04a6 commit 30f5f7e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎matplotlib_inline/backend_inline.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def show(close=None, block=None):
9696
# only call close('all') if any to close
9797
# close triggers gc.collect, which can be slow
9898
if close and Gcf.get_all_fig_managers():
99-
matplotlib.pyplot.close("all")
99+
from matplotlib import pyplot
100+
101+
pyplot.close("all")
100102

101103

102104
# This flag will be reset by draw_if_interactive when called

0 commit comments

Comments
 (0)