skip to content

In a data-visualization categorical palette, why do teams cap the number of colors, and what do you do when a chart has more categories?

level: middleimportance: should knowfreq 38%

answer

  1. every color against every other
  2. legend lookup and memory
  3. a perceptual limit, not a standard
  4. highlight a few, gray the rest
  5. small multiples and an Other group

basics

~20 s

Beyond roughly six to ten hues, readers struggle to tell colors apart and match them to a legend, especially with color-vision deficiencies or small marks. Past the cap, group minor categories, highlight a few against gray, or split into small multiples.

solid answer

~50 s

A categorical palette works only while every hue is clearly distinct from every other and the reader can hold the color-to-category mapping in memory. In common practice that runs out somewhere around six to ten colors — a perceptual limit, not a number any standard sets — and sooner for color-blind readers, thin lines or small points. When a course-registration chart has 23 departments, adding hues is not the fix. Instead: group the long tail into an **Other** category; **highlight** the two or three departments the viewer cares about and draw the rest in neutral gray; split the chart into **small multiples**, one panel per department; label series directly; or ask whether a sorted bar chart or a table answers the question better. Do not cycle the palette, because repeated colors make two categories look identical.

go deeper

for a junior

Remember that categorical palettes are small by design, and that grouping, graying out and small multiples are the usual ways past the cap.

for a middle

Explain why distinctness gets harder with each added color, why lightness stays even, and why the cap is a perceptual convention rather than a rule.

for a senior

Show you can redesign an overloaded chart, choosing between highlight-and-gray, small multiples and a table by what the viewer is trying to answer.

for a principal

Weigh publishing a small fixed categorical set, which pushes teams toward better charts, against a larger set that satisfies more requests but invites unreadable ones.

## What a categorical palette has to guarantee A **categorical palette** assigns a distinct color to each unordered group in a chart — each faculty, each department, each delivery mode. It only does its job if two things hold at once: every color is **clearly distinguishable from every other** at the size it is drawn, and the reader can **map each color back to its category** without constant rereading of the legend. Both guarantees weaken quickly as the number of categories grows. ## Why the limit exists - **Pairs grow faster than colors.** Every color must be distinct from every other, so the pairs to separate grow roughly with the square of the count: 6 colors make 15 pairs, 12 colors make 66. - **Even weight narrows the space.** Categorical hues are kept at similar lightness and saturation so none looks more important, which leaves hue as the main difference — and there are only so many hues people name and separate easily. - **Color-vision deficiencies collapse pairs.** Colors that differ only in the red-green direction merge for the most common deficiencies, removing options from an already small set. - **Mark size matters.** A large bar shows color reliably; a thin line or a small point makes neighbouring hues look alike. - **Memory is limited.** A legend with many entries forces back-and-forth lookup, and readers start mismatching series. ## Where the cap sits The often-quoted range of about six to ten colors is **common practice driven by perception**, not a rule any standard mandates; WCAG sets no maximum number of chart colors. Teams pick a cap for their own marks and audience. | Situation | Practical effect on the cap | |---|---| | Large areas such as bars and map regions | Somewhat more colors stay distinguishable | | Thin lines or small scatter points | Fewer colors stay distinguishable | | Readers with color-vision deficiencies | Fewer safe pairs, so a smaller cap | | Series backed by direct labels | Color matters less for identity, so crowding hurts less | ## Strategies past the cap | Strategy | When it fits | Cost | |---|---|---| | **Group into Other** | A long tail of small categories nobody compares | Hides detail in the tail | | **Highlight and gray** | The viewer cares about a few named categories | The grayed series cannot be told apart | | **Small multiples** | Each series matters and shape comparison is enough | Space; precise cross-panel comparison is harder | | **Direct labels** | Few enough series that labels do not collide | Space and label placement effort | | **Different chart or a table** | Exact values or ranking are the real question | Loses the visual overview | What does **not** work: generating more evenly spaced hues (they become look-alikes), cycling the palette so later categories reuse earlier colors (two departments become visually identical), or switching to a sequential ramp (it implies an order the categories do not have). ## Keep assignments stable Once colors are scarce, how they are assigned matters as much as how many exist. - Map each category to a color by a **fixed rule**, not by its rank in the current chart; rank changes between views, and so would the color. - Reuse the same mapping on every chart in a dashboard, so a department is learned once. - Reserve a **neutral gray** outside the categorical set for Other, placed last in legend and stacking order, so it reads as background. ## Worked example: 23 departments A registrar's dashboard shows enrollment for 23 departments in one stacked bar per term, colored with 23 generated hues. Nobody can find their department. A redesign: 1. Ask what the viewer is deciding. Department heads want their own department against the university total. 2. Draw the viewer's department in the first categorical color, the next two largest in the second and third, and everything else in neutral gray grouped as Other. 3. Label the highlighted series directly, so the legend is optional. 4. Offer small multiples — one panel per department on shared axes — for the rare viewer who needs every department. 5. Provide a sortable table for exact numbers. The palette itself did not grow; the chart was redesigned so color only has to separate a handful of things. The same approach applies whether the chart is rendered on the web, in a native mobile app or in an exported report.

  • Why does difficulty grow so quickly as categories are added?
    Every color has to stay distinct from every other, so the pairs to separate grow roughly with the square of the count: 6 colors make 15 pairs, 12 make 66. Each new hue must also match the others' lightness to avoid looking emphasized, which shrinks the usable space further.
  • When are small multiples better than one chart with many colors?
    When each series matters on its own and viewers compare shapes and trends rather than exact crossings. One panel per department on shared axes needs no color to identify the series, because the panel title does it. The cost is space and harder precise comparison between panels.
  • What color should an Other group take?
    A neutral gray that sits outside the categorical set, so it reads as background rather than as one more category. Place it last in the legend and in the stacking order so it does not compete with the named series.

saying these in an interview costs you the question

  • Generating more evenly spaced hues solves any number of categories.
  • Cycling the palette is fine because the legend shows which series is which.
  • WCAG sets a maximum number of colors allowed in a chart.
  • Colors should be assigned by rank so the biggest group always gets the first color.
  • A sequential ramp is a good way to fit many unordered categories into one chart.