igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] vertex overlap layout


From: Bruno Contreras Moreira
Subject: Re: [igraph] vertex overlap layout
Date: Tue, 03 Mar 2009 13:12:47 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Thanks Gabor,
indeed I had already tried your first suggestion, ie, exporting the coordinates from a tkplot rendering, but although layouts can be easily exported as matrices, I haven't been able to correctly export layouts after changing the window size. What this means is that if I enlarge a tkplot circle layout, when I export the coordinates I still get a default size circle layout, is this a known limitation of igraph?
Best,
Bruno
Bruno,

if you have to do this only once, then you can plot the graph
interactively, adjust the positions and use the new coordinates. E.g.:

g <- ba.game(100,1)
id <- tkplot(g, layout=layout.kamada.kawai)
## Adjust the positions here
coords <- tkplot.getcoords(id)

If you need to do this over and over again, then here is the excerpt
of some emails in the subject:

-----------
[...]
I don't know any direct way to do this, unfortunately. You
can try to run a couple of steps with a force-based layout algorithm
(a different one, if your original layout was generated such a way).
E.g.

library(igraph)

set.seed(1123)
g <- graph.tree(40)
V(g)$size <- 10
lay <- layout.norm(layout.random(g), -1,1,-1,1)
plot(g, layout=lay)

lay2 <- layout.graphopt(g, niter=10, start=lay, max.sa.movement=1/200)
lay2 <- layout.norm(lay2, -1,1, -1,1)
plot(g, layout=lay)
plot(g, layout=lay2)
[...]
-----------
Thanks for the great advice. I did a bit of experimenting to find the
best layout for me. I used a similar approach to the one you proposed: I
created an initial reingold.tilford layout, normalised it, applied a
force-based algorithm (fruchterman.reingold.grid), and normalised it
again. Layouting a graph seems quite involved, but I'm certainly happy
with the result.
------------

Best,
Gabor

On Tue, Mar 3, 2009 at 11:45 AM, Bruno Contreras Moreira
<address@hidden> wrote:
Dear all,
I have searched the archive of the list and have not been able to find an
answer to this question:
is it possible to tell plot.igraph to use a layout.circle but avoiding
vertex overlap?
The point is that I am rendering a graph with ~100 nodes and the nodes
overlap so much that it is impossible to read the labels.
Can anybody help with this, please?
cheers,
Bruno

--
Bruno Contreras Moreira
Estación Experimental de Aula Dei /CSIC
Av.Montañana 1.005, 50059 Zaragoza (España).
Tel:(+34) 976716089 Fax:(+34) 976716145
address@hidden http://www.eead.csic.es/compbio



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help






--
Bruno Contreras Moreira
Estación Experimental de Aula Dei /CSIC
Av.Montañana 1.005, 50059 Zaragoza (España).
Tel:(+34) 976716089 Fax:(+34) 976716145
address@hidden http://www.eead.csic.es/compbio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]