Position of labels in a graph

asked 2016-04-06 23:51:25 +0200

mthomas gravatar image

I'm creating a labeled graph, but the position of the labels is making them difficult to read. For example:

D = DiGraph(multiedges=True)

creates a nice looking graph, but especially Edge1 is difficult to read. Is there a way to move labels away from the edges?

I know there are posts asking similar questions (insufficient karma to post links), though these suggest changing the rule for label location to be something other than the middle of the two points, and I'd rather not have to use the same rule for all labels, as the changes may be different for different vertices.

EDIT: I have a sort-of solution, which is just to add spaces in the label name or line breaks in the label name, which does achieve the goal, but if someone has a better solution, I would be very happy to hear it. E.g.:

D = DiGraph(multiedges=True)

D.add_edge(var('Vert2'),var('Vert3'),str("             Edge2"))
D.add_edge(var('Vert1'),var('Vert3'),str("             Edge3"))
edit retag flag offensive close merge delete