# SmoothHistogram, wrong y-axis with “PDF” option [closed]

I would like to make a SmoothHistogram of some data. Inside SmoothHistogram I want to use the option "PDF" to show then distribution of data. As of my knowledge, in a PDF function, the integral under the curve equals 1. This is what I want, however, my y-axis values in SmoothHistogram are much too large.

data={0.153457, 0.169579, 0.19935, 0.224533, 0.108625, 0.229975, 0.184321, \
0.122864, 0.215802, 0.337952, 0.286443, 0.259728, 0.414498, 0.199196, \
0.266116, 0.114337, 0.330806, 0.156401, 0.181194, 0.135593, 0.228657, \
0.400646, 0.292136, 0.437125, 0.21675, 0.229839, 0.379615, 0.220315, \
0.246973, 0.158653, 0.198648, 0.286902, 0.208426, 0.231079, 0.133473, \
0.211609, 0.159706, 0.155913, 0.25107, 0.203233, 0.177335, 0.354139, \
0.236015, 0.373966, 0.40232, 0.194855, 0.350513, 0.233385, 0.234951, \
0.279452}

SmoothHistogram[data , Automatic, "PDF"]


As you can see, the y-axis is >1, which is not possible in a PDF function.

• "...$y$-axis is $>1$, which is not possible in a PDF function..." - well... Plot[PDF[NormalDistribution[0, 1/20], x] // Evaluate, {x, -3, 3}, PlotRange -> All] – J. M.'s ennui Apr 6 '17 at 8:30
• PDF is the probability density function. There is no reason it should not be greater than 1 at some point. Say, ff it's equal to 5 in a strip with width 0.1, it means that there is 0.5 probability that the RV will fall into that strip. The total probability, of all possibilities, is equal to 1, like in the example. From your description it seems you want the option "Probability" like in Mauricio's answer. However, this is not a valid option for a SmoothHistogram, so you might need to construct your own function. – corey979 Apr 6 '17 at 9:30
Histogram[data, 20, "Probability"]