title: Why is the normal distribution I added to my histogram flat?
body: <p>in my beginner R course we were supposed to create a histogram of a variable and overlap a normal distribution curve, to check if the distribution is heavily skewed. However, my normal distribution is flat and even my tutor has not clue how to correct it. Maybe one of you can help me?</p>
  <p>So this is my code:</p>
  <p><code>hist(na.omit(students$salary),  main = &quot;Students Salary&quot;,  xlab = &quot;Student Salary in $&quot;)</code></p>
  <p><code>x &lt;- 0:80000</code></p>
  <pre><code>curve(dnorm(x, mean = mean(students$salary, na.rm = T), 
          sd = sd(students$salary, na.rm = T)), 
    add = T,col = 'red')
  </code></pre>
  <p>x is set correctly since the Min of my variable is 11444 and the Max is 75597.</p>
  <p>When I rund this code I get the attached picture of a Histogram with a flat normal distribution, but not error. <a href="https://i.stack.imgur.com/2nrKv.png" rel="nofollow noreferrer">Histogram with flat curve</a></p>
  <p>However when I just look at dnom(x) I get lots of 0s. Why is that? How do I change it?
  <a href="https://i.stack.imgur.com/x9RjA.jpg" rel="nofollow noreferrer">dnorm</a></p>