igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] layouts, distances and weights


From: Tamas Nepusz
Subject: Re: [igraph] layouts, distances and weights
Date: Thu, 27 Aug 2015 16:03:22 +0200

You are probably running into this bug:

https://github.com/igraph/igraph/issues/839

The bottom line is: there is a bug in the implementation of the
Fruchterman-Reingold layout in igraph 1.0; the weights are ignored by
the algorithm. A fix has already been committed to the codebase but
there was no new release since then. The next version of igraph will
include the fix if you can wait until then, or, alternatively, you can
try to build the development version of igraph from source:

https://github.com/igraph/rigraph#installation

All the best,
Tamas
T.


On Thu, Aug 27, 2015 at 11:14 AM, Hadrien Commenges <address@hidden> wrote:
> Dear igraph developers,
>
> I just upgraded the igraph package and have some problems with the new
> layouts.
>
> In my an application I have a function to plot stars with varying distances
> between the center of the star and the peripheral. This distance should be
> proportional to a weighting variable and I used to get this result (with the
> former version of igraph) with the Fruchterman-Reingold using the "weights"
> argument. With the new function "layout_with_fr" I get a circle layout that
> doesn't take into account the weighting variable. Here is a reproducible
> example:
>
> df <- data.frame(V1 = 1, V2 = 2:10, WGT = sample(x = 1:5, size = 9, replace
> = TRUE))
> g <- graph.data.frame(df, directed = FALSE)
> coords <- layout_with_fr(graph = g, weights = E(g)$WGT)
> plot(g, layout = coords)
>
> Am I missing something? Is there a way to make the distance between the
> center and the peripheral vertices proportional to the weights?
>
> Thanks,
>
> Hadrien Commenges
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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