docs: def _save_image(fig, filename, filetype='png', resolution=300):
      """
      If filename is specified, saves the image
      :param str filename:
          Name of the file
      :param str filetype:
          Type of file
      :param int resolution:
          DPI resolution of the output figure
      """
      if filename:
          filename, filetype, resolution = build_filename(filename,
                                                          filetype,
                                                          resolution)
          fig.savefig(filename, dpi=resolution, format=filetype)
      else:
          pass