pybop.plot.samples#

Functions#

chains(result[, show, backend, figures, axes])

Plot posterior distributions for each chain.

posterior(result[, backend, show, figures, axes])

Plot the summed posterior distribution across chains.

summary_table(result[, backend, figures, axes, show])

Display summary statistics in a table.

trace(result[, show, backend, figures, axes])

Plot trace plots for the posterior samples.

Module Contents#

pybop.plot.samples.chains(result: pybop.samplers.base_pints_sampler.SamplingResult, show=True, backend=None, figures=None, axes=None)[source]#

Plot posterior distributions for each chain.

Parameters:
  • result (pybop.SamplingResult) – The result of the sampling process.

  • show (bool, optional) – If True, the figure is shown upon creation (default: True).

  • backend (str or pybop.plot.backends.PlotBackend, optional) – Select a plotting backend. If None, the current default backend is used.

  • figures (figure object, optional) – Figure for plotting. If not provided a new figure is created.

  • axes (axis, optional) – The axes to be used for plotting. A single axis is expected.

Returns:

  • None (if show is True)

  • Figure object (if show is False) – The figure object for the chain plots.

pybop.plot.samples.posterior(result: pybop.samplers.base_pints_sampler.SamplingResult, backend=None, show=True, figures=None, axes=None)[source]#

Plot the summed posterior distribution across chains.

Parameters:
  • result (pybop.SamplingResult) – The result of the sampling process.

  • show (bool, optional) – If True, the figure is shown upon creation (default: True).

  • backend (str or pybop.plot.backends.PlotBackend, optional) – Select a plotting backend. If None, the current default backend is used.

  • figures (figure object, optional) – Figure for plotting. If not provided a new figure is created.

  • axes (axis, optional) – The axes to be used for plotting. A single axis is expected.

Returns:

  • None (if show is True)

  • Figure object (if show is False) – The figure object for the posterior distribution plot.

pybop.plot.samples.summary_table(result: pybop.samplers.base_pints_sampler.SamplingResult, backend=None, figures=None, axes=None, show=True)[source]#

Display summary statistics in a table.

Parameters:
  • result (pybop.SamplingResult) – The result of the sampling process.

  • backend (str or pybop.plot.backends.PlotBackend, optional) – Select a plotting backend. If None, the current default backend is used.

  • figures (figure object, optional) – Figure for plotting. If not provided a new figure is created.

  • axes (axis, optional) – The axes to be used for plotting. A single axis is expected.

  • show (bool, optional) – If True, the figure is shown upon creation (default: True).

Returns:

  • None (if show is True)

  • Figure object (if show is False) – The figure object for the summary statistics table.

pybop.plot.samples.trace(result: pybop.samplers.base_pints_sampler.SamplingResult, show=True, backend=None, figures=None, axes=None)[source]#

Plot trace plots for the posterior samples.

Parameters:
  • result (pybop.SamplingResult) – The result of the sampling process.

  • show (bool, optional) – If True, the figure is shown upon creation (default: True).

  • backend (str or pybop.plot.backends.PlotBackend, optional) – Select a plotting backend. If None, the current default backend is used.

  • figures (figure object, optional) – Figure for plotting. If not provided a new figure is created. Can be a single figure or one figure per parameter.

  • axes (single axis or list of axes, optional) – axes for plotting plotly: axes expected to be of the form tuple(row, col) Number of axis must either agree with the number of parameters or be a single axis for all parameters.

Returns:

  • None (if show is True)

  • Figure or list of figures (if show is False) – If show is False, returns a single figure or a list of figures containing the trace plots for each parameter.