inst/examples/plot-region.R

# 图形的各种区域说明
par(mar = c(0, 0, 0, 0), mfrow = c(1, 2))
plot.new()
rect(0, 0, 1, 1, col = "lightgray", border = NA)
rect(.1, .1, .9, .9, col = "white")
rect(.1 + .08, .1 + .1, .9 - .04, .9 - .08,
     col = "lightgray", lty = 2)
text(.5, .95, "外边界")
text(.5, .86, "图形区域")
text(.5, .5, "作图区域")
par(cex = .7)
text(.05, .55, "oma[2]")
text(.95, .5, "oma[4]")
text(.5, .05, "oma[1]")
text(.14, .45, "mar[2]")
text(.5, .15, "mar[1]")
par(cex = 1)
plot.new()
rect(0, 0, 1, 1, col = "lightgray", border = NA)
rect(.1, .1, .5, .9, col = "white")
rect(.5, .1, .9, .9, col = "white")
rect(.1 + .08, .1 + .1, .5 - .04, .9 - .08,
     col = "lightgray", lty = 2)
# rect(.5+.08,.1+.1,.9-.04,.9-.08,col="lightgray",lty=2)
text(.5, .95, "外边界")
text(.31, .7, "图 1")
text(.31, .5, "当前作图区域", cex = .7)
text(.72, .75, "图 2")
text(.5, .05, "oma[1]", cex = .7)
yihui/MSG documentation built on Aug. 16, 2021, 12:13 p.m.