# SetRangeUser and SetTitle working with THStacks and TH1F obj

**URL:** <https://root-forum.cern.ch/t/setrangeuser-and-settitle-working-with-thstacks-and-th1f-obj/12114>\
**Category:** ROOT\
**Created:** [March 22, 2011, 5:00pm UTC](https://root-forum.cern.ch/t/setrangeuser-and-settitle-working-with-thstacks-and-th1f-obj/12114 "2011-03-22T17:00:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Quinonez](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@Fernando\_Quinonez](https://root-forum.cern.ch/u/Fernando_Quinonez)\
**Post date:** [March 22, 2011, 5:00pm UTC](https://root-forum.cern.ch/t/setrangeuser-and-settitle-working-with-thstacks-and-th1f-obj/12114/1 "2011-03-22T17:00:12Z")

</div>

Hello dear experts,

I was trying to set the range on a Canvas that has a THStack object and one or more TH1F objects outside the stack, also I was trying to set a title on the y-axis of it, but resulting on the pad without the titlte and the range does not coincide withe the requested.

This is an example:

```auto
{
  THStack* hs = new THStack("hs","hs");
  TH1F* h1 = new TH1F("h1","h1",50,-5,5);
  TH1F* h2 = new TH1F("h2","h2",50,-5,5);
  TH1F* h3 = new TH1F("h3","h3",50,-5,5);

  h1->FillRandom("gaus",13000);
  h2->FillRandom("gaus",20000);
  h3->FillRandom("gaus",35000);

  TH1F hsum = *h1 + *h2 + *h3;
  hsum.SetMarkerColor(kOrange);
  hsum.SetMarkerSize(1.5);
  hsum.SetMarkerStyle(20);

  h1->SetFillColor(kRed);
  h2->SetFillColor(kAzure);
  h3->SetFillColor(kYellow);

  TAxis* a = hsum->GetYaxis();
  a->SetTitle("Colombia?");
  a->SetRangeUser(0,5.e5);

  hs->Add(h1);
  hs->Add(h2);
  hs->Add(h3);

  hs->Draw();
  hsum->Draw("EPSAMES");

}
```

Well the root version is 5.28.00 for linuxx8664gcc  
the gcc is  
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)

Any help is ubuntu.

---

_[View the full topic](https://root-forum.cern.ch/t/setrangeuser-and-settitle-working-with-thstacks-and-th1f-obj/12114)._
