Search code examples
dot

Set distance between arrow and label


I have this little example code:

digraph Test {
    Beginning -> Ending [label="What", labeldistance=2.0];
}

This gives me this structure:

enter image description here

If I remove the labeldistance=2.0, than I'm getting the same graph. How can increase the distance of the label What to the arrow so it's a little bit moved to the right?


Solution

  • So I found this answer which explains amongst other thinks that you just need to add spaces in front of your label... like this:

    digraph Test {
        Beginning -> Ending [label=" What", labeldistance=2.0];
    }
    

    and produces this:

    enter image description here

    Also, labeldistance works only on the headlabel and taillabel as you can read in the docs.