Ask Your Question

Revision history [back]

Setting the combinatorial embedding does not immediately affect how the graph is plotted. However, you can call one of the layout algorithms that use this combinatorial embedding, such as planar, with save_pos=True.

G = Graph([[0,1,2,3,5,4],[[0,1],[0,2],[0,3],[0,4],[0,5]]])
G.set_embedding({0: [1,2,3,4,5], 1 : [0], 2 : [0], 3:[0], 4:[0], 5:[0]})
G.layout('planar', save_pos=True)
G.show()

graph with embedding

Indeed we get clockwise 1, 2, 3, 4, 5.

Setting the combinatorial embedding does not immediately affect how the graph is plotted. However, you can call one of the layout algorithms that use this combinatorial embedding, such as planar, with save_pos=True.

G = Graph([[0,1,2,3,5,4],[[0,1],[0,2],[0,3],[0,4],[0,5]]])
G.set_embedding({0: [1,2,3,4,5], 1 : [0], 2 : [0], 3:[0], 4:[0], 5:[0]})
G.layout('planar', save_pos=True)
G.show()

graph with embedding

Indeed we get clockwise 1, 2, 3, 4, 5.

Edit: Obviously not clockwise but counterclockwise. I opened trac ticket #28152 for this issue.