Skip to contents

This function allows to make match timelines using data collected event-by-event.

Usage

plot_timeline(
  data,
  match_year,
  team_home,
  team_away,
  color_home,
  color_away,
  theme = ""
)

Arguments

data

Data, for now only compatible with understat data.

match_year

the year the match was played.

team_home

home team according to data.

team_away

away team according to data.

color_home

line colour for the home team.

color_away

line colour for the away team.

theme

Choose from 4 ggplot2 themes -> dark, almond, rose, white.

Value

ggplot2 object of a xG timeline plot

Examples

if (FALSE) {
plot <- plot_timeline(data = data, match_year = 2021, 
                      team_home = "Manchester United", team_away = "Liverpool",
                      color_home = "#e31a1c", color_away = "#980043", theme = "dark")
plot
}