Getting a minimum/maximum for vertical axis of TH1

I need to access the minimal and the maximal value shown on the vertical axis of a drawn one-dimensional histogram, unfortunately something along the lines of h1->GetYaxis()->GetXmin() always gives me 0 for the minimum and 1 for the maximum, I expect there must be a scaling factor hidden somewhere… How to obtain the values I need?


Use h->GetMinimum, GetMaximum.
To find the min, max of a pad along Y, use
gPad->GetUymin(), GetUymax()


GetUymin/max worked perfectly, just what I needed. Thanks!