Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

dot - How to add edge labels in Graphviz?

I am trying to draw a graph using Graphviz, but I need to add labels on the edges. There does not seem to be any way to that in Graphviz. Are there a way out?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You use the label property attached to the edge.

digraph G {
 a -> b [ label="a to b" ];
 b -> c [ label="another label"];
}

The above generates a graph that looks something like this.

alt text


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...