igraph-help
[Top][All Lists]
Advanced

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

[igraph] Problems with Transparency Plotting


From: Lorenzo Isella
Subject: [igraph] Problems with Transparency Plotting
Date: Wed, 14 Oct 2009 14:34:43 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Dear All,
I am trying to repeat the steps of the example about transparency plotting for the R bindings of igraph

http://igraph.sourceforge.net/screenshots2.html#3

Consider a graph whose edgelist is given at the bottom of this email and that is saved into the file edgelist-graph_no-weight49_.dat.
Then consider the snippet:

rm(list=ls())
library(igraph)
library(Cairo)

fn <- paste("edgelist-graph_no-weight49_.dat")
g <- read.graph(fn, "edgelist")
g <- as.undirected(g)
d <- get.diameter(g)


pdf("transparency_and_diameter.pdf")
l <- layout.fruchterman.reingold(g)
l <- layout.norm(l, -1,1, -1,1)
l2 <- l[ d, ]
plot(g, layout=l,
    vertex.label.dist=0.5,   vertex.color="#ff000033",
vertex.frame.color="#ff000033", edge.color="#55555533",vertex.label=NA, vertex.size=4)

plot(subgraph(g,d),layout=l2,
vertex.color="#ff0000", vertex.frame.color="#ff0000", edge.color="#555555",vertex.label=NA, vertex.size=4,
    add=TRUE, rescale=FALSE)

dev.off()

My problem is that the diameter d is
> d
[1]  1  0 11 10

but in the resulting transparency plot I see only 3 nodes and one edge. Obviously something went wrong, but can anyone tell me exactly where?
Many thanks

Lorenzo




0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 11
0 12
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 12
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 11
2 12
3 4
3 5
3 6
3 7
3 12
4 5
4 6
4 7
4 12
5 6
5 7
5 8
5 9
5 12
6 7
6 8
6 9
6 12
7 12
8 9
9 11
10 11










reply via email to

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