I would like to create geom_density_ridges_gradient plot, but use different fill then x variable. Is it possible?
I have not seen any example on internet
Example of plot:
The only difference, I would like to map different variable to fill. It could be speed, compared to speed limit

Example data:
df <- data.frame(
road = c('a', 'b'),
speed = runif(100, 1, 100)
) %>%
mutate(limit = ifelse(road == 'a', 50, 30),
overlimit = speed - limit)
What works:
ggplot(df, aes(x = speed, y = road, fill = stat(x))) +
geom_density_ridges_gradient()
What does not work:
ggplot(df, aes(x = speed, y = road, fill = overlimit)) +
geom_density_ridges_gradient()
Error message:
The following aesthetics were dropped during statistical transformation: fill i This can happen when ggplot fails to infer the correct grouping structure in the data. i Did you forget to specify a `group` aesthetic or to convert a numerical variable into a factor?
