0

I would like to create a map with the cities in Spain. I gave that code which I got from a programming book.

 tm_shape(es) +
  tm_borders("white", lwd = 1)  +
  tm_fill("migrationratio",style = "cont", title = "migration ratio") +
 tm_layout(legend.position = c(0.82,0.65),
            title= "Autonomous Communites in Spain by Migration ratio", 
            title.position = c('centre', 'top'))  
  tm_shape(escities_spdf) + tm_symbols(size = 0.15, col = "black") +
    tm_markers(text = "city")

The problem is that with that code, the city names are below the point for the city, but I would like to have the city name in the right site exact next to the point. How can I do that?

The code works well. the problem is just that the city name is below the point.

2
  • Have you looked at the help page for tm_markers, specifically the options related to justification?
    – Spacedman
    Commented Aug 10, 2022 at 18:57
  • yes, I did, but went the wrong way.
    – user210087
    Commented Aug 10, 2022 at 18:58

1 Answer 1

0

Unfortunately, I do not have the original data to propose the program code.

But I think the solution is to use tm_text with the appropriate xmod and ymod parameter values instead tm_markers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.