x <- seq(0, 17, length=1000) fx <- df(df1 = 10, df2 = 12, x) ch1<- dchisq(df=10, x) ch2<- dchisq(df=12, x) plot(x, fx, type="l", ylab = "", xlab="d1 = 10, d2 = 20", col="black",lwd=2) lines(x, ch1, type="l", col="blue", lty = 2, lwd = 2) lines(x, ch2, type="l", col="green", lty = 2, lwd = 2) legend("topright", inset=.05, title="Distributions", c("F", "Chisq, df = 10", "Chisq, df = 20"), lwd=2, lty=c(1, 1, 1, 1, 2), col=c("black", "blue", "green"))