I'm creating a density plot in ggplot2 using geom_density. Is there a way to highlight the first 50% of cumulative density? So in the attached chart (see image) it would shade the left half of the chart until the cumulative density hits 50%.
Or is there a way to calculate the x value at which the cumulative density hits 50%? Thanks for the help!