I am having trouble plotting one of my graphs (think graph theory graph with
edges and vertices, not scatterplots or histograms).  For some pairs of
vertices, I want multiple edges to be visible in my graph.  As an example of
this, in my script below, I want two edges to be visible from vertex 1 and
vertex 9 (among some others) yet when I plot it, only one edge is visible.

################################################################
gp1 = c(1,3,5,7,9)
gp2 = c(2,4,6,8,10)
gp3 = c(2,3,5,7)
gp4 = c(1,4,9)

adjm = numeric(100)
dim(adjm) = c(10,10)

for (i in 1:4){
        gp = eval(as.symbol(paste("gp",i,sep="")))
        N = length(gp)
        for (j in 1:N){
                for (k in j:N){
                        adjm[gp[k],gp[j]] = adjm[gp[k],gp[j]]+1
                        adjm[gp[j],gp[k]] = adjm[gp[k],gp[j]]
                }
        }
}
for(i in 1:10){adjm[i,i]=0}
require(igraph)
gg=graph.adjacency(adjm,mode="max")

V(gg)$name = 1:10
V(gg)$label = V(gg)$name

plot.igraph(gg, layout=layout.kamada.kawai, vertex.color=gray(0.7))

#################################################################

Thanks in advance,
-Steven Wolf
MSU Dept of Physics

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to