Change axis range

I understand we can use axis->SetRange() to change the viewing range and then axis->GetFirst() and axis->GetLast() will return users a current range. However, I notice that this is not the case for yaxis of 1 histogram, maybe I did wrong things in my example code. I am attaching an example code to here. Thanks.

test_axis_range.C (616 Bytes)

For the axis with the bin contents (y axis for 1-D, z axis for 2-D) use the functions TH1::GetMinimum, GetMaximum