################gamma分布图######################
a<-c(1,5,10)
b<-c(0.5,1,2)
par(mfrow=c(1,3))
for(i in 1:3){
plot(seq(0,(3.8a[i]),0.3),dgamma(seq(0,(3.8a[i]),0.3),a[i],1/b[1]),main=substitute(Gamma(a,b),list(a=a[i])), ylab=“P”,xlab=“x”,type=“l”, col=“blue”)
lines(seq(0,(3.8a[i]),0.3),dgamma(seq(0,(3.8a[i]),0.3),a[i],1/b[2]), type=“l”, col=“red”)
lines(seq(0,(3.8a[i]),0.3),dgamma(seq(0,(3.8a[i]),0.3),a[i],1/b[3]), type=“l”, col=“darkgreen”)
legend(“topright”, inset=.005, title=“Beta”, c(“b=0.5”,“b=1”, “b=2”), lty=c(1,1,1), col=c(“blue”, “red”, “darkgreen”), bty=‘n’)##添加图例
abline(h=seq(0.2, 1, 0.2), lty=2, col=“gray”)##添加参考线
text(a[i], dgamma(a[i],a[i],1/b[1]), “text place”, col=“red”)##添加文本
}