Ask Your Question
1

values or names on tree branches (graph)

asked 2018-09-18 13:33:09 +0100

ortollj gravatar image

Hi

How can I make appear names (or,and) numerical values on the branches ?.

#https://ask.sagemath.org/question/43106/preserving-the-rooted-tree-layout-in-graphs/
G=Graph({1:[2,3],2:[4,5],3:[6,7]})
G.weighted(False)
G.show(layout='tree',tree_root=1)
show(G.vertices())
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-18 15:07:42 +0100

ortollj gravatar image

Oops it is ok , sorry!

"""https://ask.sagemath.org/question/43106/preserving-the-rooted-tree-layout-in-graphs/"""
G=Graph({1:[2,3],2:[4,5],3:[6,7]})
G.weighted(False)
G.add_edges( [(1,2,'a'),(1,3,'b')] )
G.show(edge_labels=True,layout='tree',tree_root=1)
show(G.vertices())
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-18 13:33:09 +0100

Seen: 275 times

Last updated: Sep 18 '18