tezvyn:

Histogram: See the Shape in Your Data

AI-drafted, machine-checkedSource: Wikipedia: Histogrambeginner
Histogram: See the Shape in Your Data

A histogram turns a raw list of numbers into a picture of its distribution, like sorting coins into stacks. It's used to see where data clusters and how it's spread out. The main footgun: the story your histogram tells depends entirely on the bin size.

WHY IT EXISTS: A raw list of numbers, like thousands of server response times, is hard to interpret. A histogram solves this by grouping the data into a visual format, making it possible to see the underlying distribution, its central tendency, and its spread in a single glance.

THE MENTAL MODEL: Think of a histogram as sorting a large pile of coins into separate stacks based on their value (pennies, nickels, dimes). You aren't looking at individual coins (data points), but at the height of each stack (the frequency). This instantly tells you which coin values are most or least common. A histogram does the same for any numerical data.

HOW IT WORKS: The process involves two main steps. First, you "bin" the data by dividing the entire range of values into a series of consecutive, non-overlapping intervals, which are typically of equal size. For example, for exam scores from 0-100, you might create bins of 0-9, 10-19, and so on. Second, you count how many data points fall into each bin. The resulting counts are then plotted as bars, creating the histogram.

WHEN TO USE IT: Use a histogram during the exploratory phase of any data analysis. It's perfect for getting a quick feel for a single variable's distribution. For instance, you can visualize the distribution of page load times to see if most users have a fast experience or if there's a long tail of slow loads.

WHEN NOT TO USE IT: A histogram is for the distribution of a single continuous variable. Do not use it to compare distributions between many different categories (a box plot might be better) or to show data over time (a line chart is the standard). It is also not for categorical data like "red" or "green" (a bar chart is for that).

ONE CANONICAL EXAMPLE: Imagine you have these 10 response times in milliseconds: 120, 85, 95, 110, 130, 90, 105, 125, 75, 100. Let's create bins of size 20: 70-89, 90-109, 110-129, 130-149. Counting the values, we get: 2 values in the 70-89 bin, 5 in the 90-109 bin, 2 in the 110-129 bin, and 1 in the 130-149 bin. Plotting these counts reveals a central peak in the 90-109ms range.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.