def saveplot(fig, *name_args, close=True, **name_kwargs):
oname = out_name(*name_args, **name_kwargs)<EOL>fig.savefig('<STR_LIT>'.format(oname, conf.plot.format),<EOL>format=conf.plot.format, bbox_inches='<STR_LIT>')<EOL>if close:<EOL><INDENT>plt.close(fig)<EOL><DEDENT>
Save matplotlib figure.

    You need to provide :data:`stem` as a positional or keyword argument (see
    :func:`out_name`).

    Args:
        fig (:class:`matplotlib.figure.Figure`): matplotlib figure.
        close (bool): whether to close the figure.
        name_args: positional arguments passed on to :func:`out_name`.
        name_kwargs: keyword arguments passed on to :func:`out_name`.