r - Plot multiple graphs from igraph package in the same figure -


i try plot multiple igraph graphs in 1 figure using gridextra package

require(igraph) require(gridextra) er_graph <- erdos.renyi.game(100, 5/100) coords<-layout.fruchterman.reingold(er_graph) grid.newpage() pushviewport(viewport(layout = grid.layout(1, 2))) plot(er_graph,layout=coords, vertex.label=na, vertex.color='red',main='red graph') plot(er_graph,layout=coords, vertex.label=na, vertex.color='blue',main='blue graph') 

but result 2 separate graphs instead of grid of 2 graphs.
idea how plot multiple igraph graphs on same figure?

try,

par(mfrow=c(2,1)) plot(er_graph,layout=coords, vertex.label=na, vertex.color='red',main='red graph') plot(er_graph,layout=coords, vertex.label=na, vertex.color='blue',main='blue graph') 

you'll have mess margins (par(mar=)) bit graphs takes whole space.


Comments