Pyramid plot
A pyramid plot is a visualization that compares distributions across ordered categories using opposing or stacked bars or shapes.
D3.js in Action, Third Edition
A pyramid chart is a distribution chart that compares two distributions side by side using opposing or adjacent shapes.
- How it is used
- Compares two categorical distributions side by side across shared value brackets.
- How deep it goes
- Builds the chart with bins, separate scales, and proportional marks, but defers detailed implementation beyond focused construction guidance.
- Examples
- Uses salary distributions by gender and age distributions by gender, with bars, lollipops, and dumbbells.
- What you can do after
- Build it from scratch with D3 by binning two datasets and mapping their percentages to opposing chart halves.
Read how D3.js in Action, Third Edition explains pyramid plot →
Statistics Slam Dunk
A pyramid plot is a visualization that uses mirrored or stacked horizontal bars to compare distributions across ordered categories.
- How it is used
- Compares real and adjusted NBA salary-cap values across seasons using mirrored horizontal bars.
- How deep it goes
- Explains sign conversion, reshaping, axis labeling, and ggplot2 construction, stopping short of statistical modeling.
- Examples
- Uses NBA seasons, real dollars, adjusted dollars, mirrored bars, and million-dollar axis labels.
- What you can do after
- Build it from scratch in R by transforming paired measures and plotting them with ggplot2.
Related concepts
- d3.bin()uses · d3.bin() is a D3-array function that groups numeric values into bins according to a configured domain, thresholds, and value accessor.
- histogramhas part · A histogram is a representation that groups observations into bins or value ranges and records their frequencies or other distribution summaries.
- bar chartalternative to · A bar chart is a visualization that compares quantitative values for discrete categories using rectangular bars whose lengths or heights encode magnitude.
- dimensionhas part · A dimension is an independent coordinate, measurable axis, or descriptive attribute used to represent, locate, or analyze something.
- proportionuses · A proportion is a ratio expressing a part or quantity relative to a whole or reference quantity, commonly represented as a fraction, decimal, or percentage.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

