Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa53aa3

Browse filesBrowse files
committed
Avoid repeatedly warning about too many figures open.
Warning once is useful, but no need to warn again if the user further creates even more figure later in their code (see e.g. tutorials/intermediate/constrainedlayout_guide.py which spams the terminal with such warnings). (Yes, the warning would still get reemitted if the user closes some windows and then goes again above the limit -- that's less of an issue and not really worth working around IMO.)
1 parent 69cd8bf commit fa53aa3
Copy full SHA for fa53aa3

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
503503
if figManager is None:
504504
max_open_warning = rcParams['figure.max_open_warning']
505505

506-
if len(allnums) >= max_open_warning >= 1:
506+
if len(allnums) == max_open_warning >= 1:
507507
cbook._warn_external(
508508
"More than %d figures have been opened. Figures "
509509
"created through the pyplot interface "

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.