Histogram: How to Make One, Choose Bins and Read the Shape
Open the Histogram Tool (opens in a new tab)
What is a histogram?
A histogram divides measured data into several intervals and shows the number of data points in each interval as the height of a bar. It lets you see at a glance where the data are concentrated and how widely they are spread (the distribution).
The intervals into which the data are divided are called “bins,” and the number of data points in each bin is called the “frequency.” A table that collects the frequency of each bin is called a “frequency table.”
What a histogram tells you
- Location of the center: where the data are concentrated
- Size of the variation: how widely the data are spread
- Shape of the distribution: whether it is symmetric or skewed, and how many peaks it has
- Relation to the specification limits: whether the data stay within the upper and lower specification limits, and whether the center is off
The strength of a histogram is that it shows the “shape,” which cannot be seen from numbers such as the mean and standard deviation alone.
Steps to make one
- Collect the data: To see the shape, a guideline is to collect 50 to 100 or more data points
- Find the maximum and minimum: Find the range of the whole data (maximum − minimum)
- Decide the number of bins: A guideline is the square root of the number of data points n (√n), which is about 10 for 100 points. You can also use Sturges’ rule (1 + log2 n), which gives about 8 for 100 points
- Decide the bin width: Divide the range by the number of bins and round to an integer multiple of the measurement unit (the smallest increment of the measured values)
- Decide the bin boundaries: Set the first boundary to the minimum minus half the measurement unit. Because no data point falls exactly on a boundary, there is no doubt about which bin it belongs to
- Count the frequencies and draw the bars: Count the data points in each bin to make a frequency table, and draw it as a bar chart. Draw the bars without gaps between them
Worked example
The dimension of a part was measured on 100 pieces. The measurement unit is 0.01, the maximum is 10.47, and the minimum is 9.52.
- Range = 10.47 − 9.52 = 0.95
- Number of bins = √100 = 10
- Bin width = 0.95 ÷ 10 = 0.095 → rounded to an integer multiple of the measurement unit 0.01, giving 0.10
- First boundary = 9.52 − 0.01 ÷ 2 = 9.515
Dividing at intervals of 0.10 from 9.515 and counting the frequencies gives the following table.
| Bin | Bin center | Frequency |
|---|---|---|
| 9.515 to 9.615 | 9.565 | 2 |
| 9.615 to 9.715 | 9.665 | 5 |
| 9.715 to 9.815 | 9.765 | 9 |
| 9.815 to 9.915 | 9.865 | 15 |
| 9.915 to 10.015 | 9.965 | 20 |
| 10.015 to 10.115 | 10.065 | 19 |
| 10.115 to 10.215 | 10.165 | 14 |
| 10.215 to 10.315 | 10.265 | 9 |
| 10.315 to 10.415 | 10.365 | 5 |
| 10.415 to 10.515 | 10.465 | 2 |
| Total | 100 |
A commonly seen shape: highest near the center and spreading almost symmetrically to both sides.
How to read the shape
From the shape of a histogram, you can infer the condition of the process and the data. The typical shapes often used in quality control are as follows.
| Shape | Characteristic | What it may indicate |
|---|---|---|
| Bell-shaped | Highest near the center and close to symmetric | Often seen when the process is stable |
| Comb | Every other bin has a low frequency | The bin width is not an integer multiple of the measurement unit, or the measurer has a habit in reading the values |
| Skewed | A long tail extends on one side only | There is a limit on one side, as with values that cannot go below 0 (amount of impurities, runout, etc.) |
| Truncated (cliff) | Cut off abruptly at one end | Data after the out-of-specification items were removed (100% screening) |
| Plateau | Frequencies hardly change and spread out flat | Several distributions with slightly different means are mixed |
| Bimodal (twin-peaked) | Two peaks | Two distributions with different means are mixed (two machines, two kinds of material, etc.) |
| Isolated peak | A small peak far away | Outlying data or data from another process are mixed in, or a measurement error |
When a shape other than the bell shape appears, it is a cue to investigate the cause.
Comparing with specification limits
Laying lines for the upper and lower specification limits over a histogram shows the margin relative to the specification limits, any values beyond them, and any off-center position. The process capability index Cpk expresses the capability of the process relative to the specification limits as a number. An example of a histogram with specification lines and how to calculate Cpk are explained in What Is Cpk?
Looking at the data by stratification
When several distributions seem to be mixed, as in a bimodal or plateau shape, split the data by equipment, lot, operator, time of day, and so on (stratify it), and redraw a histogram for each part. If each of the split histograms becomes bell-shaped, you can tell which group’s mean or variation is different.
Points to note when using it
- The shape is unstable with few data points: With few data points, the shape can change greatly by chance. When judging the shape, collect enough data
- The choice of bins changes how it looks: With too few bins the shape is not visible, and with too many, the bumps stand out. It is also effective to increase or decrease the number a little from the guideline and check how it looks
- It does not show changes over time: A histogram has no information on the order in which the data were taken. Check on a control chart whether the process changed partway through
Making one in Excel
In Excel 2016 or later, select the data and choose Insert › Insert Statistic Chart › Histogram. You can change the bin width and the number of bins in Format Axis for the horizontal axis.
If you want to set the bin boundaries yourself and make a frequency table, use the COUNTIFS function. This is an example where the data are in A2 to A101, the lower bin boundaries are in column D, and the upper boundaries are in column E.
| What to calculate | Example formula |
|---|---|
| Maximum | =MAX(A2:A101) |
| Minimum | =MIN(A2:A101) |
| Frequency (enter in F2 and copy down) | =COUNTIFS($A$2:$A$101,">"&D2,$A$2:$A$101,"<="&E2) |
If you shift the boundaries by half the measurement unit, no data point falls on a boundary, so counting with “>” or “<=” gives the same result either way.
Making one with the tool on this site
With the Histogram Tool, just paste in your data and it draws a histogram and also calculates a frequency table and basic statistics (mean, standard deviation, median, etc.). The number of bins is determined automatically by Sturges’ rule, and you can also change the number or width. You can also overlay a normal distribution curve and compare data for up to 5 groups. No registration is required, and it is free to use.