Description Usage Arguments Examples
Creates a field hockey field, upon which data can be plotted (e.g. xy data of shots to create a shot chart)
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
)
|
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 |
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.