R pdf specified stock

I am trying to set the margin size for a PDF created using R. Using mar, I can reduce the margins of the chart. However, the graph below is still a square in the middle of the page, and does not use all the space. How to change this?

pdf(file = "test.pdf", paper="a4r") par(mar=c(0,0,0,0)+0.1) plot(1:10,1:10) dev.off() 

Thanks!

enter image description here

+5
source share
1 answer

Inside 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 probably the extra space on your page.

+1
source

Source: https://habr.com/ru/post/1259751/


All Articles