igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Named vertexes from imported adjacency matrix


From: Tamas Nepusz
Subject: Re: [igraph] Named vertexes from imported adjacency matrix
Date: Sun, 1 Jun 2008 11:25:41 +0200

Hi Szabolcs,

> well I do not know how would I make the same result from the same 
> input, but I have converted my input file into ncol format and than 
> I could read it much easier
Yes, that's what I would have suggested if I had read your mail earlier;
unfortunately Graph.Adjacency does not handle vertex names directly (nor
Graph.Read_Adjacency, although this would be a nice addition, I will consider 
it).

> it would be nice to have both the line width and the frequencies
The plotting routine in the Python interface does not support labels on edges
yet. Theoretically it's not too difficult to modify Graph.__plot__ by hand;
this is a feature that's likely to appear in igraph 0.6.

> weights = [edge["weight"] for edge in g.es]
That's simpler this way: weights = g.es["weight"]

> plot(g,target="out.png",layout="reingold_tilford_circular",
> vertex_label=g.vs["name"],vertex_label_color="#FF4400",bbox=(0,0,960,
> 620),margin=(10,10,10,10))
> 
> no luck
margin should work; it seems like a bug then. I'll get back to this issue when
I'm at my own computer again. (In the meanwhile, try simply margin=10)

> also how would I modify the position of the labels ?
Try the vertex_label_dist and vertex_label_angle keyword arguments. They
control the distance and the angle of the center of the label from the center
of the vertex.

> Would it be possible to give a white or light gray background to the 
> vertex labels so they would cover the lines behind them to make it 
> much easier to read the labels ?
I also encountered this problem, but I haven't found a satisfactory solution
yet. I usually choose black for the vertex colors and light gray to the edges,
this works fine in most cases. A better solution would be to draw an outline
around the text, but I'm not sure it can be done with Cairo; or to draw a box,
which looks ugly IMHO.

> is it possible to measure Freeman node betwenness of the graph ?
Unfortunately not yet (except you implement it yourself using
Graph.get_all_shortest_paths). A similar measure that might be of use to you
is given by Graph.betweenness, which tells you the number of shortest paths
passing through given vertices in the network. This is practically the
"unnormalised" variant of the Freeman node betweenness. See:
http://cneurocvs.rmki.kfki.hu/igraph/doc/html/igraph_betweenness.html

> is it possible to get the standard deviation of the average produced 
> by Graph.density() ?
I don't really understand this question; Graph.density() is simply the number
of edges divided by the number of all theoretically possible edges. If you
want to average this measure over, say, a hundred graphs, you can make use of
the RunningMean object present in igraph:

rm = RunningMean()
rm << [g.density() for g in my_all_graphs]
print rm.sd


--
Tamas





reply via email to

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