library(tmap)
library(htmltools)
tmap_mode("view")
# Single line legend, \n has no effect
tm_shape(World) +
tm_polygons(
fill = "pop_est",
fill.legend = tm_legend(
title = "Long title for\npopulation estimate"
)
)
# Single line legend title showing HTML tags
tm_shape(World) +
tm_polygons(
fill = "pop_est",
fill.legend = tm_legend(
title = paste0(
"Long title for",
br("population estimate")
)
)
)
Any #RSpatial / #tmap folks know how to do linebreaks in legend titles in 'View' mode in {tmap} v4 and care to help a fella out? I'm probably missing something obvious but equivalent methods I used to use in v3 aren't working for me... (reprex in alt text)