Hello Tamas, Thank you for the suggestion. Your solution worked beautifully. Very best, Tom
On Mon, Mar 25, 2013 at 12:14 PM, Tamás Nepusz <[email protected]> wrote: > > Thank you for your reply. You are right about the graphml files having > attributes set differently for R and gephi. When I look at the graphml file > produced by R, the color of the edges are coded on a single line. For > gephi, the file needs to have the information spread over three lines, one > for R,G, and B respectively. > Well, the thing is that GraphML does not specify how the colors should be > stored; in fact, the GraphML format is totally ignorant of the visual > representation of the graph. Gephi *happens* to store the colors in vertex > and edge attributes named "r", "g" and "b", but this is by no means part of > the GraphML format at all. If you want the colors of the nodes or edges in > your graph to be recognized by Gephi, you have to provide the "r", "g" and > "b" attributes yourself from the R side, save the graph in GraphML format, > and Gephi will parse the RGB values just fine. You may use the col2rgb > function in R to convert color names to their RGB components; e.g.: > > colors <- col2rgb(E(foo)$color) > E(foo)$r <- colors["red", ] > E(foo)$g <- colors["green", ] > E(foo)$b <- colors["blue", ] > write.graph(foo, format="graphml", file="test.graphml") > > -- > T. >
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
