layout.reingold.tilford places two nodes on the same position
Bug #1067024 reported by
Michal Burda
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
New
|
Undecided
|
Unassigned |
Bug Description
In some historical version of igraph (newest in january 2011), the following simple graph was drawn correctly:
m <- matrix(c(0,0,1,1,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0), nrow=5)
g <- graph.adjacency(m)
plot(g, layout=
Igraph version 0.6 places vertices "3" and "4" on the same coordinates:
> layout.
[,1] [,2]
[1,] -1 0
[2,] 0 0
[3,] 0 1
[4,] 0 1
[5,] 1 0
To post a comment you must log in.
I am not sure why this happens, but a possible workaround is to explicitly give the root vertices:
m <- matrix(c(0,0,1,1,0, 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0), nrow=5) layout. reingold. tilford( g, root=c(3,4)))
g <- graph.adjacency(m)
plot(g, layout=