tmap icon indicating copy to clipboard operation
tmap copied to clipboard

Use tm_title across facets

Open mtennekes opened this issue 1 year ago • 2 comments
trafficstars

Seems not possible yet...

Use case: series of maps (for animation) when panel.labels are not desirable (#937)

mtennekes avatar Sep 25 '24 18:09 mtennekes

And how to get rid of this title now? I did a package update and now I have the name of the variable used in tm_polygons(fill="%sig2",fill.scale = tm_scale_intervals(...)) on top of the map. It looks like from facet, but in this script there is no facet. #937

image

And previous: image

And here using some real data (same shapefile as in #938):

tm_shape(shp_in_sf) + tm_grid(n.y=2,lines = TRUE, crs = 4326, labels.cardinal = FALSE,labels.size = 0.5,labels.pos = c("left", "bottom"),lwd=0.75,col="grey75")+ tm_polygons(fill = "ID_label",col = "grey30",lwd=0.25, fill.scale = tm_scale_intervals(values = c("red","blue","black"), breaks = c(1,2,3,4), label.na = "NA"), fill.legend = tm_legend(reverse=TRUE,title="",bg.color = 'white')) image

tmap 3.99.9002

Rapsodia86 avatar Sep 25 '24 21:09 Rapsodia86

With the latest commit, I get this, so without panel:

image

mtennekes avatar Sep 26 '24 07:09 mtennekes

Already fixed earlier:

tm_shape(World) +
  tm_polygons(c("HPI", "well_being")) + 
  tm_title(c("Happy Planet Index", "Well Being"), position = tm_pos_in("right", "top"), bg.color = "gold", frame = T) + 
  tm_layout(panel.show = FALSE)

image

mtennekes avatar Nov 13 '24 10:11 mtennekes