[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] tkplot() - error message
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] tkplot() - error message |
Date: |
Wed, 23 Sep 2009 15:14:24 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
Dear Diana,
> > tkplot(graph , layout=pub.mat)
> [..]
> pub.mat is a matrix with two columns like this:
>
> pubMedID ArticleDate
> 12 53631 11
> 15 475066 14
The layout() argument of tkplot needs a graph layout; it is a matrix
with N rows and two columns, the first column containing the X
coordinate of the node on the plot, the second column containing the Y
coordinate. Your matrix does not look like a valid layout. igraph
tries to interpret it as a layout, so the PubMed IDs will be treated as
X coordinates, but they are too large.
What you will have to do is:
Either call tkplot() without the layout= option and set a layout from
the menu of the window opened by tkplot() -- you can also rearrange the
nodes by the mouse if you don't like the layout generated by igraph.
Alternatively, you can pre-calculate a layout using igraph's various
layout methods and pass the matrix obtained from the layout function. An
example:
layout <- layout.fruchterman.reingold(graph)
tkplot(graph, layout=layout)
Best,
--
Tamas