Based on this example:
#example from https://ggplot2.tidyverse.org/reference/geom_tile.html cars <- ggplot(mtcars, aes(mpg,factor(cyl))) cars + stat_density(ae