Created
April 25, 2019 14:47
-
-
Save 16EAGLE/8237db3ea0f6e773e8d47bf4ebb201b6 to your computer and use it in GitHub Desktop.
Short moveVis example on how to hold the last frame of an animation for a defined time and make it look good by using path_fade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use moveVis >= 0.10.2 for this example (does not work with CRAN version 0.10.1) | |
# remotes::install_github("16eagle/moveVis") | |
library(moveVis) | |
library(move) | |
data("move_data") | |
# align movement to unique times and regular resolution | |
m <- align_move(m = move_data, digit = 0, res = 4, unit = "mins") | |
# create frames | |
# using path_fade = T to let paths disappear towards the last frame and thus only showing traces on the last frame | |
frames <- frames_spatial(m, map_service = "mapbox", map_type = "satellite", map_token = "YOUR_MAPBOX_TOKEN", | |
equidistant = F, path_colours = c("red", "green", "blue"), path_fade = T, trace_show = T) %>% | |
add_labels(x = "Longitude", y = "Latitude") %>% | |
add_northarrow(colour = "white", position = "bottomright") %>% | |
add_scalebar(colour = "white", position = "bottomleft") %>% | |
add_timestamps(type = "label") %>% | |
add_progress(size = 2) | |
# animate frames with an end_pause of 2 seconds (holding last frame for 2 seconds) | |
animate_frames(frames, out_file = "moveVis.gif", | |
width = 850, height = 550, end_pause = 2, overwrite = T) |
Author
16EAGLE
commented
Apr 25, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment