How to fix nodes when plotting a subset over a complete network using igraph R

房东的猫 提交于 2019-11-29 14:45:28

The reason is that igraph plotting functions rescale the layout to [-1,1] x [-1,1] by default. You can use the rescale=FALSE argument to plot() and then no rescaling is performed.

Note that in this case you'll need to set the limits of the plot by hand, by setting xlim and ylim:

xlim <- range(lay[,1])
ylim <- range(lay[,2])
plot.igraph(inetX, layout = lay, vertex.size = 20, 
            xlim = xlim, ylim = ylim, rescale = FALSE)
plot.igraph(inetY, layout = lay[idx,], vertex.size = 14, 
            add = TRUE, rescale = FALSE)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!