I use igraph in R for drawing a network graph in R,but I cant get a graph based on the edges length (eg (A,B) 5cm , (B,C) 2cm).please help me to sole the problem. How can I assign the particular distance in this program.
Asked
Active
Viewed 3,095 times
1 Answers
0
You can use the layout to plot the vertex at certain position. You can define the layout in a manner that respect a certain distance between vertex. A layout is defined in a matrix with 2 columns and a row for each node. The first column indicates its x position and the second its y position.
Here an example:
library(igraph)
gg <- graph.ring(4)
ll =matrix(c(0,0,0,1,0,3,0,5),ncol=2,byrow=TRUE)
plot(gg,layout=ll)

agstudy
- 119,832
- 17
- 199
- 261