pitch_us: Plot a transparent half pitch for an understat shotmap.

Description Usage Arguments Value Examples

View source: R/pitch_us.R

Description

Plot a transparent half pitch for an understat shotmap.

Usage

1
pitch_us(filler = "#2f4f4f")

Arguments

filler

the colour you want your pitch lines to be. there is no background colour option, please use plot.background and panel.background. this is so the pitch can be plotted over heatmaps.

Value

a ggplot annotation half pitch.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(understatr)
library(ggplot2)

data <- get_player_shots(629)

ggplot(data = data, aes(x = X, y = Y, size = xG,
                        colour = result,
                        shape = shotType, fill = result),
       alpha = 0.7) +
  pitch_us() +
  geom_point()

robbiestill/robbiesoccer documentation built on Jan. 23, 2021, 8:47 p.m.