【问题标题】:How do I change state or counties label sizes in R with the function usmap?如何使用函数 usmap 在 R 中更改州或县标签大小?
【发布时间】:2020-03-23 01:17:07
【问题描述】:

我正在尝试绘制带有标签的每个县的新墨西哥州地图,但标签大小总是比预期的大得多。 这是我目前使用的代码。

plot_usmap("counties", include=("NM"), labels=TRUE, label_color="red")

我的地图最终看起来像这样:

如何更改标签的大小以使其不重叠? 我试过 size= 但这只会改变寄宿生的大小。

感谢您的帮助。

【问题讨论】:

    标签: r usmap


    【解决方案1】:

    您可以使用以下解决方案设置标签字体大小:

    library(usmap)
    p <- plot_usmap("counties", include=("NM"), labels=TRUE, label_color="red")
    
    # Set label font size
    p$layers[[2]]$aes_params$size <- 5
    print(p)
    

    【讨论】:

      猜你喜欢
      • 2020-05-08
      • 2012-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-12
      • 2011-07-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多