diff --git a/docs/api/plot.rst b/docs/api/plot.rst index 7feb8ae27..3849dcef4 100644 --- a/docs/api/plot.rst +++ b/docs/api/plot.rst @@ -1,27 +1,54 @@ ======== -Plotters +Plotting ======== -Create figures and subplots of non-linear search specific visualization of every search algorithm supported +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. + +.. code-block:: python + + import autofit.plot as aplt + + aplt.corner_cornerpy(samples=result.samples) + **Examples / Tutorials:** - `readthedocs: non-linear search example `_ - `autofit_workspace: plot tutorials `_ - `HowToFit: tutorial lectures (detailed step-by-step examples) `_ --------- -Plotters --------- +Search Plot Functions [aplt] +---------------------------- .. currentmodule:: autofit.plot +**Posterior Corner Plots:** + +.. autosummary:: + :toctree: _autosummary + + corner_cornerpy + corner_anesthetic + +**Sampling Trace Plots:** + +.. autosummary:: + :toctree: _autosummary + + subplot_parameters + log_likelihood_vs_iteration + +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: + .. autosummary:: :toctree: _autosummary - :template: custom-class-template.rst - :recursive: - NestPlotter - MCMCPlotter - MLEPlotter \ No newline at end of file + output_figure diff --git a/docs/cookbooks/samples.md b/docs/cookbooks/samples.md index c457affd5..b5db8691f 100644 --- a/docs/cookbooks/samples.md +++ b/docs/cookbooks/samples.md @@ -289,12 +289,11 @@ Sigma = 10.001029545296722 ## Search Plots -The Probability Density Functions (PDF's) of the results can be plotted using the Emcee's visualization -tool `corner.py`, which is wrapped via the `EmceePlotter` object. +The Probability Density Functions (PDF's) of the results can be plotted using the visualization +tool `corner.py`, which is wrapped via the `corner_cornerpy` function. ```python -plotter = aplt.MCMCPlotter(samples=result.samples) -plotter.corner() +aplt.corner_cornerpy(samples=result.samples) ``` This plot appears as follows: diff --git a/docs/cookbooks/search.md b/docs/cookbooks/search.md index 493bfdedc..1924803d6 100644 --- a/docs/cookbooks/search.md +++ b/docs/cookbooks/search.md @@ -152,22 +152,18 @@ search = af.Emcee(number_of_cores=4) ## Plots -Every non-linear search supported by **PyAutoFit** has a dedicated `plotter` class that allows the results of the -model-fit to be plotted and inspected. +The results of a model-fit are plotted and inspected via the plot functions of `autofit.plot`, which wrap the +in-built visualization libraries of the searches. These are fully described in the `plot` package of the workspace. -This uses that search's in-built visualization libraries, which are fully described in the `plot` package of the -workspace. - -For example, `Emcee` has a corresponding `EmceePlotter`, which is used as follows. +For example, `corner_cornerpy` wraps `corner.py` and is used as follows. Checkout the `plot` package for a complete description of the plots that can be made for a given search. ```python samples = result.samples -plotter = aplt.MCMCPlotter(samples=samples) - -plotter.corner( +aplt.corner_cornerpy( + samples=samples, bins=20, range=None, color="k", @@ -256,8 +252,8 @@ Information about Emcee can be found at the following links: The following workspace example shows examples of fitting data with Emcee and plotting the results. -- `autofit_workspace/notebooks/searches/mcmc/Emcee.ipynb` -- `autofit_workspace/notebooks/plot/EmceePlotter.ipynb` +- `autofit_workspace/notebooks/searches/mcmc.ipynb` +- `autofit_workspace/notebooks/plot/emcee_plotter.ipynb` The following code shows how to use Emcee with all available options. diff --git a/docs/overview/the_basics.md b/docs/overview/the_basics.md index 97005e549..aa74a27fc 100644 --- a/docs/overview/the_basics.md +++ b/docs/overview/the_basics.md @@ -539,8 +539,7 @@ algorithm (e.g. the internal dynesty samples). Below we use the samples to plot the probability density function cornerplot of the results. ```python -plotter = aplt.NestPlotter(samples=result.samples) -plotter.corner_anesthetic() +aplt.corner_anesthetic(samples=result.samples) ``` The plot appears as follows: diff --git a/docs/sphinx_warning_baseline.txt b/docs/sphinx_warning_baseline.txt index 3fdcd7c44..e85087aff 100644 --- a/docs/sphinx_warning_baseline.txt +++ b/docs/sphinx_warning_baseline.txt @@ -1 +1 @@ -67 +31