wilkelab/ggridges

Feature request: `geom_density_ridges` for bounded data

Opened this issue · 1 comments

wbvguo commented

Hi,

Thanks for maintaining this tool. Would it be possible to have an option for setting bounds when plotting the density ridge plot?

Just as the geom_density did in this github post:

tidyverse/ggplot2#3387

Thanks!

I agree that this would be a nice feature. Until it gets implemented, I'll note that the effect can be pretty easily achieved by setting stat to "density" (remember to add height = ..density..)

For example:
ggplot(diamonds, aes(x = price, y = cut, fill = cut, height = ..density..)) + geom_density_ridges(stat = "density", bounds = c(0, 20000))