[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] How to optimise layout without 'area' option?
From: |
Mostowy, Rafal J |
Subject: |
[igraph] How to optimise layout without 'area' option? |
Date: |
Sat, 5 Mar 2016 13:56:34 +0000 |
I'm trying to optimise the layout of a network I'm constructing with the
following code:
gr <- read.table("data.txt", header = F, stringsAsFactors = F)
node.names <- gr[,1]
node.names <- toupper(substr(node.names, 2, nchar(node.names)))
gr <- gr[,-1]
edge.table.index <- which(gr>0.5, arr.ind=T)
d <- data.frame(first = node.names[edge.table.index[,1]], second =
node.names[edge.table.index[,2]])
g <- graph.data.frame(d, directed=F)
g[from=V(g), to=V(g)] <- 0
layout.g <- layout.fruchterman.reingold(g)
plot(g, layout = layout.g, vertex.size = 5, vertex.label.cex=.7, vertex.color =
"lightblue", vertex.label.family = "sans", edge.color="black",
vertex.frame.color= "white")
In particular, what I'm trying to do is decrease the area on which the nodes
are displayed such that the connected components are closer together. Previous
versions of igraph had the option 'area' in the layout.fruchterman.reingold()
function but this doesn't seem to be the case anymore. I've tried playing with
various options like vertex size, vertex font size and width/height of the
exported pdf file but they don't really do the trick.
Does anyone have a suggestion? I’m attaching a link to the data.
Thanks,
Rafal
________________
Rafal Mostowy, PhD
Junior Research Fellow
Department of Infectious Disease Epidemiology
Imperial College London
St Mary's Campus
Norfolk Place
London W2 1PG
email: address@hidden
twitter: @RafalMostowy
website: http://rmostowy.wordpress.com
data.txt
Description: data.txt
- [igraph] How to optimise layout without 'area' option?,
Mostowy, Rafal J <=
- Re: [igraph] How to optimise layout without 'area' option?, Tamas Nepusz, 2016/03/05
- Re: [igraph] How to optimise layout without 'area' option?, Mostowy, Rafal J, 2016/03/07
- Re: [igraph] How to optimise layout without 'area' option?, Tamas Nepusz, 2016/03/07
- Re: [igraph] How to optimise layout without 'area' option?, Mostowy, Rafal J, 2016/03/07
- Re: [igraph] How to optimise layout without 'area' option?, Tamas Nepusz, 2016/03/09
- Re: [igraph] How to optimise layout without 'area' option?, Mostowy, Rafal J, 2016/03/09
- Re: [igraph] How to optimise layout without 'area' option?, Gábor Csárdi, 2016/03/09
- Re: [igraph] How to optimise layout without 'area' option?, Mostowy, Rafal J, 2016/03/09