Ask Your Question
1

DiGraph labels?

asked 14 years ago

Eviatar Bach gravatar image

updated 10 years ago

FrédéricC gravatar image

Labels don't seem to work on DiGraphs. For example:

g=DiGraph(vertex_labels=True)

g.add_edge(2,3,label="label")

g.show()

This just shows 2 and 3 as labels. Is this a bug or am I doing something wrong?

Thanks in advance.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 14 years ago

DSM gravatar image

Try "g.show(edge_labels=True)". The default is not to show them as they tend to clutter up graphs.

Preview: (hide)
link

Comments

Thank you, that's what I needed.

Eviatar Bach gravatar imageEviatar Bach ( 14 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

Stats

Asked: 14 years ago

Seen: 773 times

Last updated: Jan 02 '11