Relationship
Mosaic Plot
Categorical × categorical contingency table where both row heights and column widths within each row are proportional to joint frequency.
Survey Response by Age Group
Each cell area is proportional to count
View data (12 rows)
| Response | Age | Count |
|---|---|---|
| Strongly agree | 18-29 | 120 |
| Agree | 18-29 | 180 |
| Neutral | 18-29 | 60 |
| Disagree | 18-29 | 40 |
| Strongly agree | 30-49 | 90 |
| Agree | 30-49 | 220 |
| Neutral | 30-49 | 110 |
| Disagree | 30-49 | 80 |
| Strongly agree | 50+ | 50 |
| Agree | 50+ | 140 |
| Neutral | 50+ | 130 |
| Disagree | 50+ | 180 |
Use a mosaic plot when…
- Cross-tabulating two categorical variables
- Showing joint distribution where both marginals matter
- Survey response × demographic crosstabs
Avoid when…
- Time series (use stacked area)
- More than two categoricals (use heatmap or alluvial)
- Numeric × numeric data (use scatter)
Data it needs
| Property | Value |
|---|---|
| Min Rows | 4 |
| Min Columns | 3 |
| Column Types | stringstringnumber |
Visual anatomy
Marks
rectangle
Channels
areacolor-hue
Axes
x-categoricaly-categorical
Guiding principles
Consider instead
Common mistakes
Confusing with marimekko — mosaic varies BOTH row heights and column widths within each row, while marimekko fixes one axis (typically column width = total) and only varies the other
Too many cells (>30) becomes unreadable
History
Mosaic plots were formalized by John Hartigan and Beat Kleiner in 1981 for exploratory contingency-table analysis.
Accessibility notes
Provide the underlying contingency table. Cell tooltips should report count and joint percentage.
Related reading
Got data? Let's see what works.
Drop your CSV. You'll get a Mosaic Plot plus four alternatives - ranked by which one actually fits your data best.