R语言可视化ggplot2包改变边距(margin)实战(Modify the Margins)
目录
R语言可视化ggplot2包改变边距(margin)实战(Modify the Margins)
#ggplot2包改变边距(margin)语法
ggplot(df, aes(x=x)) +
geom_histogram() +
theme(plot.margin=unit(c(5,1,1,1), 'cm'))
#页边距的顺序是:
unit(c(top, right, bottom, left), units)