add_northarrow: Add north arrow to frames

Description Usage Arguments Value Author(s) See Also Examples

View source: R/add_northarrow.R

Description

This function adds a north arrow to the animation frames created with frames_spatial.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
add_northarrow(
  frames,
  height = 0.05,
  position = "bottomright",
  x = NULL,
  y = NULL,
  colour = "black",
  size = 1,
  label_text = "N",
  label_margin = 0.4,
  label_size = 5,
  verbose = TRUE
)

Arguments

frames

list of ggplot2 objects, crated with frames_spatial.

height

numeric, height of the north arrow in a range from 0 to 1 as the proportion of the overall height of the frame map.

position

character, position of the north arrow on the map. Either "bottomleft", "upperleft", "upperright", "bottomright". Ignored, if x and y are set.

x

numeric, position of the bottom left corner of the north arrow on the x axis. If not set, position is used to calculate the position of the north arrow.

y

numeric, position of the bottom left corner of the north arrow on the y axis. If not set, position is used to calculate the position of the north arrow.

colour

character, colour.

size

numeric, arrow size.

label_text

character, text below the north arrow.

label_margin

numeric, margin between label and north arrow as a proportion of the size of the north arrow.

label_size

numeric, label font size.

verbose

logical, if TRUE, messages and progress information are displayed on the console (default).

Value

List of frames.

Author(s)

Jakob Schwalb-Willmann

See Also

frames_spatial frames_graph animate_frames

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(moveVis)
library(move)

data("move_data", "basemap_data")
m <- align_move(move_data, res = 4, unit = "mins")

# create spatial frames using a custom NDVI base layer
r_list <- basemap_data[[1]]
r_times <- basemap_data[[2]]


frames <- frames_spatial(m, r_list = r_list, r_times = r_times, r_type = "gradient",
                         fade_raster = TRUE)

# add a north arrow to frames:
frames.a <- add_northarrow(frames)
frames.a[[100]]

# or in white at another position
frames.b <- add_northarrow(frames, colour = "white", position = "bottomleft")
frames.b[[100]]

moveVis documentation built on March 31, 2020, 5:08 p.m.