"A" [label=" A very long label"] "B...">

Optimize label position in Graphviz

The following point file generates massive output:

digraph G {
    "Bob"->"A" [label=" A very long label"]
    "Bob"->"B" [label=" A very long label"]
    "Bob"->"C" [label=" A very long label"]
    "Bob"->"D" [label=" A very long label"]
    "Bob"->"E" [label=" A very long label"]
    "Bob"->"F" [label=" A very long label"]
    "Bob"->"G" [label=" A very long label"]
}

Outputs something like this: Huge graph

Is there a way to change the position of the labels to reduce the size of the chart?

+4
source share
2 answers

Shortcuts can be arranged with lp. You can change labelangle. There are headlabelalso taillabellabels.
Find the "label" in the documentation .

+2
source

Very simple \ n solution

digraph G {
    "Bob"->"A" [label=" A very\nlong\nlabel"]
    "Bob"->"B" [label=" A very\nlong\nlabel"]
    "Bob"->"C" [label=" A very\nlong\nlabel"]
    "Bob"->"D" [label=" A very\nlong\nlabel"]
    "Bob"->"E" [label=" A very\nlong\nlabel"]
    "Bob"->"F" [label=" A very\nlong\nlabel"]
    "Bob"->"G" [label=" A very\nlong\nlabel"]
}
+1
source

Source: https://habr.com/ru/post/1650055/


All Articles