vm.pl.raincloud
Draw QC distributions as half violins, boxplots, and jittered points.
Signature
def raincloud(
data: ad.AnnData | pd.DataFrame,
*,
metrics: Sequence[str] | str | None = None,
key_added: str | None = None,
groupby: str | None = None,
order: Sequence[str | None] | None = None,
transformed: bool = False,
show_thresholds: bool = True,
palette: str | Sequence = "Set2",
titles: Sequence[str] | None = None,
figsize: tuple[float, float] | None = None,
ax: Axes | Sequence[Axes] | np.ndarray | None = None,
max_points: int | None = 1000,
seed: int = 0,
show: bool = True,
save: str | Path | None = None,
) -> tuple[Axes, ...] | None: ...
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | `ad.AnnData | pd.DataFrame` | required |
metrics | `Sequence[str] | str | None` |
key_added | `str | None` | None |
groupby | `str | None` | None |
order | `Sequence[str | None] | None` |
transformed | bool | False | Plot values in fitting units instead of original metric units. |
show_thresholds | bool | True | Overlay defined thresholds from the stored fit. |
palette | `str | Sequence` | 'Set2' |
titles | `Sequence[str] | None` | None |
figsize | `tuple[float, float] | None` | None |
ax | `Axes | Sequence[Axes] | np.ndarray |
max_points | `int | None` | 1000 |
seed | int | 0 | Random seed for reproducible point subsampling and jitter. |
show | bool | True | Display the figure. If False, return the axes. |
save | `str | Path | None` |
Returns
tuple of matplotlib.axes.Axes or None
One axes per metric when show=False.
Raises
ImportError
If the optional plotting dependencies are not installed.
KeyError
If a requested metric, grouping column, or fitted run is missing.
ValueError
If the metric selection, group order, or display options are invalid.
Notes
Density and boxplot statistics use every finite observation. max_points
limits only the rasterized jittered points. Stored thresholds are not
refitted. Plotting reads the observation table and fit metadata without
changing them.
See Also
Examples
import verymadpy as vm
axes = vm.pl.raincloud(adata, max_points=500, seed=1, show=False)