Displaying 3 results from an estimated 3 matches for "theme_cowplot".
2023 Aug 12
2
geom_smooth
...- tibble(x_var = runif(100, min = 0, max = 25)
?????????????????????? ,y_var = log2(x_var) + rnorm(100))
library(ggplot2)
library(cowplot)
ggplot(scatter_data,aes(x=x_var,y=y_var))+
? geom_point()+
? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
? theme_cowplot()
I'd like to add a black boundary around the shaded area. I suspect this can be done with geom_ribbon but I cannot figure this out. Some advice would be welcome.
Thanks!
Thomas Subia
2023 Aug 12
1
geom_smooth
...t; ?????????????????????? ,y_var = log2(x_var) + rnorm(100))
>
> library(ggplot2)
> library(cowplot)
>
> ggplot(scatter_data,aes(x=x_var,y=y_var))+
> ? geom_point()+
> ? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
> ? theme_cowplot()
>
> I'd like to add a black boundary around the shaded area. I suspect this can be done with geom_ribbon but I cannot figure this out. Some advice would be welcome.
>
> Thanks!
>
> Thomas Subia
>
> ______________________________________________
> R-help at r-pro...
2023 Aug 12
1
geom_smooth
...orks for me:
ggplot(scatter_data,aes(x=x_var,y=y_var,))+
geom_point()+
geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed") +
geom_ribbon(stat="smooth", aes(ymin=after_stat(ymin), ymax=after_stat(ymax)), fill=NA, color="black")+
theme_cowplot()
Cheers,
Berwin