R 叶绿体:控制多边形填充
我上传了一个shapefile 然而,我相信有一个更优雅的解决方案。使用R 叶绿体:控制多边形填充,r,ggplot2,R,Ggplot2,我上传了一个shapefile 然而,我相信有一个更优雅的解决方案。使用id作为建议的分组变量会导致多边形扭曲 有人有其他想法吗?多边形重叠,您可以设置alpha ggplot(plot.df, aes(x = long, y = lat)) + geom_polygon(aes(fill = factor(value), group = group), alpha = .4)+ coord_fixed() + scale_fill_manual(values = c("red",
id
作为建议的分组变量会导致多边形扭曲
有人有其他想法吗?多边形重叠,您可以设置
alpha
ggplot(plot.df, aes(x = long, y = lat)) +
geom_polygon(aes(fill = factor(value), group = group), alpha = .4)+
coord_fixed() +
scale_fill_manual(values = c("red", "green", "blue", "orange"), breaks = c("1", "2", "3", "4")) +
theme(legend.position = 'none')
ggplot(plot.df, aes(x=long, y=lat))+
geom_polygon(aes(fill=factor(value), group=group))+
geom_polygon(data=subset(plot.df, id==0), aes(fill=factor(value), group=group))+
coord_fixed()+
scale_fill_manual(values = c("red", "green", "blue", "orange"),
breaks = c("1", "2", "3", "4"))
ggplot(plot.df, aes(x = long, y = lat)) +
geom_polygon(aes(fill = factor(value), group = group), alpha = .4)+
coord_fixed() +
scale_fill_manual(values = c("red", "green", "blue", "orange"), breaks = c("1", "2", "3", "4")) +
theme(legend.position = 'none')