jwspecmcmc.plotting
Diagnostic plots for MCMC results.
Corner plots, trace plots, and flux posterior histograms.
Functions
|
Corner plot of posterior samples. |
|
Histogram of the flux posterior for a single line. |
|
Trace plots of MCMC chains. |
- jwspecmcmc.plotting.plot_corner(result, *, params=None, truths=None, quantiles=None, **corner_kwargs)[source]
Corner plot of posterior samples.
- Parameters:
result (MCMCResult) – MCMC result.
params (list of str, optional) – Parameter names to include (e.g.
["A_OIII_5007", "sigma_Ha"]). IfNone, plots all free parameters.truths (np.ndarray, optional) – True values to mark on the plot.
quantiles (list of float, optional) – Quantiles for corner (default
[0.16, 0.5, 0.84]).**corner_kwargs – Additional keyword arguments passed to
corner.corner().
- Return type:
- jwspecmcmc.plotting.plot_flux_posterior(result, line_name, *, bins=50, ax=None)[source]
Histogram of the flux posterior for a single line.
- Parameters:
result (MCMCResult) – MCMC result.
line_name (str) – Line name (e.g.
"OIII_5007").bins (int) – Number of histogram bins.
ax (matplotlib.axes.Axes, optional) – Axes to plot on. If
None, creates a new figure.
- Return type:
- jwspecmcmc.plotting.plot_traces(result, *, params=None, figsize=None)[source]
Trace plots of MCMC chains.
- Parameters:
result (MCMCResult) – MCMC result. Must have
chains(i.e. from emcee).params (list of str, optional) – Parameter names to plot. If
None, plots all free parameters.figsize (tuple, optional) – Figure size.
- Return type:
- Raises:
ValueError – If per-chain samples are not available (e.g. nautilus result).