md1630
md1630

Reputation: 891

R igraph - specify the minimum space in between vertices

Is there a way to set the minimum space in between two vertices in igraph so that the vertices don't look smashed together? The graph can be as big as needed.

Upvotes: 5

Views: 2695

Answers (1)

Dominic Comtois
Dominic Comtois

Reputation: 10401

There might be, but an indirect way is to minimize the vertex.size and, if needed, vertex.label.cex. Making your device larger should then maximize space between nodes.

ex:

library(igraph)
my.graph <- graph.lattice(length = c(4,4), dim = 1, directed = FALSE)
plot(my.graph,
       layout = layout.grid,
       vertex.label=toupper(1:16),
       vertex.size = 20,
       vertex.shape = "square",
       vertex.color="white",
       vertex.frame.color= "black",
       vertex.label.color = "black",
       vertex.label.family = "sans",
       vertex.label.cex=1,
       edge.width=2,
       edge.color="black")

enter image description here

Upvotes: 2

Related Questions