[pstricks] normal curve for statisics

Alan Ristow ristow at ece.gatech.edu
Thu Apr 7 03:32:50 CEST 2005


Doug Mounce wrote:
> Anyone have an example of the normal distribution curve used in basic 
> statistics?  My son says he thinks he has a formula for drawing one, but 
> I'd like to go the laze route if someone has an example in PSTricks.  
> Any tips appreciated, Doug Mounce, MRFM Program, Seattle.

I've done it with a little raw Postscript that looks like this:

\psplot{-4}{4}{%
   1 1 2 3.14159265 mul sqrt mul div 2.71828183 x 0 sub 2 exp neg 2
   1 2 exp mul div exp mul
}%

This example is for mean 0 and standard deviation 1, peaking at x = 0. I 
have rewritten it below for clarity, but replace MU with your desired 
mean and SIGMA with your desired standard deviation:

\psplot{-4}{4}{%
   1 SIGMA 2 3.14159265 mul sqrt mul div 2.71828183 x MU sub 2 exp neg 2
   SIGMA 2 exp mul div exp mul
}%

Finally, depending on how it fits (or doesn't fit) in your diagrams, you 
might need to scale it (with a mul or div) and/or translate it (with an 
add or sub).

Maybe not the ideal solution for you, but it has met my needs. I hope it 
helps.

Alan




More information about the PSTricks mailing list