Have the nodes spread apart in graph_draw output
dear all, I have an attributed graph and want to display it using graph_draw. You can see the result I obtain in the attached PDF file. It is hardly readable, and still there is a lot of empty space in the PDF page. The command I used is the following: graph_draw(g, vertex_text=labelv, output_size=(2000,2000), vertex_fill_color=typev, edge_text=labele, output="test.pdf") How can I get the vertices spread apart in order to increase readability? Additional question: there must be some random part in graph_draw because every time I run it I get a completely different visual representation. Is there some way to insure that I get the same (or very close, if the data have changed slightly) output between two runs? Thanks in advance Yannis (not Panagis but Haralambous :-) -- ------------------------------------------------------- Yannis Haralambous Professor Institut Mines-Télécom, Télécom Bretagne Computer Science Department UMR CNRS 6285 Lab-STICC Technopôle Brest Iroise CS 83818, 29238 Brest Cedex 3, France Email: yannis.haralambous@telecom-bretagne.eu Internet: http://perso.telecom-bretagne.eu/yannisharalambous/ ICBM address: 48°21'31.57"N 4°34'16.76"W Twitter: y_haralambous ------------------------------------------------------- ...the ball I threw while playing in the park has not yet reached the ground (Dylan Thomas) Es gab eine Zeit, wo ich nur ungern über Schubert sprechen, nur Nächtens den Bäumen und Sternen von ihm vorerzählen mögen. (Robert Schumann)
On 11.10.2015 00:05, Yannis Haralambous wrote:
dear all,
I have an attributed graph and want to display it using graph_draw. You can see the result I obtain in the attached PDF file. It is hardly readable, and still there is a lot of empty space in the PDF page. The command I used is the following:
graph_draw(g, vertex_text=labelv, output_size=(2000,2000), vertex_fill_color=typev, edge_text=labele, output="test.pdf")
How can I get the vertices spread apart in order to increase readability?
Graph_draw() does not attempt to remove vertex overlaps. One option is to use the graphviz_draw() function, that uses graphviz to do the layout, which has the possibility of avoiding vertex overlaps.
Additional question: there must be some random part in graph_draw because every time I run it I get a completely different visual representation. Is there some way to insure that I get the same (or very close, if the data have changed slightly) output between two runs?
From the graph_draw() documentation: pos : PropertyMap (optional, default: None) Vector-valued vertex property map containing the x and y coordinates of the vertices. If not given, it will be computed using sfdp_layout(). So, if you do not specify the positions by hand, they are computed via the sfdp_layout(), which starts from a random configuration. If you want to preserve the same position across runs, you have to compute the positions once, and pass them every time as the "pos" parameter. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Tiago de Paula Peixoto -
Yannis Haralambous