R pdf set margin
<p>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?</p>

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

<p>Thank you!</p>

<p><a href="https://i.stack.imgur.com/zThXL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zThXL.png" alt="enter image description here"></a></p>