# Chernoff faces

> Use Chernoff faces to show three or four measures per item as features of a face, for a quick, human read of which items are alike and which stand out; fun, not exact.

- Data type: Several measures per item (`relationships`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`relationships`)
- Example: **Costa Rica smiles almost as wide as Finland on half the income** (Happiness (0–10 life evaluation), life expectancy and GDP per person (PPP) for 12 countries)
- How to read it: Each face is one country: a wider smile is a higher happiness score, bigger eyes a longer life expectancy and a wider face a higher GDP per person (log scale).
- Interactive: sort
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- 3 or 4 measures per item for 6 to 20 items
- spotting similar and odd items matters more than exact values
- a playful hook before a proper chart

## Avoid it when
- readers need any value exactly
- some features are seen as more important than others (a smile outweighs a face width)
- the topic is too serious for cartoon faces
- more than three measures (only three become features)

## Fields (data.json)
- `country` (place): the item, one face each; its first three number columns (or hints.roles) are the smile, eyes and face width
- `happiness` (number, unit "points (0–10)", format decimal): average life evaluation, 0 to 10 (Cantril ladder)
- `happinessYear` (year): optional: year of the happiness score (hints.yearOf pairs a measure with its year column)
- `lifeExpectancy` (number, unit "years", format decimal): life expectancy at birth, years
- `lifeYear` (year): optional: year of the life expectancy
- `gdpPerCapita` (number, unit "USD", format currency): GDP per person, international $ at 2021 prices (PPP)
- `gdpYear` (year): optional: year of GDP per person

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- sort the faces by happiness, life expectancy or income
- hover or tap a face for its three numbers
- Motion: The faces start straight-faced and their smiles or frowns arrive one by one; sorting slides the faces to their new places.
- Sound: A whoosh when re-sorting; a pop on hover. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "chernoff-faces",
  "title": "Costa Rica smiles almost as wide as Finland on half the income",
  "subtitle": "Happiness (0–10 life evaluation), life expectancy and GDP per person (PPP) for 12 countries",
  "data": "/charts/chernoff-faces.data.json"
}
```

## Source
Self-reported life satisfaction; Life expectancy; GDP per capita, PPP, Our World in Data (World Happiness Report; UN World Population Prospects; World Bank) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/happiness-cantril-ladder

Note: Happiness and GDP per person are the latest year available (2025); life expectancy is 2023. Brows follow the smile; noses carry no data.

Inspired by: [The use of faces to represent points in k-dimensional space graphically](https://en.wikipedia.org/wiki/Chernoff_face), Herman Chernoff (1973) (linked, not copied).

Live: /charts/chernoff-faces · Manifest: /charts/chernoff-faces.json · Tags: Chernoff faces, glyphs, multivariate, happiness, wellbeing, economics, health
