Plotting#
PyAutoLens custom visualization library.
Step-by-step Juypter notebook guides illustrating all objects listed on this page are provided on the autolens_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 PyAutoLens objects.
Basic Plot Functions:
|
Plot an autoarray |
|
Plot an autoarray |
Tracer and Galaxies Subplots:
|
Multi-panel subplot of the tracer: image, source images, and mass quantities. |
|
Produce a subplot with one panel per tracer plane showing each plane's image. |
|
Produce a subplot showing per-galaxy images for every plane in the tracer. |
Imaging Fit Subplots:
|
Produce a 12-panel subplot summarising an imaging fit. |
|
Produce a 12-panel subplot summarising an imaging fit with log10 colour scaling. |
|
Produce a 6-panel subplot for a single-plane tracer imaging fit. |
|
Produce a 6-panel log10 subplot for a single-plane tracer imaging fit. |
|
Produce a 4-panel subplot for each plane in the tracer. |
|
Produce a 9-panel tracer subplot derived from a FitImaging object. |
|
Produce a combined multi-row subplot for a list of FitImaging objects. |
|
Produce a combined log10 multi-row subplot for a list of FitImaging objects. |
Interferometer Fit Subplots:
|
Produce a 12-panel subplot summarising an interferometer fit. |
|
Produce a real-space subplot for an interferometer fit. |
Point Source Subplots:
|
Produce a subplot summarising a FitPointDataset. |
|
Produce a subplot visualising a PointDataset. |
Subhalo Detection Subplots:
|
Produce a 4-panel subplot summarising subhalo detection from imaging data. |
|
Produce a 6-panel subplot comparing imaging fits with and without a subhalo. |
Sensitivity Mapping Subplots:
|
Produce a 6-panel subplot comparing a perturbed and unperturbed tracer. |
|
Produce an 8-panel sensitivity-mapping summary subplot. |
Produce a single-panel subplot showing the sensitivity figures-of-merit grid. |
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 autolens.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. |