Histogram Normalization 'pdf' area under the curve less than 1
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Aug 2019
Answered: MathWorks Support Team
on 27 Jan 2020
Why is the area under the curve (sum of bar areas) less than 1 for 'pdf' normalization in histograms?
Accepted Answer
MathWorks Support Team
on 20 Aug 2019
When using the 'pdf' normalization in Histograms, note that the area of each bar is the relative number of observations. Therefore, the area under the curve could be less than or equal to 1.
An example of the area under the curve being less than 1 is having 'NaN' values in your data.
>> X = [1 1 2 nan];
>> h = histogram(X, 'Normalization', 'pdf')
>> sum(h.Values.*h.BinWidth)
Removing the NaN values from the data can be done like so -
>> X = X(~isnan(X))
0 Comments
More Answers (0)
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!