curve(dchisq(x, df = 2), from = 0, to = 40) curve(dchisq(x, df = 5), from = 0, to = 40,col = "green", add = TRUE) curve(dchisq(x, df = 10), from = 0, to = 40,col = "red", add = TRUE) curve(dchisq(x, df = 30), from = 0, to = 40,col = "orange", add = TRUE) legend("topleft", legend = paste0("DF = ", c(2, 5, 10, 30)), col = c("black", "green", "red", "orange"), lty = 1, lwd = 2)