install.packages("lattice")
install.packages("ggplot2")
library("lattice")
library("ggplot2")
library(ggplot2)p1 <- qplot(x1,y1,data=anscombe)
p2 <- qplot(x2,y2,data=anscombe)
p3 <- qplot(x3,y3,data=anscombe)
p4 <- qplot(x4,y4,data=anscombe)
library(gridExtra)
grid.arrange(p1,p2,p3,p4, nrow=2)
利用ggplot2包,盒形图的轴有指标名称:library(ggplot2)
p <- qplot(cut, depth, data=diamonds) + geom_boxplot()
p