我想知道如何在图例中更改测试版旁边的正方形的填充颜色 根据:adjustcolor("blue",alpha.f=0.05)
?
这是我的当前R代码(没有成功):
curve(dt(x,19),-5,5)
legend("topright",legend=c(expression(paste("Power")),expression(paste(beta))),
density=c(15,0),angle=140,fill=T,col=c(adjustcolor("blue",alpha.f=0.05),0))
答案 0 :(得分:1)
这样的事情应该有效:
legend("topright",legend=c(expression(paste("Power")),expression(paste(beta))),
density=c(15,0),angle=140,fill=T,border=c('black', 'blue'))
<强> [EDITED] 强>
legend("topright",legend=c(expression(paste("Power")),expression(paste(beta))),
density=c(15,NA),angle=140,fill=c("#000000FF", adjustcolor("blue",alpha.f=0.5)),
border=c("#000000FF", adjustcolor("blue",alpha.f=0.5)))