'Return a string, which includes extension, suitable for use as
a default filename.'

def get_default_filename(self):

    default_basename = (self.get_window_title() or u'image')
    default_basename = default_basename.replace(u'    ', u'_')
    default_filetype = self.get_default_filetype()
    default_filename = ((default_basename + u'.') + default_filetype)
    save_dir = os.path.expanduser(rcParams.get(u'savefig.directory', u''))
    i = 1
    while os.path.isfile(os.path.join(save_dir, default_filename)):
        default_filename = u'{0}-{1}.{2}'.format(default_basename, i, default_filetype)
        i += 1
    return default_filename
