autogalaxy.plot.PlanePlotter#
- class PlanePlotter[source]#
Bases:
Plotter
Plots the attributes of Plane objects using the matplotlib methods plot() and imshow() and many other matplotlib functions which customize the plot’s appearance.
The mat_plot_1d and mat_plot_2d attributes wrap 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 Visuals1D and Visuals2D objects. Attributes may be extracted from the MassProfile and plotted via the visuals object, if the corresponding entry is True in the Include1D or Include2D object or the config/visualize/include.ini file.
- Parameters
plane (
Plane
) – The plane the plotter plots.grid (
Union
[ndarray
,Grid1D
,Grid2D
,Grid2DIterate
,Grid2DIrregular
]) – The 2D (y,x) grid of coordinates used to evaluate the plane’s light and mass quantities that are plotted.mat_plot_1d (
MatPlot1D
) – Contains objects which wrap the matplotlib function calls that make 1D plots.visuals_1d (
Visuals1D
) – Contains 1D visuals that can be overlaid on 1D plots.include_1d (
Include1D
) – Specifies which attributes of the MassProfile are extracted and plotted as visuals for 1D 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 MassProfile are extracted and plotted as visuals for 2D plots.
Methods
close_subplot_figure
Plots the individual attributes of the plotter's Plane object in 2D, which are computed via the plotter's 2D grid object.
Plots galaxy images for each individual Galaxy in the plotter's Plane in 2D, which are computed via the plotter's 2D grid object.
Returns a list of all indexes of the galaxys in the fit, which is iterated over in figures that plot individual figures of each galaxy in a plane.
Returns an GalaxyPlotter corresponding to a Galaxy in the Tracer.
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
- rtype
get_visuals_2d_of_galaxy
- rtype
Visuals2D
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 the plotter's Plane object in 2D on a subplot, which are computed via the plotter's 2D grid object.
Subplot of the image of every galaxy in the plane.
subplot_of_plotters_figure
Standard subplot of the attributes of the plotter's Plane object.
Attributes
get_1d
get_2d
is_for_subplot
- galaxy_plotter_from(galaxy_index)[source]#
Returns an GalaxyPlotter corresponding to a Galaxy in the Tracer.
- Returns
The index of the galaxy in the Tracer used to make the GalaxyPlotter.
- Return type
galaxy_index
- figures_2d(image=False, plane_image=False, plane_grid=False, convergence=False, potential=False, deflections_y=False, deflections_x=False, magnification=False, contribution_map=False, title_suffix='', filename_suffix='')[source]#
Plots the individual attributes of the plotter’s Plane object in 2D, which are computed via the plotter’s 2D grid object.
The API is such that every plottable attribute of the Plane object is an input parameter of type bool of the function, which if switched to True means that it is plotted.
- Parameters
image (
bool
) – Whether to make a 2D plot (via imshow) of the image of plane in its image-plane (e.g. after lensing).plane_image (
bool
) – Whether to make a 2D plot (via imshow) of the image of the plane in the soure-plane (e.g. its unlensed light).convergence (
bool
) – Whether to make a 2D plot (via imshow) of the convergence.potential (
bool
) – Whether to make a 2D plot (via imshow) of the potential.deflections_y (
bool
) – Whether to make a 2D plot (via imshow) of the y component of the deflection angles.deflections_x (
bool
) – Whether to make a 2D plot (via imshow) of the x component of the deflection angles.magnification (
bool
) – Whether to make a 2D plot (via imshow) of the magnification.contribution_map (
bool
) – Whether to make a 2D plot (via imshow) of the contribution map.title_suffix (
str
) – Add a suffix to the end of the matplotlib title label.filename_suffix (
str
) – Add a suffix to the end of the filename the plot is saved to hard-disk using.
- galaxy_indexes_from(galaxy_index)[source]#
Returns a list of all indexes of the galaxys in the fit, which is iterated over in figures that plot individual figures of each galaxy in a plane.
- figures_2d_of_galaxies(image=False, galaxy_index=None)[source]#
Plots galaxy images for each individual Galaxy in the plotter’s Plane in 2D, which are computed via the plotter’s 2D grid object.
The API is such that every plottable attribute of the galaxy object is an input parameter of type bool of the function, which if switched to True means that it is plotted.
- subplot(image=False, plane_image=False, plane_grid=False, convergence=False, potential=False, deflections_y=False, deflections_x=False, magnification=False, contribution_map=False, auto_filename='subplot_plane')[source]#
Plots the individual attributes of the plotter’s Plane object in 2D on a subplot, which are computed via the plotter’s 2D grid object.
The API is such that every plottable attribute of the Plane object is an input parameter of type bool of the function, which if switched to True means that it is included on the subplot.
- Parameters
image (
bool
) – Whether or not to include a 2D plot (via imshow) of the image of plane in its image-plane (e.g. after lensing).plane_image (
bool
) – Whether or not to include a 2D plot (via imshow) of the image of the plane in the soure-plane (e.g. its unlensed light).convergence (
bool
) – Whether or not to include a 2D plot (via imshow) of the convergence.potential (
bool
) – Whether or not to include a 2D plot (via imshow) of the potential.deflections_y (
bool
) – Whether or not to include a 2D plot (via imshow) of the y component of the deflection angles.deflections_x (
bool
) – Whether or not to include a 2D plot (via imshow) of the x component of the deflection angles.magnification (
bool
) – Whether or not to include a 2D plot (via imshow) of the magnification.contribution_map (
bool
) – Whether or not to include a 2D plot (via imshow) of the contribution map.auto_filename (
str
) – The default filename of the output subplot if written to hard-disk.