opendvp.pl.dual_axis_boxplots

opendvp.pl.dual_axis_boxplots#

dual_axis_boxplots(adata, feature_1, feature_2, group_by=None, ylabel1=None, ylabel2=None, return_fig=False, ax=None, **kwargs)#

Generates a dual-axis plot with boxplots and stripplots for two features.

Parameters:
  • adata (anndata.AnnData) – AnnData object’s observation metadata (adata.obs) is used.

  • feature_1 (str) – Column name in adata.obs for the first feature to plot on the left y-axis.

  • feature_2 (str) – Column name in adata.obs for the second feature to plot on the right y-axis.

  • group_by (str, optional) – Column name in adata.obs to group by. If None, plots features for all samples.

  • ylabel1 (str, optional) – Label for the left y-axis. If None, feature_1 is used.

  • ylabel2 (str, optional) – Label for the right y-axis. If None, feature_2 is used.

  • return_fig (bool) – If True, returns the matplotlib Figure object for further customization.

  • ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, new axes are created.

  • **kwargs (Mapping[str, Any]) – Additional keyword arguments passed to matplotlib boxplot/scatter.

Returns:

fig – The figure object if return_fig is True, otherwise None.

Return type:

matplotlib.figure.Figure or None