3

What am I missing on this igraph plot() setup?

  • First, I read a GraphViz dot file using library(Rgraphviz):

    g2 <- agread("INDDGO/sample_graphs/viz.test", layout=FALSE)

  • Then, I plot it using (without issues):

    if (interactive()) plot(g2)

This confirms the dot file is valid. On the other hand, using igraph and sna to plot the same input file, I get invalid symbol coordinates, and I don't know how to fix this.

library(sna)
library(igraph)
g.dot <- read.dot("./INDDGO/sample_graphs/viz.test")
g.graph<- graph.adjacency(g.dot)
plot(g.graph)

In the last line, igraph fails. Any thoughts of what I am doing wrong?

Here is the Error string:

Error in symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color, : invalid symbol coordinates

sAguinaga
  • 638
  • 13
  • 31
  • Turns out, `agread("INDDGO/sample_graphs/viz.test", layout=FALSE)` reads the input file, where as `read.dot("./INDDGO/sample_graphs/viz.test")` cannot, any suggestions as to why? – sAguinaga Jan 17 '17 at 00:22
  • For me this error came up when calling `plot` on an empty graph – deeenes May 27 '20 at 18:48

0 Answers0