Plotting#

Create figures and subplots of the non-linear search specific visualization of every search algorithm supported by PyAutoFit.

The plotting API is functional: import autofit.plot and call a plot function directly, passing it the Samples object of a completed fit. There are no Plotter classes.

import autofit.plot as aplt

aplt.corner_cornerpy(samples=result.samples)

Every plot function forwards its **kwargs to the library it wraps (corner.py, anesthetic, matplotlib), so the wrapped library’s own options are available directly:

aplt.corner_cornerpy(samples=result.samples, bins=5, show_titles=True)

Values PyAutoFit computes — the parameter labels, the sample weights, and the plot range that keeps corner.py from raising “no dynamic range” on a converged parameter — act as defaults a keyword argument overrides. A name the wrapped library does not accept raises a TypeError naming it, rather than being silently ignored.

Examples / Tutorials:

Search Plot Functions [aplt]#

Posterior Corner Plots:

corner_cornerpy(samples[, path, filename, ...])

corner_anesthetic(samples[, path, filename, ...])

Corner plot of the posterior via anesthetic, over every parameter of the model or, with parameter_indices, over a subset of them (the parameters of one model component, say) so that a many-parameter fit stays readable.

Sampling Trace Plots:

subplot_parameters(samples[, use_log_y, ...])

log_likelihood_vs_iteration(samples[, ...])

Figure Output [aplt]#

Every plot function above takes path, filename and format arguments controlling where the figure goes: format="show" (the default) displays it interactively, whereas "png" or "pdf" writes it to path/filename.format. The shared helper that performs this is also public:

output_figure([path, filename, format])