What is a double histogram?
A double histogram (or comparative histogram) plots two data sets, such as the heights of men and women or test scores before and after a course, on the same bins and axes. Because the bins line up, you can compare the two groups bin by bin instead of guessing across two separate charts.
How to make a double histogram
- Paste the first group’s values into the first data box and the second group’s into the second.
- Rename each data set so the legend reads clearly, for example “Before” and “After”.
- In the Bins tab, pick a bin width and choose Overlap, Side by side or Stacked.
- If the groups differ in size, switch the y-axis to Percent.
- Download the histogram or copy each group’s frequency table.
What to compare
- Center: which group has higher typical values? Turn on the mean or median lines in the Design tab.
- Spread: is one group more variable? Compare the standard deviations in the Statistics view.
- Shape: is one group skewed or bimodal while the other is symmetric?
- Overlap: how many values could belong to either group?
Tips for comparing histograms
- Always use shared bins. Different bin widths make two histograms very hard to compare fairly; this tool shares them automatically.
- Use contrasting colors with about 60% opacity when the bars overlap.
- Add the normal curve for each group to compare the overall shapes without the noise of individual bins.
Only have one group? Use the main histogram maker. Want proportions? Try the relative frequency histogram maker.
Worked example: adult heights
The default example compares 200 men and 200 women with bins of 5 cm. The men’s histogram is centered around 175–180 cm and the women’s around 160–165 cm, and the two overlap between about 165 and 175 cm. That overlap is the key insight: although men are taller on average, many individual women are taller than many individual men. Switch on the mean lines to see the gap between the averages.
Common mistakes to avoid
- Different bins for each group. Bars only line up, and only compare fairly, on identical bins.
- Comparing counts for groups of different sizes. Use Relative or Percent on the y-axis.
- Opaque overlapping bars. Use around 60% opacity, or switch to side-by-side bars.
- Too many groups. Beyond 3 or 4 groups, overlapping histograms get hard to read. Try frequency polygons or box plots.
Do it in other software
| Software | How |
|---|---|
| Python | plt.hist(a, bins=b, alpha=0.6); plt.hist(b_data, bins=b, alpha=0.6), using the same bins for both. |
| Excel | Make a FREQUENCY table for each group on the same bins, then insert a clustered column chart. |
| R | ggplot(df, aes(x, fill = group)) + geom_histogram(position = "identity", alpha = 0.6, binwidth = 5) |
Related tools: Histogram Maker, Relative Frequency Histogram, Cumulative Frequency Histogram, Histogram from a Frequency Table and Frequency Polygon Maker.