我有两个图表,一个是使用ggplot2
绘制的地图,就像这样:
w<-ggplot()+
geom_polygon(data=dep_shp.df, aes(x=long,y=lat,group=group,fill=classJenks))+
# scale_fill_gradient(limits=c(40, 100))+
labs(title ="Classification de la proportion de producteurs par départements
\n par la methode de jenks (2008)")+
theme_bw()+
coord_equal()
并使用classInt
库中的classIntervals
对象类型绘制图形。
我想将这2个图形放在一起。 我已经尝试过:
vplayout <- function(x, y) viewport(layout.pos.row = x, layout.pos.col = y)
grid.newpage()
pushViewport(viewport(layout = grid.layout(1, 2)))
#creation
print(u, vp = vplayout(1, 1))
print(v, vp = vplayout(1, 2))
还有一些与grid.arrange
相关的内容。
grid.arrange(plot1, plot2, ncol=2)
但是这些都不起作用。