igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Plotting weighted graphs


From: Gabor Csardi
Subject: Re: [igraph] Plotting weighted graphs
Date: Wed, 12 Mar 2008 08:57:55 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Dan,

currently only the Fruchterman-Reingold layout supports edge weights.
This layout is calculated from random starting points by default,
so it'll give you different results each time you invoke it. 

See http://lists.gnu.org/archive/html/igraph-help/2007-06/msg00023.html
for an example.

Best,
Gabor

On Tue, Mar 11, 2008 at 03:43:21PM -0700, Dan Fleder wrote:
> Hi,
> 
> I'm sorry for such a simple question, but I couldn't seem to resolve it from
> the help files.
> 
> In R/igraph, how does one ensure that plots respect edge weights (distances)?
> The documentation for layout has one line about weights, but it doesn't give
> much detail.
>  
> For example, imagine a simple graph: a right triangle with sides of length 1,
> 20, and sqrt(401). The triangle is very long. But, whenever I enter the code
> below, the plot doesn't show the long edges. (The plot has edges look too 
> equal
> in length).
> 
> D = matrix( c(0,20,401^.5,20,0,1,401^.5,1,0), nrow=3,ncol=3)
> g = graph.adjacency(D, weighted=TRUE, mode="undirected")
> plot(g)         
> 
> Thanks in advance for any help
> Dan
> 

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


-- 
Csardi Gabor <address@hidden>    UNIL DGM




reply via email to

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