How to add edge labels in Graphviz?

前端 未结 4 857
耶瑟儿~
耶瑟儿~ 2020-12-12 15:17

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?

4条回答
  •  不知归路
    2020-12-12 16:06

    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

提交回复
热议问题