在Choroplethr中摆脱不必要的线(轴?)

时间:2017-12-04 17:29:57

标签: r choropleth choroplethr

每当我使用Choroplethr包进行一个等值时,就会出现这些不必要的线条。我相信它们是轴,但是state_choropleth功能不应该是打印轴。

示例:

df <- data.frame(region = c("alabama", "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", "delaware", "district of columbia", "florida", "georgia", "hawaii", "idaho", "illinois", "indiana", "iowa", "kansas", "kentucky", "louisiana", "maine", "maryland", "massachusetts", "michigan", "minnesota", "mississippi", "missouri", "montana", "nebraska", "nevada", "new hampshire", "new jersey", "new mexico", "new york", "north carolina", "north dakota", "ohio", "oklahoma", "oregon", "pennsylvania", "rhode island", "south carolina", "south dakota", "tennessee", "texas", "utah", "vermont", "virginia", "washington", "west virginia", "wisconsin", "wyoming"), value = runif(51))
state_choropleth(df)

这是结果: Map with extraneous lines

任何人都可以帮我摆脱这些吗?我在Choroplethr源代码中探讨过,但似乎无法确定这些是什么。

编辑:我正在运行Windows 10 Enterprise,R 3.4.2 64位,并安装了choroplethr 3.6.1和ggplot2 2.2.1。

1 个答案:

答案 0 :(得分:1)

加载ggplot library(ggplot2)并尝试state_choropleth(df) + theme(panel.border = element_blank())

这消除了美国大陆的边界。然而,阿拉斯加和夏威夷仍然有他们的边界。