# NOT RUN {
library(dplyr)
library(ggplot2)
tibble(x = 1:10) %>%
group_by_all() %>%
do(tibble(y = rnorm(100, .$x))) %>%
median_qi(.width = c(.5, .8, .95)) %>%
ggplot(aes(x = x, y = y)) +
# automatically uses aes(ymin = .lower, ymax = .upper, fill = fct_rev(ordered(.width)))
geom_lineribbon() +
scale_fill_brewer()
# }
Run the code above in your browser using DataLab