R:绘制igraph时选择性显示节点 [英] R: Selectively display nodes when plotting an igraph

查看:681
本文介绍了R:绘制igraph时选择性显示节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何绘制igraph节点的选择?



我有一个现有图形,但它太复杂。我希望能够放大节点的一部分。



我可以删除边缘的一个子集,但我无法弄清楚关闭'隔离的节点。



当使用网络包时, displayisolates = FALSE 参数做到这一点;它不显示这些孤立的节点。



布局算法也应该忽略'关闭'边缘。



例如:

  g1 < -  graph(c(0,1,1,2,2,2, 3))
g2 < - delete.edges(g1,E(g1,c(0,1)))
plot(g2)
pre>

在绘制g2时,我不想显示节点0。 $ b

解决方案

据我所知,用户不应该提交新的答案来评论其他答案,但是我的编辑被拒绝了,而且我的声望也不高



我只想指出,在上面的葡萄酒回答中,从图片0.6开始,删除.isolates函数中的 - 1索引更正是不必要的。请参阅Tamas的评论:

-weight-igraph>仅绘制具有特定重量的边缘 - igraph


How can I plot a selection of igraph nodes?

I have an existing graph, but it is too complex. I want to be able to 'zoom in' on a subset of the nodes.

I am able to delete a subset of edges, but I can't figure out how to 'turn off' the isolated nodes.

When using the network package, the displayisolates=FALSE parameter does this; it does not display these isolated nodes.

The layout algorithm should also ignore the 'turned off' edges.

For example:

g1 <- graph( c( 0,1, 1,2, 2,2, 2,3 ) )
g2 <- delete.edges(g1, E(g1, c(0,1)))
plot(g2)

When plotting g2, I want to not display node 0.

Thanks

解决方案

I understand that users should not submit new answers to comment on other answers, but my edit was rejected and I don't have a high enough reputation to leave comments.

I just wanted to point out that in Wine's answer above, the "- 1" index correction in the deletes.isolates function is not necessary from igraph 0.6 onwards. See also Tamas' comment here:

Plot only Edges with a specific weight - igraph

这篇关于R:绘制igraph时选择性显示节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆