[R] How to add a geom_smooth() line

Jeff Reichman reichm@nj @ending from @bcglob@l@net
Fri Aug 24 04:38:56 CEST 2018


R-help

 

I want to add two smooth lines (geom_smooth()) for each scatter plot.  How
do I do that?

 

ggplot() +

  geom_point(data=data, aes(x=timeline, y=deliveries), color="blue") +

  geom_point(data=data, aes(x=timeline, y=launches), color="red") +

  xlab("Deliveries") +

  ylab("Launches") +

  ggtitle("Scatterplot of Launches vs. Deliveries")

 

Jeff


	[[alternative HTML version deleted]]



More information about the R-help mailing list