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 e293f6d

Browse filesBrowse files
committed
Merge pull request #2683 from JamesMakela/close_long_fig_num
Close a figure with a type long or uuid figure number
2 parents 8c16c61 + 9847852 commit e293f6d
Copy full SHA for e293f6d

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-1
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,12 @@ def close(*args):
516516
arg = args[0]
517517
if arg == 'all':
518518
_pylab_helpers.Gcf.destroy_all()
519-
elif isinstance(arg, int):
519+
elif isinstance(arg, six.integer_types):
520520
_pylab_helpers.Gcf.destroy(arg)
521+
elif hasattr(arg, 'int'):
522+
# if we are dealing with a type UUID, we
523+
# can use its integer representation
524+
_pylab_helpers.Gcf.destroy(arg.int)
521525
elif is_string_like(arg):
522526
allLabels = get_figlabels()
523527
if arg in allLabels:

0 commit comments

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