請問怎麼把地圖中縣市名的位置做微調?

作者: zerone (yu)   2020-10-15 15:52:44
[問題類型]:
程式諮詢
[軟體熟悉度]:
入門
[問題敘述]:
向量地圖的來源是GADM database
但是我發現到tm_text只能一次調整全部的地名,不能調整單一的,因為地圖中嘉義縣市的
名稱太重疊
不太清楚還有什麼指令可以單獨修改地名的?
[程式範例]:
map123 <- qtm(map, fill = "asm_total", fill.title="ASM (%)", fill.palette="Green
s") + tm_layout(title = "Age-standardized mortality rate\nfor 0-29 year age grou
p in Taiwan", title.size = 1.0, title.position = c("left", "top")) + tm_text(tex
t = "en_NAME", size = 0.6, xmod = 0.2, ymod = -0.15)
https://i.imgur.com/JgOlQMd.png
[環境敘述]:
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950
[2] LC_CTYPE=Chinese (Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] dplyr_1.0.2 crayon_1.3.4 grid_4.0.2 R6_2.4.1 lifecyc
le_0.2.0
[6] gtable_0.3.0 magrittr_1.5 scales_1.1.1 ggplot2_3.3.2 pillar_
1.4.6
[11] rlang_0.4.7 rstudioapi_0.11 generics_0.0.2 vctrs_0.3.4 ellipsi
s_0.3.1
[16] tools_4.0.2 glue_1.4.2 purrr_0.3.4 munsell_0.5.0 tinytex
_0.25
[21] xfun_0.16 compiler_4.0.2 pkgconfig_2.0.3 colorspace_1.4-1 tidysel
ect_1.1.0
[26] tibble_3.0.3
[關鍵字]:
tmap
作者: locka (locka)   2020-10-16 09:26:00
想到的方法是去修改原資料中嘉義縣的座標,因為顯示名稱是打在每個polygon對應的座標位置

Links booklink

Contact Us: admin [ a t ] ucptt.com