Skip to main content

binShots

[
  {
    "x": 0,
    "y": 0,
    "attempts": 2,
    "makes": 1,
    "fgPct": 0.5,
    "meanDistance": 0.5,
    "zone": "restricted_area"
  },
  {
    "x": -45,
    "y": 255,
    "attempts": 1,
    "makes": 1,
    "fgPct": 1,
    "meanDistance": 26,
    "zone": "above_break_3"
  }
]
import { binShots } from "@sportsdataverse/sdvplot/shots";

const shots = [
{ x_legacy: -1, y_legacy: 7, shot_distance: 1, shot_value: 2, shot_result: "Made" },
{ x_legacy: 0, y_legacy: 0, shot_distance: 0, shot_value: 2, shot_result: "Missed" },
{ x_legacy: -44, y_legacy: 252, shot_distance: 26, shot_value: 3, shot_result: "Made" },
];
binShots(shots, 15);
binShots(shots, { shape: "square", side: 15 });

Tags: docstring · binShots. All sdvplot examples.