Plotting#
PyAutoGalaxy custom visualization library.
Step-by-step Juypter notebook guides illustrating all objects listed on this page are provided on the autogalaxy_workspace: plot tutorials and it is strongly recommended you use those to learn plot customization.
Examples / Tutorials:
Plotters [aplt]#
Create figures and subplots showing quantities of standard PyAutoGalaxy objects.
Basic Plot Functions:
|
Plot an autoarray |
|
Plot an autoarray |
Galaxy and Light / Mass Profile Subplots:
|
Create a subplot showing the image of every light profile in a galaxy. |
|
Create subplots showing lensing quantities for every mass profile in a galaxy. |
|
Create a subplot showing the image of every light profile in a basis. |
|
Create a standard five-panel summary subplot for a collection of galaxies. |
|
Create a subplot showing the individual image of each galaxy. |
|
Create a subplot showing the adapt (model) image for each galaxy. |
Imaging Fit Subplots:
|
Create a six-panel subplot summarising a |
|
Create a three-panel subplot focused on a single galaxy contribution. |
Interferometer Fit Subplots:
|
Create a three-panel subplot summarising a |
|
Create a six-panel subplot of dirty-image diagnostics for an interferometer fit. |
|
Create a real-space summary subplot for an interferometer fit. |
Ellipse Fit Subplots:
|
Create a two-panel subplot summarising a list of ellipse fits. |
|
Create a subplot showing the median ellipse and its uncertainty region from a PDF sample. |
Non-linear Search Plot Functions [aplt]#
Module-level functions for visualizing non-linear search results.
|
|
|
|
|
|
|
Plot Customization [aplt]#
The plotting API is functional: customization is done by passing keyword
arguments directly to any aplt plotting function. There is no MatPlot2D
object anymore (nor the old Cmap / Visuals / Units / matplotlib-wrapper
classes) — these were removed in favour of the keyword-argument interface below.
Every figure and subplot function accepts:
title— the figure title.colormap— the matplotlib colormap name (e.g."jet","hot","gray").use_log10— ifTrue, plot the colormap on alog10scale.output_path— directory to save the figure to (omit to display it interactively).output_filename— the saved file’s name.output_format— the saved file’s format, e.g."png"or"pdf".
For example:
import autogalaxy.plot as aplt
# Customize the appearance:
aplt.plot_array(array=image, title="Image", colormap="jet", use_log10=True)
# Save to disk instead of displaying:
aplt.plot_array(
array=image, output_path="output", output_filename="image", output_format="png"
)
Default plotting values (figure size, fonts, colormaps, ticks, labels, …) are set
via the workspace config/visualize YAML files rather than in code, so most figures
need no customization at all.
Figure Output [aplt]#
The Output object gives lower-level control of how and where figures are written
to disk, and is accepted by the plotting functions in place of the individual
output_* keyword arguments.
Sets how the figure or subplot is output, either by displaying it on the screen or writing it to hard-disk. |