gpt4 book ai didi

R tmap : How to adjust the legend frame line width

转载 作者:行者123 更新时间:2023-12-05 06:36:44 25 4
gpt4 key购买 nike

我正在尝试使用很酷的 tmap 包制作 map ,但我不知道如何调整图例框线宽。我检查了令人印象深刻的 tm_layout 参数列表,但我发现最接近的是 frame.lwd 但是,它指的是 map 的框架。我用 legend.frame.lwd 进行了猜测,但未定义。这是一个玩具示例:

library(tmap)
data(Europe)

tm_shape(Europe) +
tm_polygons("well_being", textNA="Non-European countries", title="Well-Being Index") +
tm_text("iso_a3", size="AREA", root=5) +
tm_layout(legend.position = c("RIGHT","TOP"),
legend.frame = TRUE,
frame.lwd = 5) # legend.frame.lwd does not exist

enter image description here

最佳答案

在较新版本的tmap 中,参数legend.frame.lwd 包含在this commit 中。 .下面是一个示例,使用 tmap 2.2 版:

library(tmap)
data("World")

tm_shape(World) +
tm_polygons("HPI") +
tm_layout(legend.frame = TRUE,
frame.lwd = 5,
legend.frame.lwd = 5)

enter image description here

关于R tmap : How to adjust the legend frame line width,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48887634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com