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()
Thank you!
width
andheight
arguments topdf
, e.g.,pdf(file = "test.pdf", width=8, height=5)
. – Amokpar(mar=c(4,4,0.5,0.5))
would do that. – Amokpaper="a4r"
, but then your plot will have a margin unless you usewidth=11.69, height=8.27
(or larger measurements with the same aspect ratio). – Amok