问题
I need to put smooth border around plot. code
plot(0:10, 0:10, type="n", xlab="X", ylab="Y")
box("figure", col="blue")
instead of simple blue line, how i can put smooth grey line with rounded corners?

many thanks.
回答1:
library(grid)
plot(0:10, 0:10, type="n", xlab="X", ylab="Y")
grid.roundrect(gp=gpar(fill="#00000000", col="grey"))

If you find the borders are being cut off, you can always reduce the size of the rounded rectangle:
plot(0:10, 0:10, xlab="X", ylab="Y")
grid.roundrect(height=0.99, width=0.99, gp=gpar(fill="#00000000", col="grey"))

来源:https://stackoverflow.com/questions/11663382/rounded-border-around-plot-in-r