Description Usage Arguments Details Examples
Alternative implementation to add a north symbol to maps created with ggplot or map.
1 |
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 |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.