R中的情节周围的圆形边框 [英] Rounded border around plot in R
本文介绍了R中的情节周围的圆形边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在剧情周围放置平滑的边框.代码
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?
非常感谢.
推荐答案
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"))
这篇关于R中的情节周围的圆形边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文