Field note · January 8, 2025

flight-delays.origin: 14 values, 22.6% in the top three

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

1 min read ·Visualization ·visualization practice

Distribution of origin on flight-delays, because every chart built on it inherits this shape.

  • DFW — 612 rows, 7.6%
  • ATL — 600 rows, 7.5%
  • LAX — 598 rows, 7.5%
  • SEA — 590 rows, 7.4%
  • IAH — 577 rows, 7.2%

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

sql
select origin,
       count(*)                                      as rows,
       round(100.0 * count(*) / sum(count(*)) over (), 1) as pct,
       round(avg(dep_delay_min)::numeric, 2)             as avg_dep_delay_min
from flight_delays
group by 1
order by rows desc;

The second column is the one that matters. Share of rows tells you what is common; avg_dep_delay_min 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.