2

I'm trying to shade the area under the curve to the right of a given x, which is not the same for all the density plots, but it varies according to the level of y. For example,

A quick sketch of what I'm trying to do

On the package vignette I can only find solutions to shade the areas according to quintiles, but it's not what I'm trying to do (I have cutoffs generated from some modelling).

Any ideas?

library("ggplot")
library("ggridges")

diamonds %>%
   ggplot(aes(x = x, y = cut)) +
   geom_density_ridges()
Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
Andrea M
  • 2,314
  • 1
  • 9
  • 27

0 Answers0