ggplot(diamonds2, aes(x = cut, y = price,colour = cut)) +
#添加颜色,不同cut方式显示不同颜色
geom_boxplot()
?...ggplot(diamonds2, aes(carat, price, colour = color,
size = price, alpha = depth)) + geom_point()
#根据不同的...color标颜色,点的大小因价格而区分,根据不同的depth显示不同的透明度
?...#facet_wrap和facet_grid不同在于facet_wrap是基于一个因子进行设置,facets
表示形式为:~变量(~单元格);而facet_grid是基于两个因子进行设置,facets...表示形式为:变量~变量(行~列),如果把一个因子用点表示,也可以达到
facet_wrap的效果,也可以用加号设置成两个以上变量
ggplot(diamonds2, aes(carat, price,