Population Pyramid
chartAlso known as: age-sex pyramid, demographic pyramid, back-to-back bar chart
Description
A population pyramid is a pair of horizontal bar charts placed back-to-back, sharing a common vertical axis. The vertical axis represents age groups (or any ordinal category), and the horizontal axis represents counts or percentages. One side (conventionally left) shows one sub-group (e.g., males) and the other side shows the complementary sub-group (e.g., females). The result is a distinctive butterfly or pyramid shape that immediately communicates the demographic structure of a population.
The shape of the pyramid tells a powerful story at a glance. A true pyramid shape (wide base, narrow top) indicates a young, growing population. A column shape suggests stable population growth. An inverted pyramid or top-heavy shape signals an aging population. These shapes have become iconic in demography, public health, and policy planning because they distill complex age-sex distributions into an immediately interpretable form.
While the population pyramid is most associated with demography, the back-to-back bar chart pattern generalizes to any comparison of two groups across an ordered set of categories. It can show survey responses by gender, employee counts by department and seniority level, or customer segments by spending tier and loyalty status.
When to Use
- Visualizing the age and sex structure of a population or workforce
- Comparing demographic distributions across two time periods or regions (side by side)
- Showing how two complementary groups distribute across an ordinal variable
- Highlighting demographic bulges, gaps, or imbalances
When NOT to Use
- When comparing more than two groups — use a grouped bar chart or stacked bar chart
- When the categories are not ordinal (no natural order) — a standard bar chart is clearer
- When the two groups are not complementary or of incomparable scale
- For time-series data — use a line graph with two series
Anatomy
- Left bars: Horizontal bars extending leftward from the center axis for one group (values are often negated for layout).
- Right bars: Horizontal bars extending rightward from the center axis for the other group.
- Central axis: The shared vertical axis listing age groups or ordinal categories from bottom to top.
- Value axis: Horizontal axis showing counts or percentages. Labels show absolute values (not negatives).
- Color encoding: Two distinct colors, one per group, with a legend.
- Symmetry line: The vertical center line at zero that divides the two groups.
Variations
- Overlapping pyramid: Both groups are plotted from the same baseline with transparency, showing overlap rather than mirror symmetry.
- Animated pyramid: Transitions between years to show demographic change over time.
- Comparative pyramid: Two pyramids overlaid with outlines, comparing a country’s current structure to a past or projected one.
- Percentage pyramid: Bars show percentages of total population rather than absolute counts, facilitating cross-country comparison.
Code Reference
// Observable Plot - population pyramid
Plot.plot({
marks: [
Plot.barX(data, {
y: "ageGroup",
x: d => d.sex === "Male" ? -d.count : d.count,
fill: "sex",
tip: true
}),
Plot.ruleX([0])
],
x: {
label: "Population",
tickFormat: d => `${Math.abs(d / 1000)}k`
},
y: { label: "Age Group" },
color: { legend: true, domain: ["Male", "Female"], range: ["#4e79a7", "#e15759"] }
})