Closed math-ch closed 6 years ago
library(ggsn); library(sf)
dsn <- system.file('extdata', package = 'ggsn')
map <- st_read(dsn, 'sp')
ggplot(map, aes(fill = nots)) +
geom_sf() +
scalebar(map, , dist = 5, dd2km = TRUE, model = 'WGS84',
box.color = "red", box.fill = "blue", border.size = .3)
Currently working with R 3.5 - I tried to add in the code:
box.color = "red", box.fill = "blue", border.size = .3
But i get the following error message:
"Error in scalebar(data = NULL, dist = 100, dd2km = TRUE, model = "WGS84", :
unused arguments (box.color = "red", box.fill = "blue", border.size = 0.3)"
Without the arguments "color" and "border", the following code works fine:
mapaFR <- raster::getData("GADM", country="France", level=2)
ggplot()+
geom_polygon(data = mapaFR, aes(x=long, y = lat, group = group), fill="transparent", colour = "black", size=0.2) +
#geom_sf() +
scalebar(data=NULL, dist = 100, dd2km = TRUE, model = 'WGS84',
x.min = -3.143751, x.max = -0.5, y.min = 42.5, y.max = 44,
st.size = 3, height=0.05, st.dist=0.1)
You must use ggsn v0.4.11
yes working with this version! thanks!
I'd like to change border size and colors of the scalebar. I thought it would be possible to add "color", "fill" and "border.size" arguments to the code, unfortunately it s not. Any pointers?