Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a Legend/Key in GraphViz

I’d like to include a legend or key in my GraphViz diagram. I’m having trouble figuring out what code to use, though. I also want to put it in a corner, but the only coord I know for sure is the bottom-left: pos="10,10!".

Does anyone know how I can get this to work?

like image 637
Synetech Avatar asked Aug 17 '10 03:08

Synetech


1 Answers

digraph {   rankdir=LR   node [shape=plaintext]   subgraph cluster_01 {      label = "Legend";     key [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">       <tr><td align="right" port="i1">item 1</td></tr>       <tr><td align="right" port="i2">item 2</td></tr>       <tr><td align="right" port="i3">item 3</td></tr>       <tr><td align="right" port="i4">item 4</td></tr>       </table>>]     key2 [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">       <tr><td port="i1">&nbsp;</td></tr>       <tr><td port="i2">&nbsp;</td></tr>       <tr><td port="i3">&nbsp;</td></tr>       <tr><td port="i4">&nbsp;</td></tr>       </table>>]     key:i1:e -> key2:i1:w [style=dashed]     key:i2:e -> key2:i2:w [color=gray]     key:i3:e -> key2:i3:w [color=peachpuff3]     key:i4:e -> key2:i4:w [color=turquoise4, style=dotted]   }   ... 

enter image description here

I used dot.

like image 138
Mark Rajcok Avatar answered Dec 05 '22 09:12

Mark Rajcok