north2: North symbol 2

Description Usage Arguments Details Examples

View source: R/north2.R

Description

Alternative implementation to add a north symbol to maps created with ggplot or map.

Usage

1
north2(ggp, x = 0.65, y = 0.9, scale = 0.1, symbol = 1)

Arguments

ggp

ggplot2 object.

x

number between 0 and 1 to indicate the x axis position of the symbol's bottom left corner. 0 is the left side and 1 the right side.

y

number between 0 and 1 to indicate the y axis position of the symbol's bottom left corner. 0 is the bottom and 1 the top.

scale

number between 0 and 1 to indicate the symbol size as a proportion of the plot area (not the map size).

symbol

number between 1 and 18 to choose a symbol (see northSymbols).

Details

North symbols are included in the plot with the annotation_custom function, which do not works when used together with an empty call to ggplot (see last example). When it is convenient to use an empty call to ggplot, use north2 instead.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(sf)
data(domestic_violence)
map <- ggplot(domestic_violence, aes(fill = Scaled)) +
    geom_sf() +
    scale_fill_continuous(low = "#fff7ec", high = "#7F0000") +
    blank()
north2(map, .5, .5, symbol = 10)

## End(Not run)

ggsn documentation built on May 1, 2019, 8:21 p.m.