autogalaxy.plot.MapperPlotter#

class MapperPlotter[source]#

Bases: Plotter

Plots the attributes of Mapper objects using the matplotlib method imshow() and many other matplotlib functions which customize the plot’s appearance.

The mat_plot_2d attribute wraps matplotlib function calls to make the figure. By default, the settings passed to every matplotlib function called are those specified in the config/visualize/mat_wrap/*.ini files, but a user can manually input values into MatPlot2d to customize the figure’s appearance.

Overlaid on the figure are visuals, contained in the Visuals2D object. Attributes may be extracted from the Mapper and plotted via the visuals object, if the corresponding entry is True in the Include2D object or the config/visualize/include.ini file.

Parameters:
  • mapper (Union[MapperRectangularNoInterp, MapperVoronoiNoInterp]) – The mapper the plotter plots.

  • mat_plot_2d (MatPlot2D) – Contains objects which wrap the matplotlib function calls that make 2D plots.

  • visuals_2d (Visuals2D) – Contains 2D visuals that can be overlaid on 2D plots.

  • include_2d (Include2D) – Specifies which attributes of the Mapper are extracted and plotted as visuals for 2D plots.

Methods

close_subplot_figure

figure_2d

Plots the plotter's Mapper object in 2D.

get_subplot_figsize

Get the size of a sub plotter in (total_y_pixels, total_x_pixels), based on the number of subplots that are going to be plotted.

get_visuals_2d_for_data

rtype:

Visuals2D

get_visuals_2d_for_source

rtype:

Visuals2D

open_subplot_figure

Setup a figure for plotting an image.

plot_source_from

Plot the source of the Mapper where the coloring is specified by an input set of values.

set_filename

set_format

set_mat_plot_1d_for_multi_plot

set_mat_plots_for_subplot

set_title

subplot_image_and_mapper

Make a subplot of an input image and the Mapper's source-plane reconstruction.

subplot_of_plotters_figure

Attributes

get_1d

get_2d

is_for_subplot

figure_2d(interpolate_to_uniform=True, solution_vector=None)[source]#

Plots the plotter’s Mapper object in 2D.

Parameters:
  • interpolate_to_uniform (bool) – By default, the mesh’s reconstruction is interpolated to a uniform 2D array for plotting. If the reconstruction can be plotted in an alternative format (e.g. using Voronoi pixels for a Voronoi mesh) settings interpolate_to_uniform=False plots the reconstruction using this.

  • solution_vector (Optional[bool]) – A vector of values which can culor the pixels of the mapper’s source pixels.

subplot_image_and_mapper(image, interpolate_to_uniform=True)[source]#

Make a subplot of an input image and the Mapper’s source-plane reconstruction.

This function can include colored points that mark the mappings between the image pixels and their corresponding locations in the Mapper source-plane and reconstruction. This therefore visually illustrates the mapping process.

Parameters:
  • interpolate_to_uniform (bool) – By default, the mesh’s reconstruction is interpolated to a uniform 2D array for plotting. If the reconstruction can be plotted in an alternative format (e.g. using Voronoi pixels for a Voronoi mesh) settings interpolate_to_uniform=False plots the reconstruction using this.

  • image (Array2D) – The image which is plotted on the subplot.

plot_source_from(pixel_values, zoom_to_brightest=True, interpolate_to_uniform=False, auto_labels=<autoarray.plot.auto_labels.AutoLabels object>)[source]#

Plot the source of the Mapper where the coloring is specified by an input set of values.

Parameters:
  • pixel_values (ndarray) – The values of the mapper’s source pixels used for coloring the figure.

  • zoom_to_brightest (bool) – For images not in the image-plane (e.g. the plane_image), whether to automatically zoom the plot to the brightest regions of the galaxies being plotted as opposed to the full extent of the grid.

  • interpolate_to_uniform (bool) – If True, the mapper’s reconstruction is interpolated to a uniform grid before plotting, for example meaning that an irregular Delaunay grid can be plotted as a uniform grid.

  • auto_labels (AutoLabels) – The labels given to the figure.