TGraph set maximum number of digits not working

root [0] auto c = new TCanvas()
root [1] c->DrawFrame(0.5,9.,7.5,9.5)
root [2] hframe->GetYaxis()->SetDecimals(2)