Can't enforce cuts on TProfile

Hi everyone,

In my macro, I have:

y1 = 7000;
y2 = 8000;
TProfile *prof = new TProfile("prof","example",nbin,x1,x2,y1,y2);

And I fill the TProfile in a loop. Whenever I plot the TProfile I see that the “y - axis” starts from 0 ! I have even printed the cuts on the screen to be sure if the values are right and they are indeed 7000 and 8000 let’s say, still on the canvas I have the whole range starting from 0 ! What could be reason behind this strange behavior ?

Thanks a lot

1 Like

Somehow when I fill the profile, the cuts that originally I imposed while defining the TProfile get pushed farther away, maybe because some entries are beyond the original cuts. But the desired cuts can be imposed once again (Note: after filling) using the following method:

prof->GetYaxis()->SetRangeUser(y1, y2);

:smiley:

1 Like