Limits of function y axis

Seems like this should be trivially easy, but I can’t figure it out. Suppose I plot a function and ask about its y axis:

void foo()
{
TF1* ffoo = new TF1 (“ffoo”, “pol2”, 0, 1000.);
ffoo->SetParameters (30000., .05, .03);
ffoo->Draw();
TAxis* ffy = ffoo->GetYaxis();
cout << ffy->GetXmin() << " " << ffy->GetXmax() << endl;
}

I’d expect in this case to get something a little under 30000 and something a little over 60000. Instead I get 0 and 1. What am I missing?

Hi Richard,

I think your problem has already been discussed here.

Yes, to make it shorter you should do:

        cout << gPad->GetUymin() << " " <<  gPad->GetUymax() << endl;