Drawing float values on the vertices
Dear Tiago, I am trying to draw float values associated with vertices in a graph as vertex texts. However, I get a peculiar output (file attached). My code is given below: import graph_tool.all as gt import numpy as np g = gt.collection.data['karate'] value = g.new_vertex_property('float') for v in g.vertices(): value[v] = np.random.choice([0.5, 0.8]) gt.graph_draw(g, vertex_text = value, output = 'test.pdf') How can I draw the float values as such? Thank you Snehal -- Snehal M. Shekatkar Pune India
On 14.06.2017 08:03, Snehal Shekatkar wrote:
How can I draw the float values as such?
You should create a string property map and convert the float values using whatever format you want. Graph-tool defaults to a hexadecimal floating point representation, which allows for perfect storage, but is not the most readable. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Snehal Shekatkar -
Tiago de Paula Peixoto