Description Usage Arguments Details Examples
Adds a north symbol to maps created with ggplot or ggmap.
1 2 |
data |
the same |
location |
string indicating the symbol's location in the plot. Possible options: "topright" (default), "bottomright", "bottomleft" and "topleft". |
scale |
number between 0 and 1 to indicate the symbol size as a proportion of the map size (bounding box). |
symbol |
number between 1 and 18 to choose a symbol (see |
x.min |
if |
x.max |
if |
y.min |
if |
y.max |
if |
anchor |
named |
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 | ## Not run:
library(sf)
data(domestic_violence)
ggplot(domestic_violence, aes(fill = Scaled)) +
geom_sf() +
north(domestic_violence, location = "bottomright", symbol = 15) +
scale_fill_continuous(low = "#fff7ec", high = "#7F0000")
## End(Not run)
|
Loading required package: ggplot2
Loading required package: grid
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.