This function allows for data, that has to be scraped from Understat, to be used for plotting shots.
Usage
plot_shot(
data,
type = "",
bins = 30,
highlight_goals = "",
average_location = "",
theme = ""
)
Arguments
- data
Dataframe that houses shot data. Dataframe must contain atleast the following columns: X,Y,xG,result,name
- type
Type of showcasing the shotmap: hexbin, density, point (default)
- bins
Bin size for creating bins. Use this when using hexbin shotmap. The same argument name as the underlying call to
geom_hex()
. Default = 30.- highlight_goals
to choose to display only the goals in a different color.
- average_location
for removing lines denoting average location of shots if need be.
- theme
Theme preferences for display: dark (default), white, rose, almond