7

I have a directed igraph with 69 vertices, shown below. It was plotted using the igraph package:

library(igraph)
ig <- graph.adjacency(data, mode="directed", weighted=TRUE) 
plot(ig)

I'm looking to achieve the following 2 things:

(a) Space the vertices out and maybe lengthen the edges to make it a little easier to read

(b) In reality, my labels are longer. Is it possible to make a vertex bigger and the text smaller to accommodate this.

Any ideas?

Here is my data: https://www.dropbox.com/s/rtedrd1x1duqllj/data.Rdata?dl=0

igraph

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
user2846211
  • 949
  • 6
  • 16
  • 24

1 Answers1

10

All of the parameters are definitely highly customizable. I substituted state names for your vertex labels:

# this ensures the starting random position is the same
# for the layouts that use a random starting position
set.seed(1492) 

l <- layout.fruchterman.reingold(ig, niter=5000, area=vcount(ig)^4*10)

plot(ig, layout=l, 
     edge.arrow.size=0.5, 
     vertex.label.cex=0.75, 
     vertex.label.family="Helvetica",
     vertex.label.font=2,
     vertex.shape="circle", 
     vertex.size=1, 
     vertex.label.color="black", 
     edge.width=0.5)

enter image description here

You shld rly take some time to read help("igraph.plotting") & help("layout")

hrbrmstr
  • 77,368
  • 11
  • 139
  • 205
  • 4
    @hrbrmstr: Sorry for bringing up this old topic, but since version 0.8 `igraph` has deprecated and then removed the `area` attribute, which I suppose was allowing for more space between the nodes (?). Do you know of any replacement for `area`? – iNyar May 11 '17 at 23:16