# Syntax to add Legend to histogram plots and deleting the statistics being shown at the top right hand corner

**URL:** <https://root-forum.cern.ch/t/syntax-to-add-legend-to-histogram-plots-and-deleting-the-statistics-being-shown-at-the-top-right-hand-corner/34867>\
**Category:** Newbie\
**Created:** [June 27, 2019, 10:31am UTC](https://root-forum.cern.ch/t/syntax-to-add-legend-to-histogram-plots-and-deleting-the-statistics-being-shown-at-the-top-right-hand-corner/34867 "2019-06-27T10:31:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angey](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@Angey](https://root-forum.cern.ch/u/Angey)\
**Post date:** [June 27, 2019, 10:31am UTC](https://root-forum.cern.ch/t/syntax-to-add-legend-to-histogram-plots-and-deleting-the-statistics-being-shown-at-the-top-right-hand-corner/34867/1 "2019-06-27T10:31:23Z")

</div>

How do I add a Legend to my histogram plots and also how do I delete the statistics shown at the top right hand corner (the box with mean and rms entries) of my plot? I went through the answers in the forum related to this however, didn’t find any effective. Could someone please be able to help? I am attaching below my plot. I am using root 5.34/38[v2 vs pTzpc.pdf](https://root-forum.cern.ch/uploads/default/original/3X/a/f/aff2014260f3d190f0ba255301e8e641145c0ada.pdf) (16.9 KB)

Besides, I really have no clue about writing pT and v1 with T and 1 as subscripts respectively in my code itself! Need help in this regard as well.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 27, 2019, 11:34am UTC](https://root-forum.cern.ch/t/syntax-to-add-legend-to-histogram-plots-and-deleting-the-statistics-being-shown-at-the-top-right-hand-corner/34867/2 "2019-06-27T11:34:20Z")

</div>

> [@Angey](#):
>
> how do I delete the statistics shown at the top right

```auto
gStyle->SetOptStat(0);

```

> [@Angey](#):
>
> How do I add a Legend to my histogram plots

[https://root.cern/doc/master/classTLegend.html](https://root.cern/doc/master/classTLegend.html)
