autogalaxy.plot.Output#

class Output[source]#

Bases: object

Sets how the figure or subplot is output, either by displaying it on the screen or writing it to hard-disk.

This object wraps the following Matplotlib methods:

The default behaviour is the display the figure on the computer screen, as opposed to outputting to hard-disk as a file.

Parameters:
  • path (Optional[str]) – If the figure is output to hard-disk the path of the folder it is saved to.

  • filename (Optional[str]) – If the figure is output to hard-disk the filename used to save it.

  • prefix (Optional[str]) – A prefix appended before the file name, e.g. (“prefix_filename”).

  • prefix – A prefix appended after the file name, e.g. (“filenam_suffix”).

  • format (Union[str, List[str], None]) – The format of the output, ‘show’ displays on the computer screen, ‘png’ outputs to .png, ‘fits’ outputs to .fits format.

  • format_folder (bool) – If True, all images are output in a folder giving the format name, for example path/to/output/png/filename.png. This can make managing large image catalogues easier.

  • bypass (bool) – Whether to bypass the plt.show or plt.savefig methods, used when plotting a subplot.

Methods

filename_from

output_path_from

subplot_to_figure

Output a subplot figure, either as an image on the screen or to the hard-disk as a png or fits file.

to_figure

Output the figure, by either displaying it on the user's screen or to the hard-disk as a .png or .fits file.

to_figure_output_mode

Attributes

format

rtype:

str

format_list

to_figure(structure, auto_filename=None)[source]#

Output the figure, by either displaying it on the user’s screen or to the hard-disk as a .png or .fits file.

Parameters:
  • structure (Optional[Structure]) – The 2D array of image to be output, required for outputting the image as a fits file.

  • auto_filename (Optional[str]) – If the filename is not manually specified this name is used instead, which is defined in the parent plotter.

subplot_to_figure(auto_filename=None)[source]#

Output a subplot figure, either as an image on the screen or to the hard-disk as a png or fits file.

Parameters:

auto_filename (Optional[str]) – If the filename is not manually specified this name is used instead, which is defined in the parent plotter.