MATH 1 • STATISTICS & PROBABILITY

Segmented Bar Charts — I can represent categorical data with segmented bar charts and interpret comparisons.

Visualize how categories break down and compare proportions across groups using a single, powerful chart type.

Historical Context & Motivation

Humans have been trying to make sense of data for centuries, and one of the most persistent challenges has been figuring out how to show the composition of something — not just its total size, but what it's made of. Before modern charts existed, people relied on tables full of numbers, which could be overwhelming and hard to compare at a glance. The development of bar charts and their segmented variations gave us a visual shortcut for understanding how parts relate to wholes.

The story of segmented bar charts is intertwined with the broader history of statistical graphics. As societies grew more complex — tracking trade, populations, and public health — the need for clear, comparative visuals became urgent. Pioneers in data visualization realized that stacking colored segments inside a single bar could reveal patterns that raw numbers never could.

1786
William Playfair Invents the Bar Chart
Scottish engineer William Playfair published the first known bar chart in his Commercial and Political Atlas, using bars to compare Scotland's trade data. This laid the groundwork for all bar-based visualizations.
1858
Florence Nightingale's Rose Diagrams
Nightingale used segmented polar-area diagrams to show causes of soldier deaths during the Crimean War. Her work demonstrated that stacking categories within a single graphic could persuade policymakers to act.
1920s
Stacked Bars Enter Textbooks
By the early twentieth century, stacked (segmented) bar charts became a standard tool in statistics textbooks, used to display census data, economic indicators, and survey results.
2000s–Present
Digital Tools Make Segmented Charts Universal
Software like Excel, Google Sheets, and programming libraries such as R and Python's matplotlib have made creating segmented bar charts accessible to students, journalists, and researchers worldwide.

The central question that segmented bar charts answer is deceptively simple: How do the proportions of different categories compare across groups? Whether you're comparing survey responses from two schools, transportation preferences across cities, or the composition of diets across countries, segmented bar charts turn complex categorical data into an intuitive visual story.

Core Principles & Definitions

Before constructing a segmented bar chart, you need to understand a few foundational ideas. A segmented bar chart (also called a stacked bar chart) divides each bar into colored segments that represent subcategories. The length of each segment is proportional to the count or percentage of that subcategory. When every bar is scaled to the same total height (100%), the chart becomes a 100% segmented bar chart, which is specifically designed for comparing proportions rather than raw counts.

1

Categorical Data

Data that can be sorted into groups or categories — such as favorite color, mode of transportation, or grade level — rather than measured on a numerical scale.
2

Two-Way Table

A table that displays the frequency (count) of data for two categorical variables simultaneously. It is the data source from which a segmented bar chart is built.
3

Relative Frequency

The proportion of a specific subcategory within a group, calculated by dividing the subcategory count by the group total. This is what determines segment length in a 100% segmented bar.
4

Conditional Distribution

The distribution of one categorical variable within a fixed level of another variable. A 100% segmented bar chart visually displays the conditional distribution for each group.
5

Association

Two categorical variables are associated if the conditional distribution of one variable changes across levels of the other. If the segments look roughly the same across bars, there is little to no association.
KEY TAKEAWAY
Think of a segmented bar chart like a stack of colored building blocks inside each bar. If you're comparing two groups — say, freshmen and seniors — each bar is a tower built with the same set of colored blocks. A 100% segmented bar chart makes every tower the same height so you can focus entirely on whether the color ratios differ. If the stacks look identical, the two groups have similar distributions. If the color bands shift dramatically, there's an association between the variables.

Visual Explanation

The diagram below shows a 100% segmented bar chart comparing how students in three different schools get to school. Each bar represents one school, and the colored segments within each bar represent the proportion of students who walk, bike, take the bus, or drive. Because every bar reaches 100%, we can directly compare proportions across schools.

Each bar reaches 100%, making it easy to compare the conditional distribution of transportation mode across schools. Notice how School B has a much larger "Walk" segment (cyan) and a smaller "Bike" segment (violet) compared to the others, suggesting different commuting patterns.

Looking at the chart, you can immediately spot differences. School B has the highest proportion of walkers at 40%, while School C relies most heavily on the bus at 40%. School A's segments are the most evenly distributed. These visual differences in the segment widths are exactly what allow us to identify associations between two categorical variables — in this case, the school a student attends and how they commute.

Mathematical Framework

Building a 100% segmented bar chart requires converting raw frequency counts into relative frequencies (proportions or percentages). The formulas are straightforward, but understanding what each calculation represents is essential for interpreting the chart correctly.

RELATIVE FREQUENCY (PROPORTION)
Relative Frequency = (Subcategory Count) ÷ (Group Total)
This gives a decimal between 0 and 1. Multiply by 100 to convert to a percentage. For example, if 24 out of 80 students in School A walk, the relative frequency is 24 ÷ 80 = 0.30, or 30%.
SEGMENT HEIGHT (IN A 100% BAR)
Segment Height = (Relative Frequency) × (Total Bar Height)
If the total bar height on your chart is 10 cm and the relative frequency is 0.30, then the segment's height is 0.30 × 10 = 3 cm. Every segment's height is determined this way, and they must sum to the total bar height.
VERIFICATION CHECK
∑ (All Relative Frequencies within a group) = 1.00 (or 100%)
Always verify that your proportions add up to 1 (or 100%). If they don't, you've made an arithmetic error or are missing a category.
💡 Counts vs. Percentages
A segmented bar chart using raw counts will have bars of different heights (proportional to group size). A 100% segmented bar chart standardizes every bar to the same height. The 100% version is preferred for comparing proportions, especially when group sizes are unequal. If School A surveyed 80 students and School B surveyed 200, raw-count bars would make School B's bar much taller, obscuring the proportional differences.

Interpreting Segmented Bar Charts

Creating a segmented bar chart is only half the task — the real skill lies in interpreting it. When you look at a 100% segmented bar chart, you should focus on three things: individual segment sizes, differences between corresponding segments across bars, and the overall pattern of whether the bars look similar or different.

When the colored bands are nearly the same size across all bars (left), there is no association between the variables. When the bands shift dramatically (right), an association is present. Always ask the three questions shown at the bottom.

When interpreting a segmented bar chart in a statistics class, you should use specific, comparative language. Instead of saying "School B has a lot of walkers," say "The proportion of students who walk is highest at School B (40%), compared with 30% at School A and 20% at School C." Providing percentages and naming the groups strengthens your interpretation and shows statistical reasoning.

⚠️ Beware of Misleading Comparisons
If you use a segmented bar chart with raw counts instead of percentages and the groups are very different sizes, the visual can be misleading. A bar for a group of 500 people will tower over a bar for a group of 50, even if their proportional breakdowns are identical. Always consider whether a 100% segmented bar chart is more appropriate for the comparison you want to make.

Worked Example

A school surveyed 200 students about their favorite type of music. The results are broken down by grade level in the two-way table below. Let's walk through how to construct and interpret a 100% segmented bar chart from this data.

Two-way table: Music preference by grade level
Music Genre9th Grade (n = 60)10th Grade (n = 50)11th Grade (n = 45)12th Grade (n = 45)
Pop241595
Hip-Hop18151314
Rock12101418
Country61098
Constructing and Interpreting a 100% Segmented Bar Chart
1
Step 1 — Compute Relative Frequencies for Each GradeDivide each count by the grade's total. For 9th grade: Pop = 24 ÷ 60 = 0.40 (40%), Hip-Hop = 18 ÷ 60 = 0.30 (30%), Rock = 12 ÷ 60 = 0.20 (20%), Country = 6 ÷ 60 = 0.10 (10%). Check: 40% + 30% + 20% + 10% = 100%. ✓
9th grade: Pop 40%, Hip-Hop 30%, Rock 20%, Country 10%
2
Step 2 — Repeat for Remaining Grades10th grade: Pop = 15 ÷ 50 = 30%, Hip-Hop = 15 ÷ 50 = 30%, Rock = 10 ÷ 50 = 20%, Country = 10 ÷ 50 = 20%. 11th grade: Pop = 9 ÷ 45 = 20%, Hip-Hop = 13 ÷ 45 ≈ 28.9%, Rock = 14 ÷ 45 ≈ 31.1%, Country = 9 ÷ 45 = 20%. 12th grade: Pop = 5 ÷ 45 ≈ 11.1%, Hip-Hop = 14 ÷ 45 ≈ 31.1%, Rock = 18 ÷ 45 = 40%, Country = 8 ÷ 45 ≈ 17.8%.
All four grades' relative frequencies verified to sum to 100%.
3
Step 3 — Draw the BarsCreate four bars of equal height, one for each grade. Stack the genre segments within each bar using the computed percentages. Assign a consistent color to each genre across all bars (for example, Pop = cyan, Hip-Hop = violet, Rock = amber, Country = pink). Label the axes: the horizontal axis shows grade level, and the vertical axis shows percentage from 0% to 100%.
4
Step 4 — Interpret the ChartLook for how the segments shift across the bars. The Pop segment shrinks as grade level increases (from 40% in 9th grade to about 11% in 12th grade). The Rock segment grows (from 20% in 9th grade to 40% in 12th grade). Hip-Hop remains fairly stable around 29–31%. Country varies without a clear trend.
There appears to be an association between grade level and music preference. Pop music's share decreases with grade level, while Rock music's share increases.

Strengths, Limitations & Chart Comparisons

Segmented bar charts are one of several tools for displaying categorical data. Understanding when to use them — and when another chart type would be better — is an important part of statistical literacy. The table below compares four common chart types for categorical data.

Comparison of chart types for categorical data
Chart TypeBest ForLimitations
100% Segmented Bar ChartComparing proportions of subcategories across groups when group sizes differ.Hides actual counts; middle segments are harder to compare because they don't share a common baseline.
Side-by-Side Bar ChartComparing individual category counts or proportions with a common baseline for each segment.Uses more horizontal space; harder to see the overall composition of each group.
Pie ChartShowing proportions of a single group's composition.Difficult to compare multiple groups; humans are poor at judging angles.
Mosaic PlotShowing both the group sizes and proportions simultaneously in a single chart.More complex to read; not commonly covered in introductory courses.
WHEN TO CHOOSE A SEGMENTED BAR CHART
Choose a 100% segmented bar chart when your primary goal is comparing the proportional makeup of several groups. Think of it like comparing the recipes of two different smoothies: you don't care that one person made 32 ounces and the other made 16 — you care whether the banana-to-strawberry ratio is different. If you also need to compare the actual counts, consider a regular segmented bar chart or a side-by-side bar chart instead.

Connection to Advanced Statistical Concepts

Segmented bar charts are your first window into a bigger statistical idea: testing for independence between two categorical variables. In later courses, you'll learn formal methods — like the chi-square test of independence — that quantify whether the differences you see in a segmented bar chart are statistically significant or could have occurred by chance alone.

How segmented bar chart skills connect to advanced statistics
ConceptWhat You're Learning NowWhere It Leads
Conditional distributionReading and comparing the proportions within each bar of a segmented bar chart.Calculating expected counts under independence for chi-square tests.
AssociationVisually noticing when segment proportions differ across groups.Using a chi-square statistic to measure the strength of association numerically.
Two-way tablesOrganizing data and computing row/column percentages.Computing expected frequencies and test statistics for hypothesis testing.
Relative frequencyConverting counts to proportions for chart construction.Connecting to probability: relative frequency as an estimate of theoretical probability.

For now, the key insight is that your eyes are doing informally what the chi-square test does formally. When you look at a 100% segmented bar chart and notice that the segments are dramatically different across bars, you're making an informal judgment that the variables are associated. Future courses will give you the mathematical tools to back up that judgment with a p-value and a confidence level.

Practice Problems

PROBLEM 1CONCEPTUAL
A 100% segmented bar chart shows data from two cities. All four colored segments appear to be roughly the same width in both bars. What does this tell you about the relationship between city and the categorical variable represented by the colors?
PROBLEM 2BASIC CALCULATION
A survey of 120 students at Riverside High asks about their favorite lunch option. The results are: Pizza = 48, Salad = 30, Sandwich = 24, Other = 18. Calculate the relative frequency (percentage) of each category and verify they sum to 100%.
PROBLEM 3INTERMEDIATE
Two stores track customer payment methods. Store A (n = 200): Cash 60, Credit 80, Debit 40, Mobile Pay 20. Store B (n = 150): Cash 15, Credit 45, Debit 45, Mobile Pay 45. Compute the relative frequencies for each store and describe what a 100% segmented bar chart would reveal about the association between store and payment method.
PROBLEM 4APPLIED
A health researcher surveys teens in urban and rural areas about their primary form of exercise. Urban (n = 250): Team Sports 75, Gym 100, Running 50, None 25. Rural (n = 200): Team Sports 60, Gym 20, Running 80, None 40. Construct the conditional distributions, describe what the 100% segmented bar chart would look like, and discuss whether exercise type appears to be associated with location.
PROBLEM 5CRITICAL THINKING
A classmate creates a segmented bar chart (not a 100% chart) using raw counts to compare pet ownership across three neighborhoods. Neighborhood A has 500 residents, Neighborhood B has 80 residents, and Neighborhood C has 300 residents. The classmate concludes that Neighborhood A has the strongest preference for dogs because its dog segment is the tallest. Explain why this conclusion may be flawed and propose a better approach.

Lesson Summary

A segmented bar chart divides each bar into colored segments representing subcategories of categorical data. When standardized to equal heights, the chart becomes a 100% segmented bar chart that shows the conditional distribution of one variable within each level of another. Building one requires computing relative frequencies from a two-way table and verifying that proportions within each group sum to 100%.

To interpret a segmented bar chart, compare the segment widths across bars. If the segments look roughly the same, there is no association between the variables. If the segments shift noticeably, an association exists. This visual skill lays the groundwork for formal tests of independence, like the chi-square test, that you will encounter in more advanced statistics courses. Always use a 100% chart when comparing groups of different sizes, and describe patterns with specific percentages and group names.

Varsity Tutors • Math 1 • Segmented Bar Charts