# Why do we use density scale when constructing histograms with unequal class widths? [duplicate]

When constructing a histogram with equal class widths, we mark the class boundaries on the horizontal axis and draw above each interval a rectangle whose height corresponds to the relative frequency of that class. However, when dealing with classes of unequal width, my book says we should calculate the height of each rectangle using the formula $$\text{rectangle height}=\frac{\text{relative frequency of the class}}{\text{class width}}$$ My question is, why do we do that? Why not just stick with the relative frequency to determine the height of each rectangle? Thanks.

• This makes the area of each rectangle approximate the probability of the class. Said differently, this makes the histogram itself approximate the probability density function. – Matthew Drury Jan 22 '18 at 20:41
• You describe the construction of a bar chart rather than a histogram. The distinction is that bar charts use height to represent quantities while histograms use areas to represent quantities. The two will have the same appearance (caeteris paribus) when all bins have the same width, whence the confusion. – whuber Jan 22 '18 at 21:35