[R] igraph rglplot SVD-layout
Gábor Csárdi
csardi.gabor at gmail.com
Mon Nov 17 15:58:47 CET 2008
Rainer,
here is a quick workaround:
layout.svd3 <- function (graph, d = shortest.paths(graph), ...)
{
if (!is.igraph(graph)) {
stop("Not a graph object")
}
l <- svd(d, 3)$u
l[, 1] <- l[, 1]/dist(range(l[, 1]))
l[, 2] <- l[, 2]/dist(range(l[, 2]))
l[, 3] <- l[, 3]/dist(range(l[, 3]))
l
}
It might have problems if the graph has multiple components.....
Gabor
PS. I am quite surprised that this layout can be used for anything.....
On Mon, Nov 17, 2008 at 11:25 AM, Rainer Tischler <rainer_t62 at yahoo.de> wrote:
> The layout.svd-function in the igraph-package seems to support only two-dimensional layouts currently. Is anybody aware of a workaround to obtain the coordinate-values for the third dimension? (And by the way, is it possible to change the background-color in rglplots?)
> I'm using the R-2.6.2 version on Windows.
>
> Many thanks,
> Rainer Tischler
>
>
>
>
>
>
>
> WikipediaWictionaryChambers (UK)Google imagesGoogle defineThe Free DictionaryJoin exampleWordNetGoogleUrban DictionaryAnswers.comrhymezone.comMerriam-Webster<>0
> wvcidfjoguarm
>
>
>
>
> ______________________________________________
> 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