Skip to content

Commit

Permalink
Merge pull request #2683 from JamesMakela/close_long_fig_num
Browse files Browse the repository at this point in the history
Close a figure with a type long or uuid figure number
  • Loading branch information
efiring committed Dec 19, 2013
2 parents 8c16c61 + 9847852 commit e293f6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/pyplot.py
Expand Up @@ -516,8 +516,12 @@ def close(*args):
arg = args[0]
if arg == 'all':
_pylab_helpers.Gcf.destroy_all()
elif isinstance(arg, int):
elif isinstance(arg, six.integer_types):
_pylab_helpers.Gcf.destroy(arg)
elif hasattr(arg, 'int'):
# if we are dealing with a type UUID, we
# can use its integer representation
_pylab_helpers.Gcf.destroy(arg.int)
elif is_string_like(arg):
allLabels = get_figlabels()
if arg in allLabels:
Expand Down

0 comments on commit e293f6d

Please sign in to comment.