Re: [R] igraph rglplot SVD-layout

From: Gábor Csárdi <csardi.gabor_at_gmail.com>
Date: Mon, 17 Nov 2008 15:58:47 +0100

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

______________________________________________
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.
Received on Mon 17 Nov 2008 - 15:04:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 15:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive