I am trying to put the histogram and the pdf of the data together in the same grah in the same scale. The pdf is this actually: enter image description here

However, as I put them in the same graph, it turns like this: enter image description here

How can I fix this? Thank you.

  • $\begingroup$ I try to do that however it gives the second graph again $\endgroup$ – ecco Nov 3 '16 at 15:07
  • 2
    $\begingroup$ I think that this is not a duplicate of the linked question -- @ecco wants a single y scale, while the other question is about having two axes that otherwise line up well. $\endgroup$ – Brett Champion Nov 3 '16 at 15:20
  • 3
    $\begingroup$ Check out the first example in the documentation for Histogram under Applications. Using "PDF" for the third argument of Histogram should give you something that can be combined with a plot of the PDF. $\endgroup$ – Brett Champion Nov 3 '16 at 15:22
  • $\begingroup$ Your two plots don't look anything alike. The top has it's largest value at 0 and another peak at 0.1 while the histogram has largest peak near 0.05. Why should you expect them to line up nicely? The two are plotted on the same axes in the bottom plot. $\endgroup$ – bill s Nov 3 '16 at 15:32
  • $\begingroup$ @bills you are right. I put wrong figure sorry. I want two (histogram and pdf) of them to coincide so that I can see the peaks etc. $\endgroup$ – ecco Nov 3 '16 at 17:03