[R] layout of igraph

Gábor Csárdi csardi at rmki.kfki.hu
Thu Feb 26 16:54:14 CET 2009


Shukai,

layout.drl supports edge weights, so you could try that. An
alternative is doing MDS, see ?cmdscale and maybe help.search("MDS").

But both these methods are approximate, obviously, most often you
cannot embed an n-dimensional (n>>2) graph into the 2-dimensional
plane and keep all the "distances" between the vertices.

Best,
Gabor

On Thu, Feb 26, 2009 at 4:44 PM, kevinchang <shukai at seas.upenn.edu> wrote:
>
> Thanks Gabor's fast reply.
>
> In my research, every node has it's own vector of scores. So I can compute
> correlation between every pair of nodes. I used the width and color of the
> edge for this purpose. But visualizing the correlations by distance may be
> clearer.
>
> Best,
> Shukai
>
>
> Gábor Csárdi-2 wrote:
>>
>> Shukai,
>>
>> the force based layout algorithms (layout.drl,
>> layout.fruchterman.reingold, layout.graphopt, layout.kamada.kawai) are
>> likely to do this; although they are not explicitly required to place
>> hubs in the center, usually they do.
>>
>> I am not sure what is the "correlation between two nodes". You mean
>> that the graph is weighted?
>>
>> If you have a small graph, then you can refine the layout
>> interactively by using 'tkplot'.
>>
>> Gabor
>>
>> On Thu, Feb 26, 2009 at 4:20 PM, kevinchang <shukai at seas.upenn.edu> wrote:
>>>
>>> Dear R users,
>>>
>>> I am trying to draw a network using igraph package. I intend to place the
>>> hub nodes (the ones with the relatively more connection with other nodes)
>>> in
>>> the center of the graph.  Also, the graph need to be in the fashion that
>>> the
>>> higher the correlation between two nodes is , the closer the two nodes
>>> will
>>> be.  Is there any layout that can help or any other way to do this?
>>>
>>> Thanks in advance.
>>> Shukai
>>> --
>>> View this message in context:
>>> http://www.nabble.com/layout-of-igraph-tp22226348p22226348.html
>>> Sent from the R help mailing list archive at Nabble.com.
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>
>>
>> --
>> Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/layout-of-igraph-tp22226348p22226854.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM




More information about the R-help mailing list