001、
dat <- data.frame(a = 1:5, b = 1:5) dat library(ggplot2) p <- ggplot(data = dat, aes(x = a, y = b)) + geom_point() ## 默认边框, 绘制散点图 p
002、利用theme(plot.margin = unit(c(3,3,3,3), "cm")) 设置边距
p + theme(plot.margin = unit(c(3,3,3,3), "cm")) ## 边距设置为3cm
。
标签:plot,cm,ggplot,边框,theme,绘图,设置 From: https://www.cnblogs.com/liujiaxin2018/p/17580673.html