R语言绘图如何把图例绘制在外边及调整图例位置

1、

par(mai=c(2,2,2,2))
plot(1:10)
legend(1,-1,"aaa",xpd=TRUE,box.lwd = 3,
       pch=15)
legend(11,11,"bbb",xpd=TRUE,box.lwd = 3,
       pch=15)

 

 

2、

par(mai=c(2,2,2,2))
plot(1:10)
legend("topleft",inset=c(0.01,0.2),"aaa",xpd=T,box.lwd = 3,
       pch=15)

 

posted @ 2021-01-28 12:07  小鲨鱼2018  阅读(7380)  评论(0编辑  收藏  举报