edubun
English

Histograms and class width

With classes 2 inches wide, 40 of OpenStax's 100 soccer players fall between 65.95 and 67.95 inches; shift the start to 59 and the tallest class moves.

A histogram looks like a bar chart, but it answers a different question. A bar chart compares categories. A histogram shows how the values of one measured quantity are spread out: how many are small, how many are middling, how many are large. To draw one, you cut the number line into intervals called classes, count how many values land in each, and draw touching bars whose heights are those counts. OpenStax suggests a histogram when there are about 100 values or more.

Building one from 100 heights

OpenStax lists the heights of 100 semiprofessional soccer players, measured to the nearest half inch, from 60 to 74 inches. The book picks a convenient starting point one decimal place finer than the data, 60 − 0.05 = 59.95, so that no value falls on a boundary. With 8 classes the width would be (74.05 − 59.95) ÷ 8 = 1.76, rounded up to 2. The classes are then 59.95 to 61.95, 61.95 to 63.95, and so on up to 73.95 to 75.95, and the counts are 5, 3, 15, 40, 17, 12, 7 and 1. They add up to 100.

Loading

Drag to turn. Scroll or pinch to zoom.

The 100 soccer player heights with OpenStax's classes (start 59.95, width 2). Try width 1 and width 4, then move the start to 59 with width 2 and see the tallest class move.

Width changes the picture

There is no single right width. With width 4 from the same start, the counts are 8, 55, 29 and 8: four fat bars that hide the detail. With width 1 they become 2, 3, 0, 3, 15, 0, 21, 19, 2, 15, 9, 3, 5, 2 and 1, a comb with empty gaps that come partly from the half-inch rounding of the measurements. Even the start matters. Keep width 2 but start at 59 instead of 59.95 and the counts become 2, 3, 18, 21, 21, 24, 8 and 3; the tallest class is now 69 to 71 inches. OpenStax mentions a common guideline: about √n classes, so √100 = 10 for these data, and most histograms use between 5 and 15.

Boundaries and relative frequency

Sometimes a value lands exactly on a boundary. OpenStax counts it in the class whose left end it is, not the one it closes, and the lab does the same. The vertical axis can show frequency, the count in each class, or relative frequency, the count divided by the total. The class from 65.95 to 67.95 has frequency 40 and relative frequency 40 ÷ 100 = 0.40, so 40% of the players are in that range. The shape is the same with either label; only the numbers on the axis change.

Bar chart or histogram?

Use a bar chart when the horizontal axis lists separate categories, and a histogram when it is a number line. That is why histogram bars touch: 61.95 is both the end of one class and the start of the next. With small whole-number data, such as the number of books bought, the two pictures look alike, and OpenStax centres each bar on a whole number by starting at 0.5 with width 1.

Unequal classes

Most histograms use classes of equal width, and that is what makes bar heights comparable. OpenStax warns about the opposite: widen one class and its bar covers more area, so the eye gives it more weight than its count deserves. If unequal widths cannot be avoided, for example with income brackets, the height of each bar should be the count divided by the class width, a density, so that area again matches the count. The sample-size lab in the distributions course draws its bars this way.

HistogramTouching bars over a number line showing how values are spread
Class (bin)An interval of the number line
Class widthLength of each interval
Relative frequencyFrequency ÷ total number of values
Square root guidelineAbout √n classes
Value on a boundaryCounted in the class whose left end it is
  1. Heights: (74.05 − 59.95) ÷ 8 classes = ? (two decimals)
  2. With start 59.95 and width 2, what is the upper boundary of the third class?
  3. Relative frequency of the class 65.95 to 67.95 (40 of 100)?
  4. How many players are shorter than 65.95 inches? (counts 5, 3, 15, ...)
  5. Square root guideline: about how many classes for 150 values?
  6. 3 students of a class of 40 scored 90 to 100%. Relative frequency?
  7. Data are whole numbers from 1 to 6. With width 1, where should the first class start?
  8. A value falls exactly on the boundary 20 between classes 10 to 20 and 20 to 30. Where is it counted?
    • 10 to 20
    • 20 to 30
    • Both
    • Neither
  9. Width 2 from 59.95 versus width 2 from 59. What changes?
    • Nothing
    • The counts and even the tallest class
    • Only the colours
    • The number of players
  10. Why do histogram bars touch while bar chart bars do not?
    • Style only
    • The horizontal axis of a histogram is a continuous number line
    • Histograms have fewer bars
    • Bar charts are older
Key points
  • A histogram counts values in classes of a number line and draws touching bars.
  • Class width and starting point change the picture; about √n classes, usually 5 to 15.
  • Relative frequency = frequency ÷ n; a value on a boundary goes in the class whose left end it is.
Sources for this course (9)
  • OpenStax, Introductory Statistics 2e by Barbara Illowsky and Susan Dean (, per the page notice on 2026-10-17): 2.2 histograms, frequency polygons and time series graphs, including the 100 soccer player heights, the books bought by 50 students, class width, convenient starting points, the square root guideline, relative frequency f/n (3 of 40 = 0.075) and the section "How NOT to Lie with Statistics" (Darrell Huff, pie charts, varying class widths, axes that do not start at zero) (openstax.org/books/introductory-statistics-2e/pages/2-2-histograms-frequency-polygons-and-time-series-graphs)
  • Korean births and total fertility rate 2015 to 2025: Ministry of Data and Statistics (국가데이터처, formerly Statistics Korea)
  • "2025년 출생 통계" press release, Table 1 (mods.go.kr/board.es?mid=a10301010000&bid=204&list_no=446625, figures for calendar years 2015 to 2025)
  • TFR definition, 1970 value 4.53, 1983 value 2.06 and replacement level 2.10: e-나라지표 합계출산율 (index.go.kr/unify/idx-info.do?idxCd=5061)
  • US resident population 1950 to 2020 and the four regions in 2010 and 2020: US Census Bureau, Historical Population Change Data (1910-2020)
  • released April 26, 2021, counts as of April 1 of each census year (census.gov/data/tables/time-series/dec/popchange-data-text.html) and 2020 Census Apportionment Results press release (census.gov/newsroom/press-releases/2021/2020-census-apportionment-results.html)
  • William Playfair, Commercial and Political Atlas (1786) and Statistical Breviary (1801): Encyclopedia.com "Statistical Graphics" (encyclopedia.com/social-sciences/encyclopedias-almanacs-transcripts-and-maps/statistical-graphics)
  • J. Sachs, BRANCH (branchcollective.org)
  • I. Spence, "William Playfair and the Psychology of Graphs" (2006).

Checked: 2026-10-17