qis.save_fig

qis.save_fig(fig, file_name, local_path=None, dpi=300, file_type=FileTypes.PNG, add_current_date=False, **kwargs)[source]

write a matplotlib figure to an image or vector file.

Parameters:
  • fig (Figure) – figure to write

  • file_name (str) – base file name without extension

  • local_path (str | None) – directory to write to. None writes to the working directory

  • dpi (int) – resolution. Relevant to PNG; the vector formats use it only for rasterised elements

  • file_type – PNG, EPS, SVG or PDF

  • add_current_date (bool) – append the current date to the file name

Returns:

the path written

Raises:

NotImplementedError – if file_type is not one of the four supported formats

Return type:

str