Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df1<-data.frame(x=c(3,4,5),y=c(15,20,25),grp=c(1,2,2))
- p<-ggplot(df1,aes(x,y))
- p<-p+ geom_point(aes(colour=factor(grp),size=4))
- p
- df2<-data.frame(x=c(3.5,4.5,5.5),y=c(15.5,20.5,25.5))
- p<-p + geom_path(data=df2,aes(x=x,y=y))
- p
- df1$grp = factor(df1$grp)
- colnames(df1)[3] = "Group"
- p = ggplot(df1,aes(x,y))
- p = p+ geom_point(aes(colour=Group), size=4)
- p = p + scale_colour_discrete(name="Group")
- ggplot(df1,aes(x,y)) + geom_point(aes(colour = factor(grp)), size=4) +
- scale_colour_discrete(name = "Grp")
Add Comment
Please, Sign In to add comment