Ask Your Question
0

edge label in graph doesn't print

asked 2020-12-17 07:08:05 +0100

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()
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-12-17 08:43:55 +0100

FrédéricC gravatar image

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

edit flag offensive delete link more

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 ( 2020-12-18 20:59:00 +0100 )edit

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: 2020-12-17 07:08:05 +0100

Seen: 20 times

Last updated: Dec 17 '20