code: def savefig(self, filename, **kwargs):
          
          filename = os.path.expanduser(filename)
          kwargs.setdefault('show', False)
          kwargs.setdefault('save', filename)
          kwargs.setdefault('animate', False)
          return self._show_or_save(**kwargs)
docs: 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.