I used a GNM (Generalised Non-Linear Model) to make a prediction and stored all the data in a data frame. I also stored a pred_up and pred_down variables, which are simply the upper and lower part of the confidence interval, which I would like to plot as a shaded area. By the code bellow I get the following chart
ggplot(plot_males, aes(x = year, y = real_data)) +
geom_line(aes(color = "Obs"), na.rm=TRUE) +
geom_line(aes(x = year, y = pred, color = "Prediction"), na.rm=TRUE) +
geom_line(aes(x = year, y = pred_up, color = "CI"), na.rm=TRUE) +
geom_line(aes(x = year, y = pred_down, color = "CI"), na.rm=TRUE)
What I am trying to accomplish is something like the chart bellow, with the confidence interval area shaded. I know that the ggplot2 has a way of plotting confidence intervals directly but it does not has a GNM method so that is why I am storing my upper and lower CI intervals in the dataset.
Is there a way of shading the interval?

