autogalaxy.plot.GalaxyPlotter#
- class GalaxyPlotter[source]#
Bases:
Plotter
Plots the attributes of Galaxy 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
galaxy (
Galaxy
) – The galaxy the plotter plots.grid (
Union
[ndarray
,Grid1D
,Grid2D
,Grid2DIterate
,Grid2DIrregular
]) – The 2D (y,x) grid of coordinates used to evaluate the galaxy’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 Galaxy object in 1D, which are computed via the plotter's grid object.
Plots the individual attributes of the plotter's Galaxy object in 1D, which are computed via the plotter's grid object.
Plots the individual attributes of the plotter's Galaxy object in 2D, which are computed via the plotter's 2D grid object.
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_1d_light
- rtype
get_visuals_1d_mass
- rtype
get_visuals_2d
- rtype
Returns a LightProfilePlotter given an input light profile, which is typically used for plotting the individual light profiles of the plotter's Galaxy (e.g.
Returns a MassProfilePlotter given an input mass profile, which is typically used for plotting the individual mass profiles of the plotter's Galaxy (e.g.
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
Output a subplot of attributes of every individual light profile in 1D of the Galaxy object.
Output a subplot of attributes of every individual mass profile in 1D of the Galaxy object.
subplot_of_plotters_figure
Attributes
decomposed_light_profile_plotter_list
decomposed_mass_profile_plotter_list
get_1d
get_2d
is_for_subplot
- light_profile_plotter_from(light_profile, one_d_only=False)[source]#
Returns a LightProfilePlotter given an input light profile, which is typically used for plotting the individual light profiles of the plotter’s Galaxy (e.g. in the function figures_1d_decomposed).
- Parameters
light_profile (
LightProfile
) – The light profile which is used to create the LightProfilePlotter.- Returns
An object that plots the light profiles, often used for plotting attributes of the galaxy.
- Return type
- mass_profile_plotter_from(mass_profile, one_d_only=False)[source]#
Returns a MassProfilePlotter given an input mass profile, which is typically used for plotting the individual mass profiles of the plotter’s Galaxy (e.g. in the function figures_1d_decomposed).
- Parameters
mass_profile (
MassProfile
) – The mass profile which is used to create the MassProfilePlotter.- Returns
An object that plots the mass profiles, often used for plotting attributes of the galaxy.
- Return type
MassProfilePlotter
- figures_1d(image=False, convergence=False, potential=False)[source]#
Plots the individual attributes of the plotter’s Galaxy object in 1D, which are computed via the plotter’s grid object.
If the plotter has a 1D grid object this is used to evaluate each quantity. If it has a 2D grid, a 1D grid is computed from each light profile of the galaxy. This is performed by aligning a 1D grid with the major-axis of each light profile in projection, uniformly computing 1D values based on the 2D grid’s size and pixel-scale.
This means that the summed 1D profile of a galaxy’s quantity is the sum of each individual component aligned with the major-axis.
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.
- figures_1d_decomposed(image=False, convergence=False, potential=False, legend_labels=None)[source]#
Plots the individual attributes of the plotter’s Galaxy object in 1D, which are computed via the plotter’s grid object.
This function makes a decomposed plot shows the 1D plot of the attribute for every light or mass profile in the galaxy, as well as their combined 1D plot.
If the plotter has a 1D grid object this is used to evaluate each quantity. If it has a 2D grid, a 1D grid is computed from each light profile of the galaxy. This is performed by aligning a 1D grid with the major-axis of each light profile in projection, uniformly computing 1D values based on the 2D grid’s size and pixel-scale.
This means that the summed 1D profile of a galaxy’s quantity is the sum of each individual component aligned with the major-axis.
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.
- Parameters
image (
bool
) – Whether to make a 1D plot (via plot) of the image.convergence (
bool
) – Whether to make a 1D plot (via imshow) of the convergence.potential (
bool
) – Whether to make a 1D plot (via imshow) of the potential.legend_labels (
Optional
[List
[str
]]) – Manually overrides the labels of the plot’s legend.
- figures_2d(image=False, convergence=False, potential=False, deflections_y=False, deflections_x=False, magnification=False, title_suffix='', filename_suffix='')[source]#
Plots the individual attributes of the plotter’s Galaxy object 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.
- Parameters
image (
bool
) – Whether to make a 2D plot (via imshow) of the image.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.
- subplot_of_light_profiles(image=False)[source]#
Output a subplot of attributes of every individual light profile in 1D of the Galaxy object.
For example, a 1D plot showing how the image (e.g. luminosity) of each component varies radially outwards.
If the plotter has a 1D grid object this is used to evaluate each quantity. If it has a 2D grid, a 1D grid is computed from the light profile. This is performed by aligning a 1D grid with the major-axis of the light profile in projection, uniformly computing 1D values based on the 2D grid’s size and pixel-scale.
- Parameters
image (
bool
) – Whether to make a 1D subplot (via plot) of the image.
- subplot_of_mass_profiles(convergence=False, potential=False, deflections_y=False, deflections_x=False)[source]#
Output a subplot of attributes of every individual mass profile in 1D of the Galaxy object.
For example, a 1D plot showing how the convergence of each component varies radially outwards.
If the plotter has a 1D grid object this is used to evaluate each quantity. If it has a 2D grid, a 1D grid is computed from the light profile. This is performed by aligning a 1D grid with the major-axis of the light profile in projection, uniformly computing 1D values based on the 2D grid’s size and pixel-scale.