hi
with this code i really dont understand why the lines for the legend do not appear…
i tried to understand but can't find any reason and means to fix that…
setwd("/Users/me
![kokrdssqsdsdddsdsqq|480x480](upload://khRxKwyoZuAfIdllLmOKdq9skms.png)
/Dropbox/_aj_liens")
n=10
plage <- seq(0.1,10,len=n)
#s_scale=seq(0.5,10,len=n)
#curve(dgamma(x,shape=a_shape,scale=s_scale),
# xlab="a=1",ylab="",
# add=TRUE)
png("kokrdssqsdsdddsdsqq.png")
par(mfrow=c(2,2))
# ------ a=1 --------
plot.new()
a_shape =1
for (s_scale in plage){
curve(dgamma(x,shape=a_shape,scale=s_scale),
xlab="a=1",ylab="",
xlim=c(0,1),
col=s_scale,
ylim=c(0,1),
axes=TRUE,
add=TRUE)
}
axis(1) # Ajoute l'axe des x en bas
axis(2) # Ajoute l'axe des y à gauche
legend("topright",
legend=c(1:n),
col=plage
)
# ------ a=2 --------
plot.new()
a_shape =2
for (s_scale in plage){
curve(dgamma(x,shape=a_shape,scale=s_scale),
xlab="a=2",ylab="",
col=s_scale,
ylim=c(0,1),
add=TRUE)
}
legend("topright",
legend=c(1:n),
col=plage
)
dev.off()
link to the picture generated https://www.dropbox.com/s/dfugihk1io3zujb/kokrdssqsdsdddsdsqq.png?dl=0