Ask Your Question

edge labels and vertex size causes problems

asked 2013-11-25 21:33:26 -0600 gravatar image

updated 2014-05-21 20:07:30 -0600


I have several problems creating a graph. I want to misuse the graph tools in sagemath to create a flow diagram, but I encountered two problems:

First, the vertex_size option does not work at all in my code and

second, relating to the question here, is there now a possibility to shift the edge labels? I work with sage 5.9 in a virtual box environment

from sage.graphs.graph_plot import GraphPlot
h = DiGraph({0:[1,2], 1:[3], 2:[4]})
for u,v,l in h.edges():
    h.set_edge_label(u,v,'(' + str(u) + ',' + str(v) + ')')
h1=h.graphplot(save_pos=True, edge_labels=True, talk=True)
print h.get_pos()
h1=h.graphplot(save_pos=True, edge_labels=True, talk=True, vertex_size=0)

Thanks in advance.

edit retag flag offensive close merge delete


Anybody any ideas? gravatar ( 2013-12-10 20:23:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-06-05 16:37:34 -0600

kcrisman gravatar image

First answer: the vertex_size option does work, but the talk option has obscured this. Essentially, the labels are now taking up the place where the vertex would have been.

Secondly, I have (finally) opened Trac 16450 for something related to the edge labeling problem. But the hack here should work.

edit flag offensive delete link more


Up to now I did not test it with my example but I like to thank you in advance. gravatar ( 2014-06-05 19:05:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-25 21:33:26 -0600

Seen: 335 times

Last updated: Jun 05 '14