- Is there a way to avoid vertex overlaps when they are embedded randomly using
graph_tool.draw.random_layout
?
One indirect solution may be to use vertex_size
property and make them smaller, thus reduce their chance of overlapping (or simply generating the drawing many times, until one without overlaps comes across). But I figure there may be more elegant way of going about this.
Example code:
ex1 = Graph(directed=False)
ex1.add_vertex(10)
ex1.add_edge_list([(0,1),(0,2),(0,3),(0,4)])
pos = random_layout(ex1)
graph_draw(ex1, pos=pos, vertex_text=vertex_index, bg_color=[1,1,1,1], output="test.png")
Example of overlaps:
Aucun commentaire:
Enregistrer un commentaire