Now I attach both the png and the root file. Here, on root 5.29.01 from svn the canvas drawn from within the .root file is different than the png (which looks the same as the image displayed by the code above), even after setting same scales.
I’ve also attempted calling gPad->Modified() etc. after saving to the root file, to ensure that the saving process does not alter my function somehow. But after update, what’s on the screen remains the same (same as in the png).
What can be the reason for such a behaviour? red_img.root (89.3 KB)
I see the z scale of the histogram in the canvas in the ROOT file is different from the png file you posted.
I do not have your original histogram so I will try to reproduce the problem with an other histogram.
I hope that the thing I discovered is connected with the different function drawing in .root file and in .png. Anyway, here is a sample of TF2, which when drawn, modified and saved to png has X axis title, but in root file does not.
I see… Anyway, the described behaviour, I mean the difference between saving to png and root seems to be a bug
I hoped that perhaps this bug connects with the different drawing of the function which you could not reproduce, but I guess not. I’ll try to somehow extract my function from my code.
.root files are not graphics output files in the sense of PDF, PNG, PS etc… they are not a graphics copy of the screen.
They are a copy of the canvas content.
When you set the title the way you did it you in fact change the title of the histrogram holding the axis.
That histogram is rebuilt each time a TF1 or TF2 is drawn that why the title goes away… That’s why you need to change the title at the TFx level not at the THx level.
For the rest you should remove ForceStyle from your rootlogon.C