how to use vertex_text, etc when using g.save

Hello,

I am brand new to graph-tool and found out with example how to label
vertices when using graph_draw, as seen below

graph_draw(g, vertex_text=labelv, edge_font_size=40, edge_text_distance=20,
edge_marker_size=40, output="output.png")

but do not see how to label vertices and edges when doing something like:

g.save('testoutput.graphml','graphml')

Can anyone assist with how this is done?

Thanks!

attachment.html (520 Bytes)

Hi,

You have to define vertex properties like so:

`graph.vertex_properties["labels"] = labels`

assuming `labels` here is a vertex PropertyMap

See here:

http://graph-tool.skewed.de/static/doc/quickstart.html#internal-property-maps

G.

attachment.html (1.97 KB)