draw_pitch | R Documentation |
Creating a pitch plot using ggplot2 that is ready to plot actions on top. Numerous options allow customisation. Original code from FCrStats SBpitch tutorial at: https://github.com/FCrSTATS/SBpitch
draw_pitch(
pitch_length = pitch_length_init,
pitch_width = pitch_width_init,
pitch_units = pitch_units,
pitch_layout = "horizontal",
pitch_section = "full",
grass_colour = "#ffffff",
line_colour = "#A9A9A9",
background_colour = "#ffffff",
goal_colour = "#000000",
goaltype = "line",
middlethird = FALSE,
BasicFeatures = FALSE,
overlay = FALSE,
arcs = TRUE,
padding = 5
)
pitch_length |
Length of the pitch. Always the long side. Default 105 |
pitch_width |
Width of the pitch. Default 68 |
pitch_units |
Units of measure in "meters" or "yards". Default "meters" |
pitch_layout |
Plot the pitch vertical or horizontal. Default "horizontal" |
pitch_section |
Full or subsection of field. "full", "att_half", "att_eighteen". Default "full" |
grass_colour |
A string as a colour by word or #HEX code |
line_colour |
A string as a colour by word or #HEX code |
background_colour |
A string as a colour by word or #HEX code |
goal_colour |
A string as a colour by word or #HEX code |
goaltype |
String, either "line", "box" or "barcanumbers". Default "line" |
middlethird |
Boolean. Default FALSE |
BasicFeatures |
Boolean. Default FALSE |
overlay |
Draw lines on top of the field. "JdeP" "grid_30" or FALSE |
arcs |
Boolean. Default TRUE |
padding |
Numeric. Default = 5 |
A plot of a pitch
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.