如何用ggplot夹住geom_sf的几何对象?

问题描述 投票:0回答:1
geom_tiles()

几何对象剪辑几何对象(绘制s(经度,纬度)平滑的拟合值(绘制拟合的值) )?

geom_sf()
    

如果您想要真正的剪辑,您将无法使用
library(ggplot) ggplot() + geom_tile( data = gam, aes( x = longitude, y = latitude, fill = .fitted) ) + geom_sf( data = country, fill = NA, color = "black" ) )
r ggplot2 geom-sf
1个回答
0
投票

绘制
geom_tile层,然后使用the the line the sf countrline the the the the the the the tline用口罩在非国家区域上绘画,但我认为在SF中创建瓷砖网格是非常可取的并使用geom_tile
保留网格的国家部分。
st_difference


data使用了

您没有在您的问题中包含任何数据,因此我创建了一些具有相同名称和结构的数据。 enter image description herest_intersection


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.