R pdf设置边距 [英] R pdf set margin
本文介绍了R pdf设置边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试为用R生成的pdf设置图形边距.使用mar,我可以减少地块边距.但是,生成的图仍是页面中间的正方形,而不是使用所有空间.我该如何更改?
I am trying to set the figure margin for a pdf generated with R. Using mar, I can reduce the plot margins. However the resulted plot is still a square in the middle of the page instead of using all the space. How can I change that?
pdf(file = "test.pdf", paper="a4r")
par(mar=c(0,0,0,0)+0.1)
plot(1:10,1:10)
dev.off()
谢谢!
推荐答案
在pdf()中,更改宽度和高度参数( https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/pdf.html ).默认值为7和7,这很可能就是页面上有多余空间的原因.
Within pdf(), change the width and height arguments (https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/pdf.html). The default values are 7 and 7, which is likely why there is extra space on your page.
这篇关于R pdf设置边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文