Stop nodes/vertices overlapping in igraph.plot

4.6k views Asked by At

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!

1

There are 1 answers

0
Daniel On

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")