Field note · January 20, 2025

The category that eats the chart

10 values with 15.2% concentrated in one of them, and what that does to every chart downstream.

1 min read ·Visualization ·visualization practice

city on data-job-postings has 10 values, and one of them is 15.2% of the data.

  • San Francisco — 532 rows, 15.2%
  • New York — 495 rows, 14.1%
  • London — 436 rows, 12.5%
  • Bengaluru — 417 rows, 11.9%
  • Berlin — 333 rows, 9.5%

The top three take 41.8% between them. The remaining 7 share 58.2%, which is the part that gets rendered as an unreadable stack of slivers if you plot all of them.

sql
select city,
       count(*)                                      as rows,
       round(100.0 * count(*) / sum(count(*)) over (), 1) as pct,
       round(avg(salary_min_usd)::numeric, 2)             as avg_salary_min_usd
from data_job_postings
group by 1
order by rows desc;

The second column is the one that matters. Share of rows tells you what is common; avg_salary_min_usd tells you whether the common thing is the important thing. They disagree more often than not, and a chart that shows only the first is answering the easier question.

Decide what happens to the tail before you plot it. "Other" as an explicit bucket is honest; twelve slivers is not, and neither is silently taking the top eight.