I would like to combine an existing vertex property (called labelv and of type string) and the vertex index to obtain a new vertex property, to use inside graphviz_draw. Here is what I wrote:
mylabel = g.new_vertex_property("string")
for v in g.vertices():
g.vp['mylabel'][v] = str(g.vp['labelv'][v])+" ("+str(g.vertex_index[v])+")"
graphviz_draw(g, vcolor=typev, gprops={"scalexy": "scalexy"}, \
vprops={"xlabel": mylabel, "fontsize": 6, "fixedsize": True, \
"labelloc": "t"}, eprops={"label": labele, "fontsize": 4, \
"dir": "forward"}, output=fname+".pdf »)
But it doens’t work. (I get the error message:
Traceback (most recent call last):
File "build-graph.py", line 380, in <module>
g.vp['mylabel'][v] = str(g.vp['labelv'][v])+" ("+str(g.vertex_index[v])+")"
File "/usr/local/lib/python2.7/site-packages/graph_tool/__init__.py", line 1346, in __getitem__
return self.properties[(self.t, key)]
KeyError: ('v', 'mylabel’)
Could you tell me what I’m doing wrong?
Thanks!
--
-------------------------------------------------------
Yannis Haralambous
Professor
Institut Mines-Télécom, Télécom Bretagne
Computer Science Department
UMR CNRS 6285 Lab-STICC
Technopôle Brest Iroise
CS 83818, 29238 Brest Cedex 3, France
Email: yannis.haralambous(a)telecom-bretagne.eu
Internet: http://perso.telecom-bretagne.eu/yannisharalambous/
ICBM address: 48°21'31.57"N 4°34'16.76"W
Twitter: y_haralambous
-------------------------------------------------------
...the ball I threw while playing in the park
has not yet reached the ground
(Dylan Thomas)
Es gab eine Zeit, wo ich nur ungern über Schubert sprechen,
nur Nächtens den Bäumen und Sternen von ihm vorerzählen mögen.
(Robert Schumann)
Hi,
When looking through the documentation for the Closeness and Betweenness
centrality measures, I noticed that they use an inconsistent notation.
The complexity of Betweenness is listed as: O(VE), while for Closeness it is
O(N(N+E)).
I'm presuming that N and V are both the number of nodes, if this is not the
case, then perhaps a clear definition of what N is might be useful, as I
don't see one.
In any case, thanks for the great package!
Best regards,
Sander
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.