Field note · December 12, 2024

movie-ratings.genre: 8 values, 54.8% in the top three

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

1 min read ·Visualization ·visualization practice

Distribution of genre on movie-ratings, because every chart built on it inherits this shape.

  • romance — 1,950 rows, 21.7%
  • sci-fi — 1,653 rows, 18.4%
  • comedy — 1,330 rows, 14.8%
  • thriller — 1,258 rows, 14.0%
  • drama — 843 rows, 9.4%

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

sql
select genre,
       count(*)                                      as rows,
       round(100.0 * count(*) / sum(count(*)) over (), 1) as pct,
       round(avg(rating)::numeric, 2)             as avg_rating
from movie_ratings
group by 1
order by rows desc;

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