Closed adrfantini closed 6 years ago
I'll probably have to add this feature at some point. It's frequently requested. In the meantime, note that you can color by quantiles. (Transparency is tricky in this case and needs to be specified in the hex codes for the colors).
ggplot(iris, aes(x=Sepal.Length, y=Species, fill=factor(..quantile..))) +
geom_density_ridges_gradient(calc_ecdf = TRUE, quantiles = c(0.05, 0.95)) +
scale_fill_manual(name = "Probability\nranges",
values = c("#FF0000A0", "#A0A0A0A0", "#0000FFA0")) +
theme_ridges() + scale_y_discrete(expand = c(0.01, 0))
Oooh, this is nice. Could this be added to the examples vignette and/or to the manual? This can definitely be extremely useful.
It's in the documentation for stat_density_ridges()
but probably needs to be featured more prominently or in a different location.
Drawing quantile lines is now possible.
ggplot(iris, aes(x=Sepal.Length, y=Species)) +
geom_density_ridges(quantile_lines = TRUE, quantiles = c(0.25, 0.5, 0.75)) +
scale_y_discrete(expand = c(0.01, 0)) +
theme_ridges(grid = FALSE, center = TRUE)
Thanks for the excellent work.
Adriano Fantini
2017-11-18 22:37 GMT+01:00 Claus Wilke notifications@github.com:
Closed #9 https://github.com/clauswilke/ggridges/issues/9.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clauswilke/ggridges/issues/9#event-1348547030, or mute the thread https://github.com/notifications/unsubscribe-auth/AMO2HR5Of4DBNY5GkaB9p1nu4TRd9jkGks5s304HgaJpZM4QdEBq .
Title says it all, really. It'd be nice to be able to draw vertical quantiles, just like the quantiles that can be drawn by
ggplot
'sgeom_violin()
using the optiondraw_quantiles