\begin{Schunk}
\begin{Sinput}
 xvals <- seq(0, 30, length.out = 1000)
 chisquare1 <- dchisq(xvals, df = 5)
 chisquare2 <- dchisq(xvals, df = 10)
 chisquare3 <- dchisq(xvals, df = 20)
 plot(xvals, chisquare1, type = "l", xlab = expression(chi^2), ylab = "probability density", 
      ylim = c(0, 0.4), main = "")
 lines(xvals, chisquare2, lty = 2)
 lines(xvals, chisquare3, lty = 3)
 legend("topright", legend = (c(expression(nu == 5), expression(nu == 10), expression(nu == 
      20))), lty = 1:3)
\end{Sinput}
\end{Schunk}
