Skip to main content

Shot diet: 2,000 Nets attempts by zone, one square per 10 shots (Plot.waffleY)

0100200300400500600700↑ AttemptsRestricted areaPaint (non-RA)Mid-rangeLeft corner 3Right corner 3Above-the-break 3
import * as Plot from "@observablehq/plot";
import { BKN_SHOTS_2026 } from "@sportsdataverse/examples/data";
import { statsByZone } from "@sportsdataverse/sdvplot/shots";
import { BASKETBALL_ZONES, BASKETBALL_ZONE_LABELS } from "@sportsdataverse/sporty";

const byZone = statsByZone(BKN_SHOTS_2026);
const diet = BASKETBALL_ZONES.map((zone) => ({
zone: BASKETBALL_ZONE_LABELS[zone],
attempts: byZone[zone].attempts,
}));
Plot.plot({
width: 640,
height: 320,
x: { label: null, domain: diet.map((d) => d.zone) },
y: { label: "↑ Attempts" },
marks: [
Plot.waffleY(diet, { x: "zone", y: "attempts", unit: 10, channels: { Zone: "zone" }, tip: true }),
Plot.ruleY([0]),
],
});

Tags: plot · waffleY · statsByZone · nba. All sdvplot examples.