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

Skip to content

Commit 4d45160

Browse files
author
butterw
committed
warning on figure('all') creation
1 parent ca42eaa commit 4d45160

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
"""
1616

17-
import sys
17+
import sys, warnings
1818

1919
import matplotlib
2020
from matplotlib import _pylab_helpers, interactive
@@ -266,6 +266,8 @@ class that will be passed on to :meth:`new_figure_manager` in the
266266
figLabel = num
267267
allLabels = get_figlabels()
268268
if figLabel not in allLabels:
269+
if figLabel == 'all':
270+
warnings.warn("close('all') closes all existing figures")
269271
if len(allLabels):
270272
num = max(allnums) + 1
271273
else:

0 commit comments

Comments
 (0)