# HypoTestInverterPlot: Change Axis Label

**URL:** <https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888>\
**Category:** Newbie\
**Created:** [March 9, 2021, 2:14pm UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888 "2021-03-09T14:14:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibsession](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e68b1a/32.png) [@bibsession](https://root-forum.cern.ch/u/bibsession)\
**Post date:** [March 9, 2021, 2:14pm UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888/1 "2021-03-09T14:14:24Z")

</div>

Hello experts,  
Is there a way to change the axis label in a HypoTestInverterPlot? I looked into the documentation and the class does not have any members along the lines of `GetXaxis()->SetTitle("Energy [keV]")`. Is there something I am missing or is it simply not possible to change axis labels for this class?

Best regards!

---

<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:** [March 9, 2021, 2:41pm UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888/2 "2021-03-09T14:41:22Z")

</div>

According to the [doc](https://root.cern/doc/master/classRooStats_1_1HypoTestInverterPlot.html) MakePlot returns a TGraphErrors. Something like…

```auto
TGraphErrors g = H->Makeplot(....);
g->GetXaxis()->SetTitle("Energy [keV]");

```

… should work.

---

<div class="post-metadata">

**Author:** ![bibsession](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e68b1a/32.png) [@bibsession](https://root-forum.cern.ch/u/bibsession)\
**Post date:** [March 9, 2021, 4:15pm UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888/3 "2021-03-09T16:15:31Z")

</div>

Thank you, I didn’t catch that the first time reading through it.  
Maybe you can help me with my follow-up question: I already understood that I need to add the expected CLs and the observed CLs to a `TMultiGraph`, but this does not transfer the horizontal line for the confidence limit and the legend from the HypoTestInverterPlot. Is there a way to add them to the TMultiGraph?

---

<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:** [March 12, 2021, 8:46am UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888/4 "2021-03-12T08:46:04Z")

</div>

> [@bibsession](#):
>
> but this does not transfer the horizontal line for the confidence limit and the legend from the HypoTestInverterPlot

I do not fully understand what you mean here. May be @moneta has an idea.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 12, 2021, 9:51am UTC](https://root-forum.cern.ch/t/hypotestinverterplot-change-axis-label/43888/5 "2021-03-12T09:51:39Z")

</div>

Hi,  
If you want to change the label on the axis drawn by the HypotestINverter plot, and not redo all the plots done in `HypoTestInverterPlot::Draw()` you can do it by accessing the underlined used TGraph object. They are store in the global list of TROOT. So what you can do is:

```auto
gROOT->GetList()->ls(); // to be sure we are using the right names afterwards
auto graph = ((TGraph*)gROOT->FindObject("CLs_observed"));
graph->GetXaxis()->SetTitle("Energy [KeV]");

```

Lorenzo
