probly.plot.credal.plot.plot_credal_set

probly.plot.credal.plot.plot_credal_set(data: ArrayCategoricalCredalSet, *, title: str | None = None, labels: list[str] | None = None, series_labels: list[str] | None = None, config: PlotConfig | None = None, show: bool = False, gridlines: bool = True, ground_truth: ArraySingletonCredalSet | None = None) Axes[source]

Plot an Array credal set.

For 2-class credal sets, renders a horizontal interval plot where the x-axis represents P(class 2). For 3-class credal sets, renders a ternary simplex diagram. For 4+ classes, renders a spider (radar) plot.

Dispatches to a type-specific renderer based on the concrete credal set type. For batched inputs, each element in the batch is overlaid on the same axes with a distinct color.

The following types are supported:

Parameters:
  • data – The credal set to plot.

  • title – Title of the plot.

  • labels – Class labels. Defaults to ["C0", "C1", ...].

  • series_labels – Optional legend labels, one per batch element. When provided a legend is shown. Defaults to None (no legend).

  • config – Plot configuration. Defaults to PlotConfig().

  • show – Whether to call plt.show() after plotting.

  • gridlines – Whether to display gridlines. Used for 3-class (ternary) and 4+-class (spider) plots. Defaults to True.

  • ground_truth – Optional ground-truth distribution to overlay as a star marker. Must be an ArraySingletonCredalSet with the same number of classes as data.

Returns:

The matplotlib axes with the plot.

Raises:
  • ValueError – If labels length does not match the number of classes.

  • NotImplementedError – If data is not a supported Array credal set type.