1

I'm trying to build a map with "tm_lines" -element without a legend title. There doesn't seem to be an option for the removing the title of the legend. An example with World and Rivers datasets:

tm_shape(World) +
tm_fill() +
tm_shape(rivers) +
tm_lines(col="black", lwd="scalerank", scale=2, title="")

This produces a map with a legend with a title of the variable name "scalerank". Is it possible to produce the same map without the variable name title ("scalerank" in this case) in the legend? With other tm-functions like "tm_dots()" it is possible to alter the legend title with just "title=", which doesn't seem to exist for "tm_lines" (not for tm_symbols either).

brabont
  • 23
  • 4

1 Answers1

1

You can use the title.lwd argument of tm_lines:

library(tmap)
data(World, metro, rivers)

tm_shape(World) +
tm_fill() +
tm_shape(rivers) +
tm_lines(col="black", lwd="scalerank", scale=2, title.lwd="") 

enter image description here

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58