Displaying 3 results from an estimated 3 matches for "scatter_data".
2023 Aug 12
2
geom_smooth
Colleagues,
Here is my reproducible code for a graph using geom_smooth
set.seed(55)
scatter_data <- 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"...
2023 Aug 12
1
geom_smooth
?s 05:17 de 12/08/2023, Thomas Subia via R-help escreveu:
> Colleagues,
>
> Here is my reproducible code for a graph using geom_smooth
> set.seed(55)
> scatter_data <- 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=&q...
2023 Aug 12
1
geom_smooth
...ode for a graph using geom_smooth
The call "library(tidyverse)" was missing. :)
> 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.
This works 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,
Berwi...