0

I cannot understand why does not the curve plot onto the histogram. I think the formula and data are both okay. I really need help on this!! Data description Histogram


image of the formula

I am trying to plot a normal function curve onto the graph

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • 1
    A histogram and a density plot can have very different y-axes. Most likely, that simple fact is behind your issue. Plot both separately and compare the y-axes. – Roland Nov 21 '22 at 14:25
  • when iu try to plot them in different graphs, i receive an error: needed finite values in 'ylim', but i cannot find how to solve it – Javier P Nov 21 '22 at 14:41
  • 1
    [This post](https://stackoverflow.com/questions/19103582/overlay-a-t-distribution-to-my-histogram-using-r) shows a base R example and [this one](https://stackoverflow.com/questions/5688082/overlay-histogram-with-density-curve) is a ggplot solution – DaveArmstrong Nov 21 '22 at 14:52
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Please [do not post code or data in images](https://meta.stackoverflow.com/q/285551/2372064) – MrFlick Nov 21 '22 at 14:59
  • Just add `freq=FALSE` to the `hist` instruction. – Rui Barradas Nov 21 '22 at 15:07

0 Answers0