# Horizontal Legend Creation

**URL:** https://forum.graphviz.org/t/horizontal-legend-creation/785
**Category:** Help
**Created:** [August 24, 2021, 6:22am UTC](https://forum.graphviz.org/t/horizontal-legend-creation/785 "2021-08-24T06:22:28Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)
#### Post date: [August 24, 2021, 5:11pm UTC](https://forum.graphviz.org/t/horizontal-legend-creation/785/2 "2021-08-24T17:11:36Z")

</div>

Is this what you are after? (I’m not sure what “_automatic fixed legend size_” means)

```auto
digraph LL {
  graph [labelloc=t, label=<
        <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4" VALIGN="TOP" HEIGHT="2.0">
         <TR>
          <TD COLSPAN="99"><B>Device Gen Info</B></TD>
         </TR>

         <TR>
          <TD> <FONT POINT-SIZE="10.0">Gen5</FONT> </TD>
          <TD>Gen4</TD>
          <TD>Gen3</TD>
          <TD>Gen2</TD>
          <TD>Default</TD>
          <TD>Timed Out</TD>
          <TD>Access Point</TD>
          <TD>Relay</TD>
          <TD>Bridge</TD>
          <TD>High Priority Access Point</TD>
          <TD>High Priority End Point</TD>
          <TD>High Priority Relay</TD>
          <TD>NIC</TD>
          <TD>LCS</TD>	  
          <TD>STL</TD>
          <TD>IOTR</TD>
          <TD>Default</TD>
          <TD>Timed Out</TD>

         </TR>
         <TR>
          <TD BGCOLOR="ORANGE"> </TD>
          <TD BGCOLOR="GREEN"></TD>
          <TD BGCOLOR="YELLOW"></TD>
          <TD BGCOLOR="BROWN"></TD>
          <TD BGCOLOR="VIOLET"></TD>
          <TD BGCOLOR="RED"></TD>
          <TD>Triangle</TD>
          <TD>Parallelogram</TD>
          <TD>Diamond</TD>
          <TD>DoubleCircle</TD>
          <TD>Trippleoctagon</TD>
          <TD>House</TD>
          <TD>Pentagon</TD>
          <TD>Trapezium</TD>
          <TD>Star</TD>
          <TD>Circle</TD>
          <TD>Rectangle</TD>

          <TD>Septagon</TD>
         </TR>
        </TABLE>>]

  // add a cluster to create margin between legend & actual graph
  subgraph clusterAll{
    graph[label="" peripheries=0] // do not duplicate graph legend
    a ->b ->c
  }
}

```

Giving:

 ![fixLegend1](https://global.discourse-cdn.com/graphviz/original/1X/f20365a6fb4b058adcf82228f59148786d83ad4c.png)

p.s. more on Legends: [Adding key or legend?](https://forum.graphviz.org/t/adding-key-or-legend/351)  
p.p.s. You can replace your textual descriptions (e.g. House) with images  
`<TD><IMG SCALE="TRUE" SRC="image_dir/noLeft.png"/></TD>`

---

_[View the full topic](https://forum.graphviz.org/t/horizontal-legend-creation/785)._
