Skip to contents

A thin wrapper around the pbpstats API’s “get-scatter-plots” endpoint.

Usage

get_scatter_plots(
  league = "nba",
  season,
  season_type = "Regular Season",
  x_axis,
  y_axis,
  x_axis_type,
  y_axis_type
)

Arguments

league

Character. Which league to query; e.g., "nba" or "wnba"; defaults to "nba".

season

Character or integer. The season to query; e.g. "2024-25".

season_type

Character. One of:

  • "Regular Season"

  • "Playoffs"

  • "PlayIn"

  • "All"

; defaults to "Regular Season".

x_axis

Character. One of:

  • "PtsPer100Poss"

  • "SecondsPerPoss"

  • "FG3APct"

  • "Fg3Pct"

  • "AtRimFrequency"

  • "AtRimAccuracy"

  • "AtRimPctAssisted"

  • "ShortMidRangeFrequency"

  • "ShortMidRangeAccuracy"

  • "ShortMidRangePctAssisted"

  • "LongMidRangeFrequency"

  • "LongMidRangeAccuracy"

  • "LongMidRangePctAssisted"

  • "Corner3Frequency"

  • "Corner3Accuracy"

  • "Corner3PctAssisted"

  • "Arc3Frequency"

  • "Arc3Accuracy"

  • "Arc3PctAssisted"

  • "LiveBallTurnoverPct"

  • "EfgPct"

  • "DefFTReboundPct"

  • "OffFTReboundPct"

  • "DefTwoPtReboundPct"

  • "OffTwoPtReboundPct"

  • "DefThreePtReboundPct"

  • "OffThreePtReboundPct"

  • "DefFGReboundPct"

  • "OffFGReboundPct"

  • "OffAtRimReboundPct"

  • "OffShortMidRangeReboundPct"

  • "OffLongMidRangeReboundPct"

  • "OffArc3ReboundPct"

  • "OffCorner3ReboundPct"

  • "DefAtRimReboundPct"

  • "DefShortMidRangeReboundPct"

  • "DefLongMidRangeReboundPct"

  • "DefArc3ReboundPct"

  • "DefCorner3ReboundPct"

  • "SecondChancePtsPer100PossSecondChance"

  • "PenaltyPtsPer100PossPenalty"

  • "SecondChanceOffPossPer100Poss"

  • "FirstChancePtsPer100Poss"

  • "SecondChancePtsPer100Poss"

  • "PenaltyOffPossPer100Poss"

  • "Avg2ptShotDistance"

  • "Avg3ptShotDistance"

.

y_axis

Character. One of the same options as x_axis.

x_axis_type

Character. One of:

  • "Team"

  • "Opponent"

.

y_axis_type

Character. One of:

  • "Team"

  • "Opponent"

.

Value

A tibble of scatter‐plot data as returned by the API.

References

Darryl Blackport (2020). PBPStats API, MIT License. https://api.pbpstats.com/docs