Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic multiline labels in Graphviz?

Tags:

graphviz

I'm using Graphviz to draw some graphs. I'm using labels on nodes and I can put in "\n" to force it to split the label across 2 lines. Is there some way to get Graphviz (or dot which I'm using) to automatically see that it should split some nodes labels, and for it itself to make the best choice automagically?

like image 889
Amandasaurus Avatar asked Sep 25 '09 09:09

Amandasaurus


1 Answers

Yes, HTML-like labels (<...>) support
tag, using which you can break the lines. E.g.

"A" -> "B" [label = <1. <br/>  2. <br/>  3. <br/>  4. <br/>  .... <br/>  > color="blue" style="dashed"]; 

These also work when embedding Graphviz in LaTeX, where \n would not.

like image 152
Ivan Baidakou Avatar answered Oct 13 '22 18:10

Ivan Baidakou