I have been plotting from multiple data.frames;
ggplot() +
geom_line(data=posterior.m, aes(x=time,y=NO.y)) +
geom_line(data=posterior.05, aes(x=time,y=NO.y), linetype = "dotted") +
geom_line(data=posterior.95, aes(x=time,y=NO.y), linetype = "dotted")
Basically, posterior.m cointains medians of the 90 % confidence interval. low 05 is in data frame posterior.05 and high 95 is in posterior.95. In short, this is a plot with 3 lines.
The question is, how can I use geom_ribbon()
or something similar by filling between the median and lower and median and upper. Or simply just fill between lower and upper. I can't get this to work as they are not a part of the same data frame.
Thanks