Custom visualization
Strike zone
Plots every pitch a pitcher threw where it crossed the plate, colored by pitch type, with the strike zone drawn from the batter's own zone limits. The example is Zack Wheeler's season.
Shared by Metabase team
Screenshots
Distilled prompt
Follow our guide to build your own version: Get started (opens in a new tab)
Build a Metabase custom visualization (custom viz SDK v2) called "strike-zone" that plots baseball pitches as seen from the catcher's view.
Input: one row per pitch from a pitch-by-pitch table (Statcast style). The example filters to a single pitcher. Useful columns: plate_x_ft (horizontal location at the plate, feet from center), plate_z_ft (height in feet), sz_top_ft and sz_bot_ft (the batter's strike zone limits), and pitch_name for the type. Other columns like velocity, spin, result and count go in tooltips.
Settings:
- Column pickers for X, Z, zone top, zone bottom and color-by. Default to the column names above when they exist.
- Mode: "pitches" (a scatter of individual pitches) or "density" (a binned heatmap of locations).
Rendering:
- Draw an SVG with equal scale on both axes so the plate isn't distorted, centered on home plate.
- Draw the strike zone as a rectangle 17 inches wide (±0.708 ft), with its top and bottom set to the median of the zone top and bottom columns.
- Draw each pitch as a semi-transparent circle with a thin white outline, colored by pitch type from the Metabase palette.
- Show a legend across the top with each pitch type and its count, sorted by count. Clicking a legend item toggles that type on and off.
- Show a small warning icon if any rows were dropped for missing coordinates.
Tooltip: the pitch type, velocity in mph, spin in rpm, count, result, and the game date and opponent.
Clicking a pitch drills through to that row. Fit the card at any size, and follow Metabase's light and dark themes.