我有2個曲線圖,地圖繪製與ggplot2
這樣的:ř放在一起傳統情節和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)
但這些工作。
對您有幫助嗎? http://stackoverflow.com/questions/14124373/combine-base-and-ggplot-graphics-in-r-figure-window – rawr
是的!大rawr謝謝! – delaye