make_fisher_chain_plot#

cosmicjellyfish.analysis.fishconsumer.make_fisher_chain_plot(fishers, chains=None, labels=None, params=None, colors=None, nsigmas=3.0, extents=None, show_fisher=True, show_chains=True, **plot_kwargs)[source]#

Overlay paired Fisher forecasts and weighted posterior chains.

Parameters:
  • fishers (list of fisher_matrix) – Forecasts, one per comparison case. Inputs are not modified.

  • chains (list of pandas.DataFrame or None, optional) – Aligned with fishers; use None for a Fisher-only case. DataFrames contain parameter columns and optionally a weight column. Selecting plotted columns marginalizes the posterior over omitted parameters.

  • labels (list of str, optional) – One unique case label per Fisher. Legend entries append ‘Fisher’ or ‘chain’. Defaults to ‘Case 1’, ‘Case 2’, etc.

  • params (list of str, optional) – Ordered parameters present in every input. Defaults to the first Fisher’s parameters. Fishers are marginalized, never conditioned, to this subset.

  • colors (list of str, optional) – One color per case, shared by its Fisher and chain. A shorter palette cycles by case, including cases without a chain.

  • nsigmas (float, optional) – Automatic limits use each visible Fisher fiducial +/- nsigmas marginalized standard deviations and visible chain weighted quantiles at Phi(-nsigmas) and Phi(nsigmas). Default is 3 (central 99.73% posterior mass). Quantiles interpolate at cumulative-weight midpoints. Limits are the union of visible cases in this call; sparse prior tails do not set them.

  • extents (dict, optional) – Explicit parameter limits, overriding automatic limits for those keys.

  • show_fisher (bool, optional) – Independently display forecasts and posteriors. Both default to True; at least one must be True. Missing chains are skipped without shifting case colors. Hidden inputs do not contribute to limits or get plotted.

  • show_chains (bool, optional) – Independently display forecasts and posteriors. Both default to True; at least one must be True. Missing chains are skipped without shifting case colors. Hidden inputs do not contribute to limits or get plotted.

  • **plot_kwargs – Additional make_triangle_plot options, e.g. param_labels, figsize, legend_kwargs, or savefile. Defaults are dashed unfilled Fishers and shaded chains. Parameter transformations must be applied before calling this helper; use make_triangle_plot for its transform_params interface.

Returns:

Figure for the caller to display, save, or close.

Return type:

matplotlib.figure.Figure

Examples

Compare two forecasts when only the second has a completed posterior:

fig = make_fisher_chain_plot(
    [fisher_a, fisher_b], [None, chain_b],
    labels=['A', 'B'], params=['Omegam', 'h'],
)