标签: r
如何在SF图中替换正方形格式图例! 可复制的代码:
data(meuse, package = "sp") meuse_sf = st_as_sf(meuse, coords = c("x", "y"), crs = 28992, agr = "constant") ggplot() + geom_sf(data = meuse_sf, aes(colour = landuse))
答案 0 :(得分:0)
您必须使用show.legend参数对其进行更改。
show.legend
library(tidyverse) library(sf) data(meuse, package = "sp") meuse_sf = st_as_sf(meuse, coords = c("x", "y"), crs = 28992, agr = "constant") ggplot() + geom_sf(data = meuse_sf, aes(colour = landuse), show.legend = "point")