Set range y axis TEfficiency

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!

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:

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

Lorenzo

2 Likes

Thank you very sir Lorenzo !!