R语言中绘图 设置图例中隐藏图例的框线

 

001、基础绘图

plot(1:10)
legend('topleft',                       ## legend函数默认会带有一个框线
       c("Presence", "Absence"),
       col= "royalblue1", pch = 15,
       cex = 1, text.font = 2, 
       inset= 0.02) 

 

002、去除图例框线

plot(1:10)
legend('topleft', 
       c("Presence", "Absence"),
       col= "royalblue1", pch = 15,
       cex = 1, text.font = 2, 
       inset= 0.02, box.lty = 0)  ## 增加box.lyt 选项可以消除框线

 。

 

posted @ 2024-03-17 12:04  小鲨鱼2018  阅读(428)  评论(0)    收藏  举报