# TH1F - read and made histogram

**URL:** <https://root-forum.cern.ch/t/th1f-read-and-made-histogram/32801>\
**Category:** ROOT\
**Created:** [February 19, 2019, 10:30am UTC](https://root-forum.cern.ch/t/th1f-read-and-made-histogram/32801 "2019-02-19T10:30:24Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 20, 2019, 12:38pm UTC](https://root-forum.cern.ch/t/th1f-read-and-made-histogram/32801/8 "2019-02-20T12:38:24Z")

</div>

That’s maybe something for @couet  
In the meantime, you could try:

```auto
gStyle->SetOptStat(); // just a precaution
((TH1*)(hs->GetStack()->Last()))->Draw("HIST L"); // the sum
hs->Draw("SAME HIST L");

```

or:

```auto
gStyle->SetOptStat(); // just a precaution
TH1 *hl = ((TH1*)(hs->GetStack()->Last())); // the sum
hl->SetNameTitle("MyName", "my title;my X axis;my Y axis");
hl->Draw("HIST L");
hs->Draw("SAME HIST L");

```

where, instead of:

```auto
hl->SetNameTitle("MyName", "my title;my X axis;my Y axis");

```

you could use:

```auto
hl->SetNameTitle(hs->GetName(), hs->GetTitle());
hl->SetXTitle(hs->GetXaxis()->GetTitle());
hl->SetYTitle(hs->GetYaxis()->GetTitle());

```

---

_[View the full topic](https://root-forum.cern.ch/t/th1f-read-and-made-histogram/32801)._
