我想在我的图例中增加Textsize:

正如你在图片中看到的,文本的大小太小了。更改cex只会增加整个图例,这看起来不太好。

有没有办法只增加图例中的文字大小?
现在,我的绘图代码如下所示:
par(font.main=3, font.lab=1, font.sub=1, cex.main=2, cex.lab=1.7, cex.sub=1.2)
plot(plot.DE$Monat,cumsum(log10(1+plot.DE$`12.2`)),type="l",col="blue",main="Momentum-Performance Deutschland",ylab="Portfolio Wert",xlab="Jahr",ylim=c(-0.5,2.5),yaxt ="n"
,cex.main=1.5,cex.lab=1,cex.axis=1)
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$`12.7`)),type="l",col="green")
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$`6.2`)),type="l",col="red")
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$Markt)),type="l",col="yellow")
legend("topleft",legend = c("12-2","12-7","6-2","Markt"),col = c("blue","green","red","yellow"),adj = c(0, 0.5),pt.cex = cex,lty=1, cex=1,bg="grey",y.intersp = 0.8,x.intersp = 1.2)
axis(2, at=seq(0,2,by=1),labels=c("1$","10$","100$"), col.axis="black", las=2,cex.axis=1)发布于 2019-08-23 01:47:11
在图例内部设置pt.cex = 1,然后可以在不更改整个图例大小的情况下更改cex:
示例(cex=1.5):
par(font.main=3, font.lab=1, font.sub=1, cex.main=2, cex.lab=1.7, cex.sub=1.2)
plot(plot.DE$Monat,cumsum(log10(1+plot.DE$`12.2`)),type="l",col="blue",main="Momentum-Performance Deutschland",ylab="Portfolio Wert",xlab="Jahr",ylim=c(-0.5,2.5),yaxt ="n"
,cex.main=1.5,cex.lab=1,cex.axis=1)
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$`12.7`)),type="l",col="green")
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$`6.2`)),type="l",col="red")
lines(plot.DE$Monat,cumsum(log10(1+plot.DE$Markt)),type="l",col="yellow")
legend("topleft",legend = c("12-2","12-7","6-2","Markt"),col = c("blue","green","red","yellow"),pt.cex = 1, cex=1.5,adj = c(0, 0.5),lty=1, ,bg="grey",y.intersp = 0.8,x.intersp = 1.2)
axis(2, at=seq(0,2,by=1),labels=c("1$","10$","100$"), col.axis="black", las=2,cex.axis=1)https://stackoverflow.com/questions/57614539
复制相似问题