Image.savefig#

ImageToolsManager.savefig(filename: str = 'img.png', bbox: str | None = 'tight', dpi: int = 300, script_relative: bool = False) None[source]#

Create a .png image file of the figure created with the Image class.

Parameters:
- bbox: {‘tight’, None}, default ‘tight’

Crops the white borders of the Image to create a more balanced image file.

- filename: str, default ‘img.png’

The name of the saved image file.

- script_relative: bool, default False

If True, the image is saved in the same directory as the script calling this method. If False, the image is saved in the current working directory.

- dpi: int, default 300

The resolution of the saved image in dots per inch (DPI).

—-
Returns:
  • None

Examples

  • Example #1: save an empty image

    >>> import pyPLUTO as pp
    >>> I = pp.Image()
    >>> I.savefig("namefile.png")