The text in my legend cuts off using library(latex2exp)
in a legend.
library(stats)
library(evd)
library(dgumbel)
library(latex2exp)
x=seq(-5,10,length.out=1001)
fgumb=dgumbel(x,location=0,scale=1)
ffrech=dfrechet(x,loc=0,scale=1,shape=1)
fweib=dweibull(x,shape=2,scale=1)
maxes=max(fgumb,ffrech,fweib)
plot(x,fgumb,type='l',lwd=2,col='blue',ylim=c(0,maxes),
ylab="f(x)")
lines(x,ffrech,type='l',lwd=2,col='red')
lines(x,fweib,type='l',lwd=2,col='green')
legend("topright",
legend=c(TeX(r'(Gumbel(\mu=0,\sigma=1)'),
TeX(r'(Frechet(\mu=0,\sigma=1,\xi=1)'),
TeX(r'(Weibull(\sigma=1,\xi=2)')),
col=c("blue","red","green"),
lwd=c(2,2,2),cex=1)
Is there a way to correct this?