curve(dchisq(x, 1), 0, 60, ylab="Density",main="Plot of Chi-Squared Distribution")
curve(dchisq(x, 2), 0, 60, add=TRUE,col="blue")
curve(dchisq(x, 3), 0, 60, add=TRUE,col="green")
curve(dchisq(x, 5), 0, 60, add=TRUE,col="red",lwd=2)
curve(dchisq(x, 10), 0, 60, add=TRUE,col="purple",lwd=2)
curve(dchisq(x, 30), 0, 60, add=TRUE,col="pink",lwd=2)
legend("topright", legend=c("df=1","df=2","df=3","df=5","df=10","df=30"),
                   col=c("black","blue","green","red","purple","pink"),
                   lwd= c(1,1,1,2,2,2))