def savefig(self, *args, **kwargs):
for key in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if key not in kwargs:<EOL><INDENT>kwargs[key] = rcParams['<STR_LIT>'%key]<EOL><DEDENT><DEDENT>transparent = kwargs.pop('<STR_LIT>', False)<EOL>if transparent:<EOL><INDENT>original_figure_alpha = self.patch.get_alpha()<EOL>self.patch.set_alpha(<NUM_LIT:0.0>)<EOL>original_axes_alpha = []<EOL>for ax in self.axes:<EOL><INDENT>patch = ax.patch<EOL>original_axes_alpha.append(patch.get_alpha())<EOL>patch.set_alpha(<NUM_LIT:0.0>)<EOL><DEDENT><DEDENT>self.canvas.print_figure(*args, **kwargs)<EOL>if transparent:<EOL><INDENT>self.patch.set_alpha(original_figure_alpha)<EOL>for ax, alpha in zip(self.axes, original_axes_alpha):<EOL><INDENT>ax.patch.set_alpha(alpha)<EOL><DEDENT><DEDENT>
call signature::

  savefig(fname, dpi=None, facecolor='w', edgecolor='w',
          orientation='portrait', papertype=None, format=None,
          transparent=False):

Save the current figure.

The output formats available depend on the backend being used.

Arguments:

  *fname*:
    A string containing a path to a filename, or a Python file-like object.

    If *format* is *None* and *fname* is a string, the output
    format is deduced from the extension of the filename.

Keyword arguments:

  *dpi*: [ None | scalar > 0 ]
    The resolution in dots per inch.  If *None* it will default to
    the value ``savefig.dpi`` in the matplotlibrc file.

  *facecolor*, *edgecolor*:
    the colors of the figure rectangle

  *orientation*: [ 'landscape' | 'portrait' ]
    not supported on all backends; currently only on postscript output

  *papertype*:
    One of 'letter', 'legal', 'executive', 'ledger', 'a0' through
    'a10', 'b0' through 'b10'. Only supported for postscript
    output.

  *format*:
    One of the file extensions supported by the active
    backend.  Most backends support png, pdf, ps, eps and svg.

  *transparent*:
    If *True*, the figure patch and axes patches will all be
    transparent.  This is useful, for example, for displaying
    a plot on top of a colored background on a web page.  The
    transparency of these patches will be restored to their
    original values upon exit of this function.