5 Create GIF animation

5.1 Create static map

Let’s use the previous script map from NL with zoom on Newfoundland island. Before running this, you need to have created map_nl, see Import background basemap Import background basemap

Add the data on the map

  • geom_point function to add the data with x (longitude) and y (latitude) axis. The projection of the data needs to be in the same projection than the background map.
  • coord_sf allow here to set manually the zoom on specific area based on x and y axis limits.

5.4 Add scale bar and north arrow

A map always needs scale and north arrow. Here we separately set the function to add the two layers to the map previously created before (plot1)

Create the GIF

  • The function animate from the package gganimate is the function use to create the GIF output. There is different options to set. Here we use only the options: nframes and duration to define the number of frames per second (one frame per year (10 years of survey) for 15 seconds of animation).