depictr.raincloud_plot#
- depictr.raincloud_plot(data, x, group=None, title=None)#
Raincloud plot of a numeric variable, optionally split by a group.
A raincloud sets three views of the same distribution side by side: a half-violin density (the “cloud”), a narrow boxplot for the median and quartiles, and the jittered raw points (the “rain”). Seeing the shape, the summary and every observation together guards against the boxplot hiding bimodality or a thin tail (Allen et al., 2021).
- Parameters:
data (pandas.DataFrame) – The data.
x (str) – Name of the numeric column whose distribution is shown.
group (str, optional) – A categorical column. Each level gets its own raincloud along the horizontal axis, coloured by the depictr palette. With no group a single raincloud is drawn.
title (str, optional) – Plot title.
- Return type:
plotnine.ggplot
References
Allen, M., Poggiali, D., Whitaker, K., Marshall, T. R., van Langen, J., & Kievit, R. A. (2021). Raincloud plots: a multi-platform tool for robust data visualization. Wellcome Open Research, 4, 63. https://doi.org/10.12688/wellcomeopenres.15191.2