Drawing vertices labels does not work
I've been trying to add labels to nodes when drawing a graph. The documentation is not clear on that, however I guess it should be done through the vpropos
attribute of the graph_tool.draw.graph_draw
function.
This does not seem to work. Below, I attach the commands I used to create the plot, and the plot itself.
##### [12:54:17] # [dare2be@PC10CIS:~] #####
$ python
Python 2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool.all as gt
>>> g = gt.Graph()
>>> v1 = g.add_vertex()
>>> v2 = g.add_vertex()
>>> e = g.add_edge(v1,v2)
>>> vprop_label = g.new_vertex_property("string")
>>> vprop_label[v1] = "vertex one"
>>> vprop_label[v2] = "vertex two"
>>> vprops = {'labels' : vprop_label}
>>> gt.graph_draw(g, vprops=vprops, output="out.pdf")
<PropertyMap object with key type 'Vertex' and value type 'vector<double>', for Graph 0x1e969d0, at 0x1e96a90>