# How to set Size of Title?

**URL:** <https://root-forum.cern.ch/t/how-to-set-size-of-title/40644>\
**Category:** Newbie\
**Created:** [July 26, 2020, 8:48am UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644 "2020-07-26T08:48:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [July 26, 2020, 8:48am UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644/1 "2020-07-26T08:48:11Z")

</div>

```auto
    g->GetYaxis()->SetRangeUser(-0.01, 0.1); // set range 

    g->SetTitle("Comparison of efficiency at different distances");

    g->GetXaxis()->SetTitle("distance d [cm]");

    g->GetYaxis()->SetTitle("efficiency #varepsilon");

    g->GetYaxis()->SetTitleSize(0.05);

```

I can set size of title X axis and Y axis, but I can not set size of title for the graph.  
I mean that there isn’t command `g->GetTitle()->SetTitleSize()` Could you help me, please?

---

<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:** [July 26, 2020, 8:55am UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644/2 "2020-07-26T08:55:56Z")

</div>

```auto
  gStyle->SetTitleFontSize(0.05);

```

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [July 26, 2020, 9:10am UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644/3 "2020-07-26T09:10:48Z")

</div>

I think it is used for Histogram. I tried to run code with that command, the header of graph moved, not changed size.

---

<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:** [July 27, 2020, 12:12pm UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644/4 "2020-07-27T12:12:54Z")

</div>

```auto
{
   TCanvas *c = new TCanvas("c","A Simple Graph without axis",700,500);
   gStyle->SetTitleFontSize(0.1);
   const Int_t n = 10;
   TGraph *gr = new TGraph(n);
   gr->SetTitle("A Simple Graph Example");
   gr->GetXaxis()->SetTitle("X axis");

   Double_t x, y;
   for (Int_t i=0;i<n;i++) {
      x = i*0.123;
      y = 10*sin(x+0.2);
      gr->SetPoint(i,x,y);
   }

   gr->Draw("A*L");
}

```

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [July 27, 2020, 3:15pm UTC](https://root-forum.cern.ch/t/how-to-set-size-of-title/40644/5 "2020-07-27T15:15:17Z")

</div>

Thank you for your helping.
