 <pre><code>library(grid) plot(0:10, 0:10, type="n", xlab="X", ylab="Y") grid.roundrect(gp=gpar(fill="#00000000", col="grey")) </code></pre> <p><img src="https://i.stack.imgur.com/uSP6W.png" alt="enter image description here"></p> <p>If you find the borders are being cut off, you can always reduce the size of the rounded rectangle:</p> <pre><code>plot(0:10, 0:10, xlab="X", ylab="Y") grid.roundrect(height=0.99, width=0.99, gp=gpar(fill="#00000000", col="grey")) </code></pre> <p><img src="https://i.stack.imgur.com/2DwWA.png" alt="enter image description here"></p>