5

I am trying to visualize graphs in R with the igraph package. I wish to visualize graphs with the edge size being between 2000 to 70,000. The plots look like this:

This is not a nice plot as you cannot see anything. I have figured out how to take away the labels, but still you cannot see anything since the vertices are so big.

  1. Can I remove the vertices and just look at the edges?

For example here is the same plot but I took the picture before it was finished. It seems that R only draws the edges before it is finished:

enter image description here

CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216

1 Answers1

9

You can set the vertex size to 0.

library(igraph)
g <- barabasi.game(100)
plot( g, vertex.size=0, vertex.label=NA, edge.arrow.size=0 )

Sample graph

Vincent Zoonekynd
  • 31,893
  • 5
  • 69
  • 78
  • Are there different layout algorithms to specify? I tried it out and it is exactly what I was looking for (strangely was not in the documentation). It does not look like it does in my picture above. – CodeKingPlusPlus Jul 27 '13 at 23:14
  • 3
    The plot was generated using exactly that code, nothing else. Most of the parameters are listed in `?igraph.plotting`, but they have to be prefixed by `vertex.` or `edge.`. Depending on your graph, the default layout may not be the best choice (my example was a tree -- that is much easier to plot): you can check `?layout` for the complete list of layout algorithms. To plot large graphs, many people use [Gephi](https://gephi.org/), which (being interactive) may be more flexible. – Vincent Zoonekynd Jul 27 '13 at 23:46
  • 1
    With `vertex.size=0` igraph still draws some very small vertices. It is better to set the shape to `none`: `plot(..., vertex.shape="none", vertex.size=0)`. – Gabor Csardi Jul 28 '13 at 12:49