title: Chi-Square Density Graph in R
body: <p>How can I plot a chi-square density graph in R?</p>
  
  <p>I got the following codes but I'm not sure how to manipulate them:</p>
  
  <pre><code>curve( dchisq(x, df=28), col='red', main = "Chi-Square Density Graph",
            from=0,to=60)
  xvec &lt;- seq(7.5,60,length=101)
  pvec &lt;- dchisq(xvec,df=28)
  polygon(c(xvec,rev(xvec)),c(pvec,rep(0,length(pvec))),
          col=adjustcolor("black",alpha=0.3))
  </code></pre>
  
  <p>Could someone explain what the codes mean?</p>