Optimize label position in Graphviz
Asked Answered
F

2

9

The following dotfile is creating a 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 label positions to reduce the graph size ?

Fisken answered 3/8, 2016 at 15:48 Comment(0)
L
9

Labels can be positioned with lp. You could change the labelangle. There are also headlabel and taillabel labels.
Search for 'label' in the documentation.

Lett answered 10/8, 2016 at 10:32 Comment(0)
S
7

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"]
}
Sought answered 5/8, 2016 at 8:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.