user3203476
user3203476

Reputation: 509

Edge labels writing over edge arrows in Graphviz

For my decision tree I need to place edge label nodes next to the nodes in GraphViz for readability, and i have tried to use taillabel but it writes over the edge arrow.

For example the following code:

digraph workflow 
{ 
checkit -> doit [taillabel ="y";]; 
checkit -> dontdoit [taillabel="n";]; 
}

renders like this (I use GVedit : Graphviz 2.38.0, Graphvizversion 1.02) :

enter image description here

How can I ensure that edge labels such as 'y' do not write over the edge arrow ?

Upvotes: 0

Views: 547

Answers (1)

Dany
Dany

Reputation: 4730

You can use labelangle and labeldistance attribute to control the precise position of taillabel or headlabel:

digraph workflow {
    checkit -> doit [
        taillabel ="y"
        labeldistance=2
        labelangle=330
    ]
    checkit -> dontdoit [
        taillabel="n"
        labeldistance=2
        labelangle=25
    ]
}

enter image description here

Upvotes: 1

Related Questions