I think, you can try hist->SetCanExtend(TH1::kXaxis); (or whatever you need: kYaxis, kZaxis, kAllAxes).
It probably will require quite a new ROOT version though (I’m not quite sure, but I think it’s available only in the trunk). Otherwise (with older versions) you can use TH1::kCanRebin bit and set it for your hist object
(hist->SetBit(TH1::kCanRebin);
I have not checked if it works with TGraph though - you are talking about y axis and your variable is named ‘gr1’.
But as you said histogram - with histogram it should work (for example, Fill will work correctly, extending/rebinning if some value is out of initial range).