xmax<-150
par(lwd=2)
curve(dchisq(x, 1, log=FALSE), 0, xmax,col=1, lty=1,
      main="probability density function",xlab="x",ylab="p")
curve(dchisq(x, 10, log=FALSE), 0, xmax,col=2,lty=2,add=T)
curve(dchisq(x, 20, log=FALSE), 0, xmax,col=3,lty=3,add=T)
curve(dchisq(x, 30, log=FALSE), 0, xmax,col=4,lty=4,add=T)
curve(dchisq(x, 40, log=FALSE), 0, xmax,col=5,lty=5,add=T)
curve(dchisq(x, 50, log=FALSE), 0, xmax,col=6,lty=6,add=T)
curve(dchisq(x, 60, log=FALSE), 0, xmax,col=7,lty=7,add=T)
curve(dchisq(x, 70, log=FALSE), 0, xmax,col=8,lty=8,add=T)
curve(dchisq(x, 80, log=FALSE), 0, xmax,col=9,lty=9,add=T)
curve(dchisq(x, 90, log=FALSE), 0, xmax,col=10,lty=10,add=T)
legend("topright",c("n=1","n=10","n=20","n=30","n=40",
                    "n=50","n=60","n=70","n=80","n=90"),
       lwd=rep(1,10),col=1:10,lty=1:10,cex=1.0)