First time here? Check out the FAQ!

Ask Your Question
0

edge label in graph doesn't print

asked 4 years ago

cybervigilante gravatar image

I'm creating triplets from a string to avoid typing all those {}, to create a graph. Although the vertexes label properly, each third element should label an edge, but nothing happens. Otherwise it works. What is missing? Thanks.image description

grafadds = []
triplet = "alpha beta ab beta cappa bc cappa delta cd delta gamma dg alpha beta ab gamma alpha ga gamma beta gb beta alpha ba gamma gamma gg".split()
triplet = iter(triplet)

while True:
    try:
        grafadds.append((next(triplet), next(triplet),next(triplet)))
    except StopIteration:
        break

G = Graph(multiedges=True,loops=True)
G.add_edges(grafadds)
G.show()
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 4 years ago

FrédéricC gravatar image

The documentation says that you need to ask for the edge labels : G.show(edge_labels=True)

Preview: (hide)
link

Comments

Well, that was simple. Thanks. 😀 But for some reason after finding the docs there is nothing on increasing edge length, which is really important in a cluttered graph.

cybervigilante gravatar imagecybervigilante ( 4 years ago )

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: 4 years ago

Seen: 246 times

Last updated: Dec 17 '20