def savefig(self, filename, **kwargs):
        """
        Draw and save the plot.

        :parameter str filename: filename to save to.  Be careful of extensions here...
                matplotlib accepts many different image formats while other
                backends will only export to html.
        """
        filename = os.path.expanduser(filename)
        kwargs.setdefault('show', False)
        kwargs.setdefault('save', filename)
        kwargs.setdefault('animate', False)
        return self._show_or_save(**kwargs)
Draw and save the plot.

        :parameter str filename: filename to save to.  Be careful of extensions here...
                matplotlib accepts many different image formats while other
                backends will only export to html.