def close(*args):
if len(args)==<NUM_LIT:0>:<EOL><INDENT>figManager = _pylab_helpers.Gcf.get_active()<EOL>if figManager is None: return<EOL>else:<EOL><INDENT>figManager.canvas.mpl_disconnect(figManager._cidgcf)<EOL>_pylab_helpers.Gcf.destroy(figManager.num)<EOL><DEDENT><DEDENT>elif len(args)==<NUM_LIT:1>:<EOL><INDENT>arg = args[<NUM_LIT:0>]<EOL>if arg=='<STR_LIT:all>':<EOL><INDENT>for manager in _pylab_helpers.Gcf.get_all_fig_managers():<EOL><INDENT>manager.canvas.mpl_disconnect(manager._cidgcf)<EOL>_pylab_helpers.Gcf.destroy(manager.num)<EOL><DEDENT><DEDENT>elif isinstance(arg, int):<EOL><INDENT>_pylab_helpers.Gcf.destroy(arg)<EOL><DEDENT>elif isinstance(arg, Figure):<EOL><INDENT>for manager in _pylab_helpers.Gcf.get_all_fig_managers():<EOL><INDENT>if manager.canvas.figure==arg:<EOL><INDENT>manager.canvas.mpl_disconnect(manager._cidgcf)<EOL>_pylab_helpers.Gcf.destroy(manager.num)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'%type(arg))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>
Close a figure window

``close()`` by itself closes the current figure

``close(num)`` closes figure number *num*

``close(h)`` where *h* is a :class:`Figure` instance, closes that figure

``close('all')`` closes all the figure windows