Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Tree layout of a graph

Consider the graph of this tree:

T = Graph()
E = [(0, 1), (1, 2), (2, 3), (2, 4)]
T.add_edges(E);
T.show(layout='tree',tree_root=0,tree_orientation='down')

image description

I would like to see the edges displayed in the order as given in the list E from left to right. In other words, I would like to have node(4) exchange its position with node(3).

How can I achieve this?

Tree layout of a graph

Consider the graph of this tree:

T = Graph()
E = [(0, 1), (1, 2), (2, 3), (2, 4)]
T.add_edges(E);
T.show(layout='tree',tree_root=0,tree_orientation='down')

image description

I would like to see the edges displayed in the order as given in the list E from left to right. In other words, I would like to have node(4) exchange its position with node(3).

How can I achieve this?

Edit: To clarify: Changing the order of the edge-list is no option (besides not working either). The order of the edges must be adhered to the order given.