About reading and drawing vertex labels
Dear all, Can anybody kindly help me with this? I have a graph stored in the .gml format with each vertex labelled by some name. I want to draw these labels on top of the vertices while drawing the graph but I couldn't find any description of that in the documentation. As of now, I am only doing: G = gt.load_graph('test.gml') gt.graph_draw(G) I am attaching an example file with labels with this email. I would highly appreciate any help. Regards Snehal -- Snehal Madhukar Shekatkar Pune India
On 08.10.2016 15:34, Snehal Shekatkar wrote:
Dear all,
Can anybody kindly help me with this? I have a graph stored in the .gml format with each vertex labelled by some name. I want to draw these labels on top of the vertices while drawing the graph but I couldn't find any description of that in the documentation.
The labels are stored as internal properties. Please read the documentation about property maps: https://graph-tool.skewed.de/static/doc/quickstart.html#property-maps and the documentation of the graph_draw() function https://graph-tool.skewed.de/static/doc/draw.html#graph_tool.draw.graph_draw (look for the vertex_text option) Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Thanks for the quick reply Tiago. I have more or less seen this. My question is mainly about extracting those labels from gml file as some PropertyMap. How do I do that? Thank you Snehal On Sat, Oct 8, 2016 at 8:10 PM, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 08.10.2016 15:34, Snehal Shekatkar wrote:
Dear all,
Can anybody kindly help me with this? I have a graph stored in the .gml format with each vertex labelled by some name. I want to draw these labels on top of the vertices while drawing the graph but I couldn't find any description of that in the documentation.
The labels are stored as internal properties. Please read the documentation about property maps:
https://graph-tool.skewed.de/static/doc/quickstart.html#property-maps
and the documentation of the graph_draw() function
https://graph-tool.skewed.de/static/doc/draw.html#graph_ tool.draw.graph_draw
(look for the vertex_text option)
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
-- Snehal Madhukar Shekatkar Pune India
On 08.10.2016 15:45, Snehal Shekatkar wrote:
Thanks for the quick reply Tiago. I have more or less seen this. My question is mainly about extracting those labels from gml file as some PropertyMap. How do I do that?
It is explained in the documentation! Do not only "more or less" read it. Just look at the Graph.vertex_properties dictionary, it will include all the vertex properties read from file. -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Snehal Shekatkar -
Tiago de Paula Peixoto