violin_plot

Contents

violin_plot#

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

Create violin 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 violin.

  • showmeans (bool) – Whether to show means.

  • showmedians (bool) – Whether to show medians.

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

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

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

  • xlabel (str) – Axis labels and title.

  • ylabel (str) – Axis labels and title.

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

  • **kwargs – Additional arguments passed to violinplot.

Returns:

ax – The axes object containing the plot.

Return type:

Axes