Reputation: 9062
I'm plotting the network graph pictured below using R and GGally::ggnet2.
You can see that there are several independent clusters disconnected from each other and these are quite spread out leaving a lot of empty space on the figure. Is it possible to make these clusters closer to each other thus making better use of the space?
Code to reproduce:
# Get datafile
wget https://www.dropbox.com/s/h4kt2fw1j4hdw3a/matrix.tsv
R
library(GGally)
library(network)
mat <- read.table('matrix.tsv')
net <- network(mat)
ggnet2(net, size= 1)
Upvotes: 2
Views: 415
Reputation: 19726
Trying different layouts might prove effective:
library(GGally)
library(network)
ggnet2(net,
size= 1,
mode = "kamadakawai")
or you can experiment with the parameters of a specific layout using the layout.par
argument
ggnet2(net,
size= 1,
mode = "fruchtermanreingold",
layout.par = list(repulse.rad = 100,
area = 1000))
for a complete list of options see ?sna::gplot.layout
Too find a pleasing layout you will need to experiment a bit with the options since they depend on the graph. To cite a part of the help ?sna::gplot.layout:
Vertex layouts for network visualization pose a difficult problem – there is no single, “good” layout algorithm, and many different approaches may be valuable under different circumstances.
set.seed(1234)
ggnet2(net,
size= 1,
mode = "fruchtermanreingold",
layout.par = list(repulse.rad = 300,
area = 1200))
Another option is using visNetwork and after finding a good initial layout manually moving some vertices
Upvotes: 2