RegressionKink.plot#
- RegressionKink.plot(*, round_to=2, ci_prob=0.94, hdi_prob=None, kind='ribbon', ci_kind='hdi', num_samples=50, figsize=None, show=True, legend_kwargs=None)[source]#
Plot the regression kink results.
- Parameters:
round_to (
int|None) – Number of decimals used to round numerical results in the figure title (e.g. the Bayesian \(R^2\)). Defaults to 2. UseNoneto render raw numbers.ci_prob (
float) – Probability mass of the highest density interval drawn around the posterior predictive band, and the central credible interval reported in the figure title for the change in gradient at the kink point. Must be in(0, 1]. Defaults toHDI_PROB(currently 0.94).kind (
Literal['ribbon','histogram','spaghetti']) – How posterior uncertainty is rendered viaplot_xY(). Defaults to"ribbon". For"spaghetti"and"histogram", the legend shows individual sample lines rather than a shaded band.ci_kind (
Literal['hdi','eti']) – Credible interval type whenkind="ribbon". Defaults to"hdi".num_samples (
int) – Number of posterior draws whenkind="spaghetti". Defaults to 50. Ignored for other kinds.figsize (
tuple[float,float] |None) – Width and height of the figure in inches, passed tomatplotlib.pyplot.subplots(). Defaults toNone(use matplotlib’s default).show (
bool) – Whether to automatically display the plot. Defaults toTrue.legend_kwargs (
dict[str,Any] |None) – Keyword arguments to adjust legend placement and styling. Supported keys:loc,bbox_to_anchor,fontsize,frameon,title(bbox_transformis accepted alongsidebbox_to_anchor). The existing legend is modified in place so that custom handles are preserved.
- Returns:
fig (matplotlib.figure.Figure) – The figure that was created.
ax (matplotlib.axes.Axes) – The axes object containing the plot.
- Return type: