Ad Space

Distribution Chart

Statistics

Ad Space

How to Choose the Right Number of Bins

A histogram groups your data into ranges (bins) and shows how many values fall into each — the number of bins you choose directly shapes what pattern you see. Too few bins hide real structure; too many make the chart look noisy and jagged. Sturges' rule offers a reasonable starting point based on sample size.

k=log2(n)+1k = \lceil \log_2(n) + 1 \rceil

k: the suggested number of bins.

n: the number of data points in the dataset.

For a dataset of 200 values, Sturges' rule suggests log2(200)+1=8.64=9\lceil \log_2(200) + 1 \rceil = \lceil 8.64 \rceil = 9 bins. This is only a starting suggestion — try adjusting the bin count manually and watch how the shape of the distribution changes. The rule takes its name from statistician Herbert A. Sturges, who proposed it in a 1926 paper on choosing histogram class intervals.

Reading Histogram Shape — Skewness and Bimodal Distributions

A symmetric, bell-shaped histogram suggests a roughly normal distribution. A long tail stretching to the right is called right-skewed (or positively skewed) — common in things like income or house prices, where most values cluster low with a few very high outliers. A histogram with two separate peaks (bimodal) often hints that your data is really a mix of two different underlying groups rather than one uniform population.

Comparing Two Distributions

Comparing a second dataset — using the same bin edges on both — lets you see shapes directly: are the two distributions centered around the same value, or shifted apart? Is one more spread out than the other? Bars placed side by side are easiest to read exact counts from; checking "Overlay Dataset B behind Dataset A" superimposes both datasets on the same bars instead, which is often clearer for judging overall shape once you have a lot of data points. Switching to "Percentage" instead of raw counts makes either view fair when the two datasets have very different sample sizes.

A Brief History of the Histogram

The term "histogram" was coined by Karl Pearson in the 1890s, combining Greek roots roughly meaning "mast" or "web" (referring to the bars) and "drawing," as part of his broader effort to formalize the vocabulary of statistics. The underlying idea of grouping data into bins and displaying frequency as bar height, however, predates the name: French engineer André-Michel Guerry used similar bar charts to display social statistics like crime rates in the 1830s, and even earlier bar-based frequency displays appear in the work of various 18th-century statisticians studying mortality and population data. The histogram became a cornerstone of exploratory data analysis in the 20th century, particularly promoted by statistician John Tukey, who championed simple, honest visual summaries of data as a first step before any formal statistical modeling.

Common Histogram Mistakes

Choosing too few bins can hide meaningful structure in the data (like a second peak, or skew), while too many bins can make the chart noisy and hard to interpret — there's no single "correct" number, but starting from a reasonable rule of thumb and adjusting visually is usually better than an arbitrary guess. Using unequal bin widths without adjusting for it (typically by plotting density instead of raw count) distorts the visual comparison between bars, since a wider bin will naturally contain more data points even at the same underlying density. Comparing two datasets of very different sizes using raw counts instead of percentages, as covered above, is another common way histograms can visually mislead.

Histogram Terms You Should Know

Bin — a range of values represented by a single bar in a histogram; every value in the dataset falls into exactly one bin.

Frequency — the count of data points falling within a given bin, typically shown as the bar's height.

Skewness — a measure of asymmetry in a distribution's shape; a long tail on one side indicates that direction of skew.

Bimodal Distribution — a distribution with two distinct peaks, often suggesting the data actually comes from two different underlying groups mixed together.

Frequently Asked Questions

How many bins should I use?

This tool suggests a starting point using Sturges' rule (ceil(log2(n) + 1)), which works well for small to moderately sized datasets. Too few bins hide detail; too many bins make the shape look noisy. Try adjusting the number and see what best reveals the underlying pattern.

Why do both datasets need the same bins to compare them?

If each dataset used its own bin edges, the bars wouldn't line up on the X axis and a visual comparison would be meaningless. Sharing bin edges guarantees both histograms are measuring the same value ranges.

What does a bimodal histogram mean?

A bimodal histogram has two separate peaks, suggesting the data may actually be a mix of two different underlying groups rather than one uniform population — for example, heights of a mixed group of adults and children.

Ad Space