# How to create a categorical legend?

**URL:** https://discourse.vtk.org/t/how-to-create-a-categorical-legend/2195
**Category:** Support
**Created:** [December 2, 2019, 4:39pm UTC](https://discourse.vtk.org/t/how-to-create-a-categorical-legend/2195 "2019-12-02T16:39:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![michael23](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael23/32/837_2.png) [@michael23](https://discourse.vtk.org/u/michael23)
#### Post date: [December 2, 2019, 4:39pm UTC](https://discourse.vtk.org/t/how-to-create-a-categorical-legend/2195/1 "2019-12-02T16:39:20Z")

</div>

Hi,

I would like to use the class “vtkCategoryLegend” to add a legend in the lower right corner of my render window. Is there any example of how to use this class?

Similar to the “gear type” example I found on the ParaView homepage:

 ![](https://discourse.vtk.org/uploads/default/original/2X/c/cbfbe429a2d02edc36cfe43efdb77ee5c67fb5e0.jpeg)

Thank you!

---

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [December 2, 2019, 11:06pm UTC](https://discourse.vtk.org/t/how-to-create-a-categorical-legend/2195/2 "2019-12-02T23:06:38Z")

</div>

vtkLegendBoxActor should do the trick: [https://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Legend](https://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Legend)
