depictr.ridgeline_plot#
- depictr.ridgeline_plot(data, x, group, title=None)#
Overlapping densities, one ridge per group level.
Each level gets its own filled density on a shared x-axis, stacked so the ridges overlap a little. Reading top to bottom gives a quick sense of how the distribution shifts across levels. Levels are ordered by their median so the progression is easy to follow.
The overlap is faked with
plotnine.facet_grid(): one narrow row per level, panel spacing pulled negative so neighbouring ridges touch. It stays a single ggplot, since plotnine has no dedicated ridgeline geom.- Parameters:
data (pandas.DataFrame) – The data.
x (str) – Name of the numeric column.
group (str) – The grouping column; one ridge is drawn per level.
title (str, optional) – Plot title.
- Return type:
plotnine.ggplot