仅绘制带有标签对的边缘

时间:2013-01-24 12:08:10

标签: graphviz dot

我想绘制图形(梯形轨迹表示),如下所示: ladder track 即没有节点形状和两个边缘标签:在边缘的头部和尾部。 我该怎么做才能做到这一点? (14,15 - 每个都有两个边的节点)

1 个答案:

答案 0 :(得分:0)

几乎难看的解决方案(如果可以提高正确性,请进行编辑):

graph G {
    rankdir = LR;
    node [shape = point];
    edge [minlen = 2, fontsize = 8]
    a -- b [taillabel = "1", headlabel = "2"];
    b -- c [taillabel = "4", headlabel = "15"];
    b -- e [taillabel = "3", headlabel = "5"];
    e -- d [taillabel = "6", headlabel = "8"];
    e -- f [taillabel = "7", headlabel = "14"];
    c -- d [taillabel = "15", headlabel = "9"];
    f -- g [taillabel = "14", headlabel = "13"];
    d -- g [taillabel = "10", headlabel = "11"];
    g -- h [taillabel = "12", headlabel = "16"];
} 

导致

enter image description here