# Set range y axis TEfficiency

**URL:** <https://root-forum.cern.ch/t/set-range-y-axis-tefficiency/21296>\
**Category:** ROOT\
**Created:** [June 8, 2016, 5:27pm UTC](https://root-forum.cern.ch/t/set-range-y-axis-tefficiency/21296 "2016-06-08T17:27:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksaou](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/ebca7d/32.png) [@ksaou](https://root-forum.cern.ch/u/ksaou)\
**Post date:** [June 8, 2016, 5:27pm UTC](https://root-forum.cern.ch/t/set-range-y-axis-tefficiency/21296/1 "2016-06-08T17:27:29Z")

</div>

Hi everyone, I’m looking for a function that set the range of the y axis in TEfficiency.  
I’m calculating efficienies and in some of them, I get a range (0.9,0.96) which is not very nice to show on a paper. I want range from 0 to 1. Can you guys help me?

Btw: I’m working with pyroot

Thank you!

---

<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:** [June 9, 2016, 12:38pm UTC](https://root-forum.cern.ch/t/set-range-y-axis-tefficiency/21296/2 "2016-06-09T12:38:18Z")

</div>

Hi,

I guess you are working with 1-dimensional TEfficiency. In this case, after having called TEfficiency::Draw() and gPad-\>Update(), you can get the painted graph representing TEfficiency using TEfficiency::GetPaintedGraph() and then call SetMinimum/Maximum to the values you wish to have.  
Code Example:

```auto
efficiency->Draw(); 
gPad->Update(); 
auto graph = efficiency->GetPaintedGraph(); 
graph->SetMInimum(0);
graph->SetMaximum(1); 
gPad->Update(); 
```

Lorenzo

---

<div class="post-metadata">

**Author:** ![ksaou](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/ebca7d/32.png) [@ksaou](https://root-forum.cern.ch/u/ksaou)\
**Post date:** [June 10, 2016, 3:31pm UTC](https://root-forum.cern.ch/t/set-range-y-axis-tefficiency/21296/3 "2016-06-10T15:31:30Z")

</div>

Thank you very sir Lorenzo !!
