I want to add some explanatory text on top (and bottom) of the legend like the following image. Text a and b can depend on the max and min values of the entry and text c on a specific value. Also the colour of the text to reflect the colour of the max or min value, too.
Can this also work if I use ggplotly?
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
theme(legend.position = "bottom")