Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Histogram PDF

  1. Apr 10, 2010 #1
    Hi guys,

    On my homework, I'm simulating a normal distribution on Mathematica by adding up a bunch of RandomReal[] , that is, uniform(0,1) random variables, and using the central limit theorem. I would like to plot both the histogram and the actual Gaussian probability density function on the same graph, but it does not seem that I'm able to use both the Histogram and Plot functions at the same time. How should I do this? Thanks.
     
  2. jcsd
  3. Apr 11, 2010 #2

    Hepth

    User Avatar
    Gold Member

    You use "Show" to show multiple graphics at a time:

    Show[Histogram[RandomReal[NormalDistribution[0, 1], 200]], Plot[Sin[x], {x, -6 Pi , 6 Pi}]]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica Histogram PDF
  1. Histogram and PDF (Replies: 0)

Loading...