我想更改图例中线条的宽度。目前我有:
legend(-0.145, 25, c("(Gaussian) Kernel density","fitted normal distribution"),lwd=1.8, cex=0.8,
col=c("black","black"), lty=1:2)
Run Code Online (Sandbox Code Playgroud)
lwd 似乎改变了文本,但没有改变线条和虚线的宽度,我该怎么做?
我认为你错了,lwd在你的图例中设置线宽:
比较这个(顶图):
plot(rnorm(100)*13)
legend(-0.145, 25, c("(Gaussian) Kernel density","fitted normal distribution"),lwd=0.1, cex=0.8,
col=c("black","black"), lty=1:2)
Run Code Online (Sandbox Code Playgroud)
有了这个(底部图):
plot(rnorm(100)*13)
legend(-0.145, 25, c("(Gaussian) Kernel density","fitted normal distribution"),lwd=3, cex=0.8,
col=c("black","black"), lty=1:2)
Run Code Online (Sandbox Code Playgroud)
