draw_halfcourt: Plot Half Court

Description Usage Value Examples

View source: R/graphics.R

Description

Plot the court markings for the NBA regulation basketball half court.

Usage

1
draw_halfcourt(xlim = c(-300, 300), ylim = c(-100, 500), add = FALSE, ...)

Value

Plot of half court

Examples

1
2
3
4
5
6
7
8
sc_data <- shots_cavs
# plot halfcout markings
draw_halfcourt()
# plot data
points(sc_data$LOC_X, sc_data$LOC_Y, cex = 0.5)
# highlight three-pointers
threes <- dplyr::filter(sc_data, SHOT_TYPE == "3PT Field Goal")
points(threes$LOC_X, threes$LOC_Y, cex = 0.5, col = "#FF6688")

imadmali/NBAapi documentation built on May 6, 2019, 2:31 p.m.