sbi.analysis.pairplot#
- pairplot(samples, points=None, limits=None, subset=None, upper='hist', lower=None, diag='hist', figsize=(10, 10), labels=None, ticks=None, offdiag=None, diag_kwargs=None, upper_kwargs=None, lower_kwargs=None, fig_kwargs=None, fig=None, axes=None, discrete_indices=None, **kwargs)[source]#
Plot samples in a 2D grid showing marginals and pairwise marginals.
Each of the diagonal plots can be interpreted as a 1D-marginal of the distribution that the samples were drawn from. Each upper-diagonal plot can be interpreted as a 2D-marginal of the distribution.
- Parameters:
samples (List[ndarray] | List[Tensor] | ndarray | Tensor) – Samples used to build the histogram.
points (List[ndarray] | List[Tensor] | ndarray | Tensor | None) – List of additional points to scatter.
limits (List | Tensor | None) – Array containing the plot xlim for each parameter dimension. If None, just use the min and max of the passed samples
subset (List[int] | None) – List containing the dimensions to plot. E.g. subset=[1,3] will plot plot only the 1st and 3rd dimension but will discard the 0th and 2nd (and, if they exist, the 4th, 5th and so on).
upper (List[Literal['hist', 'scatter', 'contour', 'kde'] | None] | ~typing.Literal['hist', 'scatter', 'contour', 'kde'] | None) – Plotting style for upper diagonal, {hist, scatter, contour, kde, None}.
lower (List[Literal['hist', 'scatter', 'contour', 'kde'] | None] | ~typing.Literal['hist', 'scatter', 'contour', 'kde'] | None) – Plotting style for upper diagonal, {hist, scatter, contour, kde, None}.
diag (List[Literal['hist', 'scatter', 'kde', 'bar'] | None] | ~typing.Literal['hist', 'scatter', 'kde', 'bar'] | None) – Plotting style for diagonal, {hist, scatter, kde, bar}.
figsize (Tuple) – Size of the entire figure.
labels (List[str] | None) – List of strings specifying the names of the parameters.
offdiag (str | List[str | None] | None) – deprecated, use upper instead.
diag_kwargs (List[Dict | DiagOptions | None] | Dict | DiagOptions | None) – Additional arguments to adjust the diagonal plot, see the source code in KdeDiagOptions, HistDiagOptions, ScatterDiagOptions or BarDiagOptions.
upper_kwargs (List[Dict | OffDiagOptions | None] | Dict | OffDiagOptions | None) – Additional arguments to adjust the upper diagonal plot, see the source code in KdeOffDiagOptions, HistOffDiagOptions, ScatterOffDiagOptions, ContourOffDiagOptions or PlotOffDiagOptions.
lower_kwargs (List[Dict | OffDiagOptions | None] | Dict | OffDiagOptions | None) – Additional arguments to adjust the lower diagonal plot, see the source code in KdeOffDiagOptions, HistOffDiagOptions, ScatterOffDiagOptions, ContourOffDiagOptions or PlotOffDiagOptions.
fig_kwargs (Dict | FigOptions | None) – Additional arguments to adjust the overall figure, see the source code in FigOptions
fig (FigureBase | None) – matplotlib figure to plot on.
axes (Axes | None) – matplotlib axes corresponding to fig.
discrete_indices (List[int] | None) – List of dimension indices that contain discrete values. When provided, discrete dimensions automatically use bar charts on the diagonal (instead of kde/hist) and scatter with jitter on the off-diagonal (instead of kde/contour). This prevents crashes from KDE on integer-valued data.
**kwargs (Any | None) – Additional arguments to adjust the plot (deprecated).
- Return type:
Tuple[FigureBase, Axes]
Returns: figure and axis of posterior distribution plot