plot_chain_summary#

cosmicjellyfish.analysis.fishconsumer.plot_chain_summary(chains, chain_names=None, truth_values=None, output_file=None, show_errorbars=True, linestyle='--', linecolor='black', blind_params=None, plot_config_kwargs={})[source]#

Create a summary plot of MCMC chains using ChainConsumer.

This function provides a simpler interface for creating summary plots of chains, useful for visualizing parameter constraints in a compact format.

Parameters:
  • chains (list) – List of pandas DataFrames containing MCMC chains

  • chain_names (list, optional) – List of names for each chain to display in the legend

  • truth_values (dict, optional) – Dictionary of true parameter values to plot as vertical lines

  • output_file (str, optional) – Path to save the output figure. If None, the figure is not saved

  • show_errorbars (bool, optional) – Whether to show error bars on the summary plot (default: True)

  • linestyle (str, optional) – Line style for truth values (default: ‘–‘)

  • linecolor (str, optional) – Color for truth value lines (default: ‘black’)

  • blind_params (list, optional) – List of parameter names to blind (exclude) from the plot

  • plot_config_kwargs (dict, optional) – Extra keyword arguments passed to chainconsumer.PlotConfig

Returns:

(ChainConsumer, matplotlib.figure.Figure): the ChainConsumer instance and the generated summary plot figure

Return type:

tuple

Examples

>>> c, fig = plot_chain_summary(
...     chains=[chain1, chain2],
...     chain_names=['MCMC Run 1', 'MCMC Run 2'],
...     truth_values=fiducial_values,
...     output_file='./results/chain_summary.png'
... )