I would like to highlight the area between two function curves plotted with geom_function.
For example, I create two curves:
ggplot() + geom_function(fun = function(x){x^2}) + geom_function(fun = function(x){x^2 + 1})
How can I highlight the area between these curves? I think geom_ribbon might be the answer, but all the example code I saw for geom_ribbon used a dataset for mapping. How can I do that with geom_function, i.e. curves only based on a function and not on actual data?