Functions like density and geom_density have the bw parameter which defines the smoothing bandwidth to be used. By default, nrd0 is used which is fine for normal distributions, but it's not optimal for multimodal distributions. Let's say we have the following data frame:
Functions like
density
andgeom_density
have thebw
parameter which defines the smoothing bandwidth to be used. By default,nrd0
is used which is fine for normal distributions, but it's not optimal for multimodal distributions. Let's say we have the following data frame:That's how the density plot looks like with the default bandwidth:
And that's how the same density plot looks like with the Sheather & Jones bandwidth:
Currently, ggridges supports only the default bandwidth:
It would be nice to introduce the
bw
parameter ingeom_density_ridges
andgeom_density_ridges2
.