# Generate a legend with outputted decision tree figure (jupyter notebook)

**URL:** <https://forum.graphviz.org/t/generate-a-legend-with-outputted-decision-tree-figure-jupyter-notebook/390>\
**Category:** Help\
**Created:** [October 21, 2020, 3:44pm UTC](https://forum.graphviz.org/t/generate-a-legend-with-outputted-decision-tree-figure-jupyter-notebook/390 "2020-10-21T15:44:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb887](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jb887](https://forum.graphviz.org/u/jb887)\
**Post date:** [October 21, 2020, 3:44pm UTC](https://forum.graphviz.org/t/generate-a-legend-with-outputted-decision-tree-figure-jupyter-notebook/390/1 "2020-10-21T15:44:11Z")

</div>

I am generating a figure using graphviz of a decision tree I have constructed in jupyter notebook. Is there any way I can also print a legend/key with this figure?

---

<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:** [October 21, 2020, 8:35pm UTC](https://forum.graphviz.org/t/generate-a-legend-with-outputted-decision-tree-figure-jupyter-notebook/390/2 "2020-10-21T20:35:55Z")

</div>

Here are some links to follow:

> [@Adding key or legend?](https://forum.graphviz.org/t/adding-key-or-legend/351):
>
> I’m a new GraphViz user, so maybe I’m missing something obvious. I’m working on a graph that (currently) has about 100 nodes. Is there a way to add a key or legend on the bottom of the graph, to show what the different shapes and colors mean? I have a label, but I’d like more than that. My current solution is a second graph that I import as a node image. I’m working on a timeline, so I have a list of years down the left side of the graph, and I put an extra node at the bottom and rank my legend…

> <https://stackoverflow.com/questions/3499056/making-a-legend-key-in-graphviz>

> <https://stackoverflow.com/questions/19502559/graphviz-legend-key-with-nodes>
