R语言实战中P62页的代码清单3-4
opar <- par(no.readonly = TRUE)
par(fig = c(0, 0.8, 0, 0.8))
plot(mtcars$wt, mtcars$mpg, xlab = "Miles Per Gallon",
ylab = "Car Weight")
par(fig = c(0, 0.8, 0.55, 1), new = TRUE)#这里为什不是c(0, 0.8, 0.8, 1)
boxplot(mtcars$wt, horizontal = TRUE, axes = FALSE)
par(fig = c(0.65, 1, 0, 0.8), new = TRUE))#这里为什不是c(0.8, 1, 0, 0.8)
boxplot(mtcars$mpg, axes = FALSE)
mtext("Enhanced Scatterplot", side = 3, outer = TRUE,
line = -3)
par(opar)
谢谢各位。