--- name: sports-visualization description: > Create honest sports-analysis figures from user-owned data, including distributions, rates, rating trajectories, calibration plots, and walk-forward metric comparisons. Use for exploration and communication. license: MIT metadata: version: "0.12.0" --- # Sports Visualization ## Outcome Create the smallest reproducible figure that answers a defined question without exaggerating the evidence. Every important figure states its period, sample size, metric definition, grain, and relevant baseline. Add uncertainty when the claim depends on noisy differences. This skill constructs figures. Use `anti-slop-analytics` for an independent keep/fix/kill review and `results-reporting` for the surrounding narrative. ## When to use this skill Use for exploratory distributions, coverage plots, model diagnostics, calibration, ratings and form trajectories, team or player comparisons, walk-forward results, and publication figures. Do not start with chart type: start with the question and the unit represented by each mark. ## Required inputs - question and intended audience; - user-owned data or metrics artifact; - sport, competition, grain, natural key, and period; - relevant denominator, filters, and missing-data rules; - metric definition and direction; - comparison baseline and uncertainty artifact when applicable; - desired output path and reproduction context. If the source is a screenshot or rounded report table, do not reconstruct precise data unless explicitly labeled approximate. Prefer the underlying table. ## Workflow 1. State the single claim or diagnostic question. 2. Validate input grain, keys, columns, types, and duplicated events. 3. Define what one mark, line, bar, or interval represents. 4. Choose the smallest chart that makes the comparison direct. 5. Add sport, population, period, denominator, units, and baseline. 6. Check axes, transforms, aggregation, bins, smoothing, missingness, and ordering. 7. Add uncertainty or fold spread if the claim compares noisy quantities. 8. Export the image and preserve the plotting command or code. 9. Write a one-sentence factual interpretation and one limitation. 10. Run an anti-slop pass before using the figure in a public claim. ## Plot selection catalog | Question | Preferred figure | Essential checks | |---|---|---| | What periods are covered? | season/week coverage timeline | missing periods and schedule type | | What is the outcome distribution? | histogram, ECDF, or quantile plot | bin sensitivity, units, ties/outliers | | How does a rate change over time? | line or dot plot with denominators | varying `n`, rule eras, full scale | | Is there home advantage? | home-row rate by season with interval | correct grain; do not use full doubled panel | | How does form evolve? | as-of line or small multiples | shifted window, gaps, unequal schedules | | Is a probability reliable? | reliability curve plus counts | bins, reference diagonal, sample size | | Where does a margin model miss? | residual versus prediction/context | heteroskedasticity and outliers | | How does rating evolve? | as-of trajectory with selected labels | update timing, regression, inactive teams | | Does a candidate beat a baseline? | paired fold dots/bars or compact table | same events/folds, metric direction | | How stable is a ranking? | ordered dots with intervals/rank distribution | opportunity and schedule strength | Read [`references/plot_catalog.md`](references/plot_catalog.md) when routing a question to a chart. Read [`references/honest_labels.md`](references/honest_labels.md) before finalizing titles, captions, annotations, and uncertainty language. ## Encoding defaults | Comparison | Prefer | Avoid | |---|---|---| | Rates over seasons | line/dots or bars with `n` | cropped “dramatic” axis | | Candidate versus baseline | paired dots, common-scale bars, or table | separate charts with different scales | | Distribution | histogram/ECDF plus median or quantiles | mean-only summary | | Probabilities | reliability curve and count panel | pie chart or “lock” language | | Rankings | ordered dots or small multiples | rainbow spaghetti | | Many teams over time | selected labeled series or faceted small multiples | unreadable 30-line legend | | Two time series | aligned panels or indexed comparison | dual axes tuned for correlation | | Effects | point estimate and interval | stars without magnitude | For rates, the axis must show changes without manufacturing drama. Zero is not mandatory for every line plot, but any restricted range must be justified and clearly labeled. Bar length encodes magnitude and normally needs a meaningful zero. ## Sports-specific caveats - Team-game panels often contain complementary home and away rows. A home-win figure should filter `is_home == 1`; state unique-game `n`. - Rolling features and ratings must be plotted as of the prediction timestamp, not after the event update. - Unequal games played, minutes, plate appearances, or attempts can make player and team rates incomparable. Show opportunity thresholds or uncertainty. - Schedule strength, postseason selection, neutral venues, overtime, ties, and rule changes can alter apparent trends. - Season facets may have different lengths and missing weeks. Do not connect discontinuous observations as though spacing were equal. - Calibration bins need event counts. A smooth-looking curve from small bins is not strong evidence. - Fold-level model charts must retain losing folds and compare the same held-out rows. ## Honest title and caption template ```text Title: by , Subtitle/caption: n=; grain=; ; baseline=; uncertainty=; exclusions=. Source: ; reproduce: