Introduction
Mosaic plots are a visual tool that helps you see relationships among categorical variables quickly. By mapping proportions to areas, they let readers spot patterns, similarities, and imbalances at a glance without complex statistics. This article explains what mosaic plots are, how to read them, when to use them, and what they reveal about categorical data.
- What is a mosaic plot?
- Key components and terminology
- How a mosaic plot is constructed (plain explanation)
- What mosaic plots reveal at a glance
- Concrete examples to build intuition
- How to read patterns and what they mean
- Common enhancements and variations
- When to use a mosaic plot and when not to
- Interpretation pitfalls and how to avoid them
- Practical applications
- Brief guidance for creating your own mosaic plot
- Tools that produce mosaic plots
- Example checklist for interpreting a mosaic plot
- Conclusion
What is a mosaic plot?
A mosaic plot is a two-dimensional chart for displaying the joint distribution of two or more categorical variables. Each rectangular tile in the plot represents a combination of category values, and the area of the tile is proportional to the frequency or proportion of observations that fall into that combination.
Where a bar chart shows counts or proportions for a single categorical variable, a mosaic plot extends that idea by showing how categories interact. For example, instead of separate bars for “male” and “female,” a mosaic plot could show how gender and voting preference combine, with each tile sized according to how many people have that combination.
Key components and terminology
Rectangle: The basic building block; its width and height correspond to marginal and conditional proportions.
Tiles: Sub-rectangles that represent specific combinations of category levels (for example, “Red” shirts and “Small” size).
Marginal proportion: The overall proportion of observations in a single category (used to set one axis).
Conditional proportion: The proportion of observations within one category that have a particular value of another variable (used to set the other axis).
Color or shading: Optional visual cues that represent a statistic such as standardized residuals, observed vs expected frequencies, or another variable.
How a mosaic plot is constructed (plain explanation)
Start with one categorical variable and divide the plotting area horizontally in proportion to the frequencies of its categories. For a second variable, divide each horizontal strip vertically in proportion to the frequencies of that second variable within each first-variable category. The result is a grid of tiles whose areas correspond to counts or proportions of observations in each combination.
With more than two variables, construction continues by subdividing tiles further. For example, the third variable might divide each tile vertically again (or horizontally, depending on convention), producing a nested set of rectangles where each final tile corresponds to a specific combination of all variables.
What mosaic plots reveal at a glance
Overall distribution: The relative widths (or heights) of large blocks show the marginal distribution of a primary variable immediately—how common each category is in the dataset.
Interactions and associations: If the vertical splits inside horizontal strips have similar patterns across strips, that suggests little or no association between variables. If patterns differ substantially, that signals an association or interaction.
Imbalances: Large, disproportionately sized tiles stand out, highlighting dominant category combinations or rare groups that may need separate handling.
Conditional proportions: You can compare proportions within each category by comparing tile heights within the same horizontal band—this helps see how the second variable behaves conditional on the first.
Missing or sparse cells: Very small or absent tiles reveal combinations that have few or no observations, which might affect analysis or indicate data collection gaps.
Concrete examples to build intuition
Example 1 — Two variables: Suppose a survey records pet ownership (Dog, Cat, None) and city size (Large, Medium, Small). A mosaic plot with pet ownership on the horizontal axis might show a wide “None” band (many respondents without pets). Within each band, vertical tiles for city size differ: a tall “Large” tile inside “Dog” would indicate proportionally more dog owners in large cities.
Example 2 — Interaction visible: Imagine data on product preference (A, B) across age groups (Young, Old) and gender (Male, Female). If the pattern of preference A vs B is similar for both genders within each age group, tiles will align similarly; if preference flips by gender in one age group but not the other, that interaction shows up as clearly mismatched tile proportions.
Example 3 — Rare combinations: In medical studies, a mosaic plot might show treatment types vs side-effect categories. If a particular side effect occurs almost exclusively with one treatment, the corresponding tile will be noticeably larger relative to others, signaling a potential association for further investigation.
How to read patterns and what they mean
Uniform vertical splits across horizontal bands: Suggests independence between the primary and secondary variables—the secondary variable’s distribution does not depend on the primary variable.
Different vertical splits across bands: Suggests dependence or association—the distribution of the second variable changes with the first.
Very narrow or missing tiles: Indicate rare or absent category combinations that can affect statistical power or require caution when making inferences.
Large contiguous areas for related categories: Can indicate dominant groups or stratification in the data that may merit targeted analysis or decisions.
Common enhancements and variations
Coloring by residuals: One common enhancement colors tiles by the difference between observed and expected counts under independence (standardized residuals). This highlights which combinations occur more or less often than expected, making deviations obvious.
Labeling: Adding counts, percentages, or category names inside or adjacent to tiles helps interpret small plots, though labels can clutter complex mosaics.
Ordering of categories: The order in which categories are placed (left-to-right or top-to-bottom) affects readability. Logical orders—such as ascending size, chronological sequence, or meaningful grouping—make patterns easier to spot.
Interactive plots: On websites or in analysis tools, interactive mosaic plots let users hover to see exact counts and percentages for tiles, useful when presenting many categories.
When to use a mosaic plot and when not to
Use mosaic plots when you need to explore relationships between two or more categorical variables visually and you want to see relative proportions across combinations. They are especially useful for spotting interactions, imbalances, and surprising counts without running statistical tests.
Avoid mosaic plots when categories are numerous and unlabeled tiles would overwhelm the viewer. If you have many low-frequency categories, an alternative like grouped bar charts, heatmaps, or tables with percentages may be clearer. Also, mosaic plots are less suitable for continuous variables unless those variables are discretized first.
Interpretation pitfalls and how to avoid them
Area perception: Humans are not equally good at judging areas and comparing rectangular tiles. Complement mosaics with labels or interactive numeric feedback for precise comparisons.
Misreading order effects: Different category orderings can make patterns look stronger or weaker. Use consistent, meaningful ordering and explain the chosen order to viewers.
Overplotting with many variables: While mosaic plots can handle more than two variables, too many subdivisions produce tiny tiles that are hard to read. Consider simplifying by combining rare categories or plotting conditional mosaics focused on key variables.
Assuming causation: Mosaic plots show associations in observed data; they do not establish cause-and-effect. Use them as an exploratory tool and follow up with appropriate analysis if causal inference is needed.
Practical applications
Survey analysis: Quickly show how responses vary by demographic groups, such as how service satisfaction levels differ by age and region.
Market research: Reveal which product features are preferred by different customer segments, or how purchase channels vary by product category.
Quality control: Identify combinations of categorical factors that coincide with defects or failures in manufacturing processes.
Public health and social science: Visualize how outcomes (e.g., vaccination status, disease categories) relate to demographic variables while highlighting rare or unexpected combinations.
Brief guidance for creating your own mosaic plot
Choose a primary variable whose marginal distribution you want to show on one axis. Compute the proportions or counts for each category.
For each category of the primary variable, compute the conditional distribution of the secondary variable. Use these proportions to split each band into tiles.
Decide on order and labeling: place categories in a meaningful order and add labels or hover text for clarity.
Consider coloring by residuals to highlight departures from independence, but explain the color scale so viewers can interpret it correctly.
Tools that produce mosaic plots
Statistical packages and programming languages commonly support mosaic plots: R (vcd and graphics packages), Python (statsmodels and some plotting libraries), and many statistical software packages like SAS, SPSS, and JMP. Spreadsheet tools and visualization platforms may offer similar treemap-like visuals, though true mosaic plots are most flexible in statistical environments.
When choosing a tool, look for options to control ordering, add labels, and color tiles by statistics (residuals or percentages), because those features improve readability and interpretability.
Example checklist for interpreting a mosaic plot
Identify the primary variable and read the marginal proportions from the main divisions.
Compare tile shapes across the primary categories to check for consistent or varying patterns.
Look for unusually large or small tiles and check whether color indicates observed vs expected differences.
Note any missing or tiny tiles that suggest sparse data for particular combinations.
Remember that associations shown are descriptive and call for follow-up analysis if needed.
Conclusion
Mosaic plots provide an efficient visual summary of relationships among categorical variables by mapping frequencies to tile areas. They reveal marginal distributions, conditional proportions, interactions, imbalances, and sparse combinations at a glance. Used thoughtfully—with clear ordering, labeling, and, where useful, coloring for residuals—they are a powerful exploratory tool for survey analysts, researchers, and anyone working with categorical data. Interpret mosaics as descriptive visual aids and follow up with formal analysis when you need to test or quantify associations.

