Canvas in root file, axis after loading not the same

Hi,

I have saved a plot (a canvas with axis and histograms) in a root file and now I need to change some labels in it. The problem is that after loading the canvas from file and drawing it, the axis are not the same as I saved them:
-The axis range is different, but I can live with that.
-The axis ticks are behind the histograms, how can I change that?

Cheers
Duc

It should not behave that way… can you provide a small macro reproducing this effect ?

Hi,

as I said at creation time it looked fine, but after loading from the root file that you find here: /afs/naf.desy.de/user/d/dbta/public/root/DIL_emu_JETN_bg.root
I have this problem with the axis.
In the same directory you can see the .gif .eps and .pdf version of the plot.

Thanks
Duc

Thanks for your files. I see that the ROOT file gives a different picture from the one showed by the other files. To debug this further we would need the original macro which generated these files.

Hi,

the macro is not so easy to use, since it is quite complex. Basically I add up 50 histograms in certain groups and then put them together into a THStack. Together with a legend and a label this is all drawn on a canvas.
All this is done with a certain “ATLAS” style and in python. In then end I just do c1.SaveAs(“test.root”).
Anything else I should look at?

Cheers
Duc

May be try to save it as a “.C” file (SaveAs(“test.C”):wink: and send us the test.C file. Then we could try to generate the .root file from it and see if we can reproduce your problem.

Hi,
I have got an update, the problem only occurs if I used root 5.22.00, not if I use 5.20.00. I think the file was created with 5.20.00. Could this be the source of the problem?

Cheers
Duc

I do not see any difference in the X axis (what differences do you see?)
I see that the y axis is hidden by the fill area of your histograms.
To solve this problem, simply do

c1.Draw(); c1.redrawAxis();
Rene

Hi,

with my root 5.22.00 version I also cannot see the ticks of the x-axis. The trick with c1.RedrawAxis() does not work for me, the axis ticks are still underneath the histogram.

Cheers
Duc

Hi,

I tried to convert the c1 into a .C file and when executing the .C file I see the same flaw: the axis ticks are behind the histograms (still only in root 5.22.00).

I have copied the .C file into the same directory, maybe you spot something.

Cheers
Duc

I ran your macro with the latest ROOT version. I see the tick marks. I saved the produced canvas in a ROOT file and redisplayed it: I get the same picture.

Hi,
yes, I can confirm that this problem is gone with root 5.24.00 (which is not yet installed at my place), sorry for making the noise,

Duc