For the following vignette, you’ll need the
gganimate packages loaded into
If this is your first experience with plotting tracking data, please
check out the plotting-tracking-data vignette.
Otherwise, let’s see how to make GIFs with
For this example, we’ll use a play from Week 15 of the 2018 NFL season between the Chicago Bears and Green Bay Packers. Data made available for the Big Data Bowl 2021 Kaggle competition.
To keep things easy, let’s specify the colors for each team’s dots on the resulting GIF. We’ll make the Bears orange and the Packers yellow. The football will also need a dot to be seen; let’s make it brown.
First, let’s draw an NFL field via
We’ll adjust the origin to be in the lower left corner of the field, as
per the notes on the coordinate system on the Kaggle page describing the
Looks good! Now, let’s animate using