I am creating a simple map using tmap and would like to adjust the border colours of the points in tm_dot()
library(tmap)
data(World, metro)
tm_shape(World) +
tm_polygons() +
tm_shape(metro) +
tm_dots(col = "red", size = "pop2020", border.col = "blue") +
tm_layout(title = "World Cities Map")
However the above code, whilst producing the desired output overall, does not include borders around the points. What's going on? All of the documentation, help guides etc suggest that this should work. Am I missing something? I have tried setting the border.lwd and border.alpha arguments to nonzeros but I get the same output. Am I missing something very obvious, or has tmap functionality changed.
The key is to use shape = 21
(default is shape = 19
for tm_dots
):
library(tmap)
data(World, metro)
tm_shape(World) +
tm_polygons() +
tm_shape(metro) +
tm_dots(col = "red", size = "pop2020", border.col = "blue", shape = 21) +
tm_layout(title = "World Cities Map")