# Customize the histogram title

**URL:** <https://root-forum.cern.ch/t/customize-the-histogram-title/58565>\
**Category:** Newbie\
**Created:** [March 17, 2024, 3:15pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565 "2024-03-17T15:15:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikas\_Raj](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vikas_raj/32/34682_2.png) [@Vikas\_Raj](https://root-forum.cern.ch/u/Vikas_Raj)\
**Post date:** [March 17, 2024, 3:15pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565/1 "2024-03-17T15:15:50Z")

</div>

Dear all,  
say i read a root file and apploed some cut, and drew it. Now I know, that this can be achieved by either a macro or in root terminal. Now, in root terminal when I do, I get something like this (PFA). But even , in root macro , i am getting the same thing. I want to remove the Tcut from the above title, set my own x and yaxis title .and also remove entries box!

Any help would be greatly appreciated!  
[dstar\_dm.C](https://root-forum.cern.ch/uploads/short-url/b6ySBnIqPBFMj65pxcXbKwtvWLC.C) (1.3 KB)

 ![dstar_dn](https://root-forum.cern.ch/uploads/default/original/3X/b/e/be07de7cbe91140c7cdfc134fd765be8ee041cf6.png)

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [March 17, 2024, 3:53pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565/2 "2024-03-17T15:53:06Z")

</div>

To hide the title and stats box, add at the beginning:

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

```

To set/change axes titles: after `chain->Draw(...);` do

```auto
  auto htemp = (TH1F*)gPad->GetPrimitive("htemp");
  htemp->GetXaxis()->SetTitle("your x title");
  htemp->GetYaxis()->SetTitle("your y title");

```

---

<div class="post-metadata">

**Author:** ![Vikas\_Raj](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vikas_raj/32/34682_2.png) [@Vikas\_Raj](https://root-forum.cern.ch/u/Vikas_Raj)\
**Post date:** [March 17, 2024, 3:59pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565/3 "2024-03-17T15:59:20Z")

</div>

Can I change the title too?

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [March 17, 2024, 4:07pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565/4 "2024-03-17T16:07:48Z")

</div>

You can make your own with [TLatex](https://root.cern/doc/master/classTLatex.html).

---

<div class="post-metadata">

**Author:** ![Vikas\_Raj](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vikas_raj/32/34682_2.png) [@Vikas\_Raj](https://root-forum.cern.ch/u/Vikas_Raj)\
**Post date:** [March 17, 2024, 4:25pm UTC](https://root-forum.cern.ch/t/customize-the-histogram-title/58565/5 "2024-03-17T16:25:59Z")

</div>

Thank you!!
