Le 04/01/2013 10:35, Kire Gasteovski a écrit :
Guten Tag!

I am making the following example http://projects.skewed.de/graph-tool/wiki/FrontpageExample . 

What I want to do is to extract the coordinates of the nodes into a list from the vertex property map (i.e. from the variable pos, I assume they are stored there). How do I do that? Please help me, because I am stuck on this problem for 2 days and I can't find the solution.

Best regards,
Kiril


_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
Hi,

In this case, if I recall well, the propery map pos has elements of type vector<double>, so you can't access to the data through the pos.a attribute.

A simple loop will do though

pos_list = np.array([pos[v].a for v in g.vertices()])
Hope it helps.

Guillaume