I want to plot the probability density function, but hist(...,normed=1,...) does not work as expected.

Here is the code (with ipython line prompts):

In [69]: n, bins, patches = hist(data, bins = 100, normed = 1)
[ 0.12485649, 0.03013777, 0.03874856, 0.        , 0.00861079, 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.0043054 , 0.0043054 ,
       0.        , 0.        , 0.0043054 , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.0043054 , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.0043054 ,]
In [72]: sum(n)
Out[72]: 0.22388059701492535




Should this not sum to 1.0 for it to be a PDF?
Thanks


The data used is:
Out[66]:
[3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 3.3333333333333335,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 5.5555555555555554,
 6.666666666666667,
 6.666666666666667,
 11.111111111111111,
 11.111111111111111,
 11.111111111111111,
 11.111111111111111,
 11.111111111 111111,
 11.111111111111111,
 11.111111111111111,
 12.5,
 12.5,
 12.5,
 12.5,
 16.666666666666664,
 16.666666666666664,
 16.666666666666664,
 16.666666666666664,
 16.666666666666664,
 22.222222222222221,
 22.222222222222221,
 50.0,
 56.666666666666664,
 66.666666666666657,
 100.0,
 450.0]


Want to start your own business? Learn how on Yahoo! Small Business.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to