hockey_field: astrotuRf

Description Usage Arguments Examples

View source: R/hockey_field.R

Description

Creates a field hockey field, upon which data can be plotted (e.g. xy data of shots to create a shot chart)

Usage

1
2
3
4
5
6
7
8
9
hockey_field(
  background_color,
  turf_color,
  line_color,
  goal_color,
  line_width,
  p_spot_size,
  turf_opacity
)

Arguments

background_color

Color of the plot background

turf_color

Color of the astroturf

line_color

Color of the field lines (excluding the goals)

goal_color

Color of the goal post and crossbar lines

line_width

Width of all the field lines

p_spot_size

Size of the penalty spots

turf_opacity

Opacity of the turf

Examples

1
2
3
4
5
library(ggplot2)
library(ggforce)
mydata <- data.frame(x = c(26, 35, 27, 21, 20), y = c(89, 80, 78, 87, 82))

ggplot(data = mydata) + hockey_field("#ffffff", "#ffffff", "#A9A9A9", "#A9A9A9", .5, .75, 1) + geom_point(aes(x = x, y = y))

ChrisAFry/astrotuRf documentation built on March 21, 2021, 6:46 a.m.