我需要将标题置于图例上方的中心。我尝试了很多
tm_layout
的标题X图例参数组合,但没有成功。
我正在使用tmap 3.3.4。
我的最后一个代码:
ce_map <- tm_shape(shp_setor) +
tm_fill(
"v0001"
, palette = "viridis"
, title = "População do Ceará"
, legend.is.portrait = F
, breaks = quebras
, labels = labels
) +
tm_layout(
legend.position = c("center","bottom")
, legend.stack = "horizontal"
, title.position = c("center","bottom")
, legend.just = "center"
, legend.width = 1
, legend.title.size = 1.6
, inner.margins = c(.14, .02, .02, .02)
, bg.color = cor
, frame = F
)
你有什么想法吗?
您的标题位置错误
ce_map <- tm_shape(shp_setor) +
tm_fill(
"v0001"
, palette = "viridis"
, title = "População do Ceará"
, title.position = c("center","bottom") # <-------
, legend.is.portrait = F
, breaks = quebras
, labels = labels
) +
tm_layout(
legend.position = c("center","bottom")
, legend.stack = "horizontal"
, legend.just = "center"
, legend.width = 1
, legend.title.size = 1.6
, inner.margins = c(.14, .02, .02, .02)
, bg.color = cor
, frame = F
)