Effects of Bin Width and Height in a Histogram

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

When reading a histogram, it is important to understand exactly what the vertical scale is measuring and how that is affected by the choice of bins. Here we consider three common choices for the height of a bin: count, probability, and probability density.


Count simply counts the number of items in each bin. Probability is similar to count, except the number of items in each bin is divided by the total number of items. For probability density, the probability is divided by the width of the bin, so that the total area of the rectangles sums to one.

When the bins all have the same width, the resulting histograms all have the same shape, with the heights varying by some constant. When the bins have different widths, count and probability are still similar, but probability density differs.

When the bins all have unit width, probability and probability density are identical.

To add to the potential confusion, narrow bins of a probability density histogram can have a height greater than one.

You can move, add, or remove the locators in the variable width control.


Contributed by: Brett Champion (March 2011)
Open content licensed under CC BY-NC-SA




Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.