Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop nodes/vertices overlapping in igraph.plot

I have a table of nodes to be plotted in R and am using igraph.plot as it seems to be the best suited to my needs.

Not all the nodes in my graph are connected, i.e. some part of the overall graph may just contain a pair of connected nodes. I need to produce a series of node-edge graphs all represented in the same figure where none of the vertices overlap.

I have tried multiple layouts but I think it is because not all the nodes are connected to one another that they plot this way...

Does anyone know of a way to plot these without the nodes overlapping?

(I've tried to included two images below but it seems I need "reputation points" :/ )

Thank you in advance!

like image 615
Eoin Marron Avatar asked Nov 27 '14 15:11

Eoin Marron


1 Answers

You can prove the layout functions and editing sizes of the edges and vertex of your network. Try with this:

plot(G, vertex.size=8, vertex.color = rainbow(10, .8, .8, alpha= .8),
vertex.label.color = "black", vertex.label.cex = 0.4, vertex.label.degree = -pi/2,
edge.arrow.size = 0.3, edge.arrow.width = 0.4, edge.color = "black")
like image 112
Daniel Avatar answered Nov 14 '22 02:11

Daniel