#ggplot2学习笔记##第一节:尝试ggplot
library(ggplot2)
#使用的是R内置数据(mpg)
qplot(displ,hwy,data=mpg,colour=factor(cyl...position="stack") +scale_y_continuous(breaks=seq(0,12000,2000))
#堆叠型bar + y刻度从0到12000,单位2000
#题目二:百分比...height<-predict(model,preds)#通过混合线性模型预测排列组合的身高
oplot+geom_line(data=preds,colour="#3366FF",size=0.4)#在原来黑色图层上增加蓝色预测数据...)
p<- ggplot(df,aes(x,y,label=label))+xlab(NULL)+ylab(NULL)
p+geom_point()+ggtitle("geom_point")#散点效果...#改变点的类型
norm+geom_point(alpha=1/3)#使用透明度参数
#案例2 diamonds数据库
td<-ggplot(diamonds,aes(table,depth))+xlim