box_plot

Contents

box_plot#

class braintools.visualize.box_plot(data, labels=None, positions=None, notch=False, showmeans=True, ax=None, figsize=(10, 6), colors=None, xlabel='Groups', ylabel='Values', title=None, **kwargs)#

Create box plot for comparing distributions.

Parameters:
  • data (ndarray | List[ndarray]) – Data for each group.

  • labels (List[str] | None) – Group labels.

  • positions (List[float] | None) – Positions for each box.

  • notch (bool) – Whether to show notches.

  • showmeans (bool) – Whether to show means.

  • ax (Axes | None) – Axes to plot on.

  • figsize (Tuple[float, float]) – Figure size if creating new figure.

  • colors (List[str] | None) – Colors for each box.

  • xlabel (str) – Axis labels and title.

  • ylabel (str) – Axis labels and title.

  • title (str | None) – Axis labels and title.

  • **kwargs – Additional arguments passed to boxplot.

Returns:

ax – The axes object containing the plot.

Return type:

Axes