igraph-help
[Top][All Lists]
Advanced

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

[igraph] layouts, distances and weights


From: Hadrien Commenges
Subject: [igraph] layouts, distances and weights
Date: Thu, 27 Aug 2015 11:14:42 +0200 (CEST)

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

reply via email to

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