Hi,
I would like to save TGraph2D objects on a TFile. But when some members of my TGraph2D are not saved. Specificaly title, axis specifications (axis title, title offset, color etc.).
In the TGraph2D defintion I see :
TH2D* fHistogram !2D histogram of z values linearly interpolated
And I think this is the cause of my troubles. fHistogram holds a lot specifications which interest me. But these specifications are not saved.
How can I restore easily my TGraph2D ?
I can save the fHistogram member myself, and call TGraph2D::SetHistogram() after having reading a TGraph object, but
- what is the cost in memory ?
- Is there anythings to do after and/or before TGraph2D::SetHistogram() ?
thanks you for your help, I know the title of a TGraph2D is saved, but I want the axis titles to be saved too (with their offset, color …).
I send you an anormaly thing which appears when I try to do a dt->GetXaxis() after the TGraph2D is filled. In fact, if I doesn’t try to use GetXaxis(), there is no problems, but if I use GetXaxis() a “: problem setting view” appears. (I send 2 screen shoot which show that).
I don’t know if this is a problem which come from my installation, or if it is that I musn’t use GetXaxis() here.
For TGraph2D the data member holding the underlaying histogram has been explicitely declared as not persistant in TGraph2D.h:
TH2D *fHistogram; //!2D histogram of z values linearly interpolated
the character “!” starting the comment means that …
That’s not the case for TGraph.
So, for TGraph2D, all the attributes (like the axis titles) depending on the underlaying histogram (fHistogram) will not be saved. I guess the choice was made to not save this histogram because of size issues. This histogram can be quite big.