data1 <- data.frame(x = 1:15, # Create example data frame
y = c(runif(15, 0, 2),
runif(15, 2, 6),
runif(15, 3, 4),
runif(15, 1, 3)),
group = rep(LETTERS[1:4], each = 15))
ggplot(data1, aes(x,y, color=group))+
geom_point() +
geom_smooth(se=FALSE)
I have the following plot, and I would like to make the colors of the geom_smoth
be slightly different than points (I.e. darker shade), I can't figure out how I can do it
Thanks @r2evans and @TarJae!
ggplot(data1, aes(x, y, group = group)) +
geom_point(aes(color=group)) +
scale_color_manual(values = c("grey70", "red", "green", "steelblue"))+
ggnewscale::new_scale_color() +
geom_smooth(aes(color=group),se = FALSE) +
scale_color_manual(values = c("grey20", "darkred", "darkgreen", "blue"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With