Sam*_*Sam 10 r geospatial ggplot2
我尝试过以下操作:
ggplot(geography) + geom_sf(aes(fill=rate, color = NULL))
Run Code Online (Sandbox Code Playgroud)
但那并没有摆脱边界线.
Pet*_*ter 14
如果没有可重复的示例,很难确切地知道您在寻找什么.但是,我会猜测你正在寻找一种方法来抑制标记不同多边形(区域)之间边界的线条,例如,抑制在世界地图上显示国家边界的线条.如果是这样,那么这是一个解决方案.
lwd = 0在geom_sf通话中使用.示例(您可能需要下载开发版本ggplot2)
# devtools::install_github("tidyverse/ggplot2")
library(ggplot2)
library(maps)
library(maptools)
library(rgeos)
library(sf)
world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE))
with_boundary <-
ggplot() +
geom_sf(data = world1, mapping = aes(fill = ID)) +
theme(legend.position = "none") +
ggtitle("With Country Boundaries")
without_boundary <-
ggplot() +
geom_sf(data = world1, mapping = aes(fill = ID), lwd = 0) +
theme(legend.position = "none") +
ggtitle("Without Country Boundaries")
Run Code Online (Sandbox Code Playgroud)