Advertisement

Histogram calculator

Prepare a histogram table from a numeric list. Choose the class count and the height scale to control what each bar represents.

Calculator

Separate numbers with commas, spaces or new lines. Use one consistent unit.

Bin width
0.600000
Observation count
5.000000
Histogram bins
Lower edge (included)Upper edge (last included)CountRelative frequencyDensitySelected bar height
1.0000001.6000001.0000000.2000000.3333331.000000
1.6000002.2000002.0000000.4000000.6666672.000000
2.2000002.8000000.0000000.0000000.0000000.000000
2.8000003.4000001.0000000.2000000.3333331.000000
3.4000004.0000001.0000000.2000000.3333331.000000

Advertisement

How this calculator works

The smallest and largest observations define the outer edges. Internal bins are left-closed and right-open; the last also contains the largest value. Count heights add to n, relative heights add to one, and density heights multiplied by width add to one. The table supplies bar edges and heights for plotting. Constant data require a separately chosen display range and are rejected here.

Formula

width = (max-min)/k; relative height_i = f_i/n; density height_i = f_i/(n × width).

Worked example

Data 0, 1, 2, 3, 4 with two bins give edges [0,2) and [2,4], counts 2 and 3, relative heights 0.4 and 0.6, and density heights 0.2 and 0.3.

Advertisement

Frequently asked questions

Can the chart shape change with bin count?

Yes. Too few bins hide detail; too many emphasise random variation.

Why can density be greater than one?

Density is probability per measurement unit. Bar area, rather than height alone, is the probability share.

Is a drawn histogram returned?

The result is a table of exact edges and heights for creating the histogram.

Sources

Advertisement