I use the following example data and code
# Example df <- data.frame(a=runif(100),b=runif(100),c=runif(100)) df$Metric <- ifelse(df$a > 0.5,"a", "b") df$Methodology <- ifelse(df$a > 0.5,"One", "Two") df$Methodology <- factor(df$Methodology) pl<-df %>% group_by(Methodology) %>% do( plots = ggplot(data=., aes(x = a, y = b)) + geom_point() + stat_smooth(method="auto",size=1.5) + stat_summary(fun.data=median_hilow, fun.args=(conf.int=1)) + # Show IQR facet_wrap(~Metric, scales="free") + ggtitle(unique(.$Methodology)) ) pl[[1,2]]
The output I see is:
However, I would also like to also see another ribbon plot showing the inter quartile range calculated by
stat_summary, as well as a line showing the median value.
I suspect I will have to write a user defined function and play with that.
Appreciate any hints or tips.