Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
3层(三方)igraph可视化图形/网络_R_Igraph - Fatal编程技术网

3层(三方)igraph可视化图形/网络

3层(三方)igraph可视化图形/网络,r,igraph,R,Igraph,在igraph中已经有一个关于三边图的主题,但是他们使用layout.sugiyama的方式对我来说并不好。我想为节点强加一个顺序。事实上,我想为三元图可视化边交叉。假设我有一个三元图,每列有3个节点。我将只有一条边从每个节点出来。例如,6条边可以是(A->E,B->F,C->D,D->H,E->G,F->I)。诸如此类: A D G B E H C F

在igraph中已经有一个关于三边图的主题,但是他们使用layout.sugiyama的方式对我来说并不好。我想为节点强加一个顺序。事实上,我想为三元图可视化边交叉。假设我有一个三元图,每列有3个节点。我将只有一条边从每个节点出来。例如,6条边可以是(A->E,B->F,C->D,D->H,E->G,F->I)。诸如此类:

      A         D         G         
      B         E         H
      C         F         I

我如何使用igraph实现这一点?正如我所说,我想看到交叉边缘。谢谢。

例如,您可以:

library(igraph)
coords <- matrix(c(rep(1:3, each = 3), rep(3:1, 3)), 
                 ncol = 2, 
                 dimnames = list(LETTERS[1:9], c("x", "y")))
g <- graph.formula(A--E, B--F, C--D, D-- H, E--G, F--I)
plot(g, layout = coords[V(g)$name, ])
库(igraph)
坐标