autogalaxy.plot.InversionPlotter#
- class InversionPlotter[source]#
Bases:
Plotter
Plots the attributes of Inversion 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 Inversion and plotted via the visuals object, if the corresponding entry is True in the Include2D object or the config/visualize/include.ini file.
- Parameters
inversion (
AbstractInversion
) – The inversion 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 Inversion are extracted and plotted as visuals for 2D plots.
Methods
close_subplot_figure
Plots the individual attributes of the plotter's Inversion object in 2D.
Plots the individual attributes of a specific Mapper of the plotter's Inversion 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
Returns a MapperPlotter corresponding to the Mapper in the Inversion's linear_obj_list given an input mapper_index.
open_subplot_figure
Setup a figure for plotting an image.
set_filename
set_format
set_mat_plot_1d_for_multi_plot
set_mat_plots_for_subplot
set_title
Plots the individual attributes of a specific Mapper of the plotter's Inversion object in 2D on a subplot.
subplot_of_plotters_figure
Attributes
get_1d
get_2d
is_for_subplot
- mapper_plotter_from(mapper_index)[source]#
Returns a MapperPlotter corresponding to the Mapper in the Inversion’s linear_obj_list given an input mapper_index.
- Parameters
mapper_index (
int
) – The index of the mapper in the inversion which is used to create the MapperPlotter.- Returns
An object that plots mappers which is used for plotting attributes of the inversion.
- Return type
- figures_2d(reconstructed_image=False)[source]#
Plots the individual attributes of the plotter’s Inversion object in 2D.
The API is such that every plottable attribute of the Inversion object is an input parameter of type bool of the function, which if switched to True means that it is plotted.
- Parameters
reconstructed_image (
bool
) – Whether to make a 2D plot (via imshow) of the reconstructed image data.
- figures_2d_of_pixelization(pixelization_index=0, reconstructed_image=False, reconstruction=False, errors=False, regularization_weights=False, zoom_to_brightest=True, interpolate_to_uniform=False)[source]#
Plots the individual attributes of a specific Mapper of the plotter’s Inversion object in 2D.
The API is such that every plottable attribute of the Mapper and Inversion object is an input parameter of type bool of the function, which if switched to True means that it is plotted.
- Parameters
pixelization_index (
int
) – The index of the Mapper in the Inversion’s linear_obj_list that is plotted.reconstructed_image (
bool
) – Whether to make a 2D plot (via imshow) of the mapper’s reconstructed image data.reconstruction (
bool
) – Whether to make a 2D plot (via imshow or fill) of the mapper’s source-plane reconstruction.errors (
bool
) – Whether to make a 2D plot (via imshow or fill) of the mapper’s source-plane errors.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.