# SmoothHistogram binning and “Intensity”

I'm having trouble with the way SmoothHistogram handles bins. At the end of the day, I want to express the vertical axis ticks in terms of the normalized values of the bin counts. This can easily be done with Histogram using "Probability" as the binning function, but this is not an option usable for SmoothHistogram. I have tried the following as a workaround:

rdata = RandomReal[{0, 1}, 1000];
bw = 0.01;
bins = BinCounts[rdata, bw];
maxBinCount = Max[bins];
SmoothHistogram[rdata, bw, "Intensity",
PlotRange -> {{0, 1}, Automatic}, Frame -> True,
FrameTicks -> {{Automatic, {{0, "0"}, {maxBinCount, "1"}}}, {Automatic, None}},
LabelStyle -> {Bold, 18}]
ListPlot[bins, Joined -> True]


Clearly, the second plot shows that the actual bin counts are not the things recorded by the "Intensity" binning function. How would I make the RHS ticks scale appropriately from 0 to 1 on the vertical plot space?

Using "PDF" (with maxBinCount replaced by 1 in the ticks) instead of "Intensity" gets closer, but since "PDF" isn't the actual overall probability as "Probability" would have been, this isn't quite right:

• What do you mean by "normalized values of the bin counts" ? And how does using PDF get you "closer" ? Why isn't it close enough? I'm just not understanding what is the desired output. – JimB Apr 16 '18 at 17:45
• @JimB The data should be represented in a vertical range between the values of zero and one. – avikarto Apr 16 '18 at 18:08

I'm guessing that because the distribution in question is bounded by 0 and 1 and "smooth histograms" don't usually produce desired results when there are such bounds. Using the Bounded option of SmoothKernelDistribution will probably get you the desired (and appropriate) output. (I would also suggest using the default bandwidth as 0.01 is way too small).
SeedRandom[12345];