Divide with zero spaces, axis problems

Hi,

I try two draw two histograms above each other with no space in between them. Divide(1,2,0,0) works fine for that, but the axis titles / labels get cut at the edges of the histogram (see plot). I tried to specify a space along x with Divide(1,2,0.05,0) but that did not lead to any improvement. Can you tell me how to solve this problem at least for the x-axis? (If you know also a solution for the y-axis even better :smiley: ) I attach the script I’m using, the root file it works on and the plot it produces.

Thanks in advance

Petra



psgnminuspbkg.root (8.19 KB)
plots_prd.C (3.16 KB)

Attached you’ll find a modified version of your macro. Parameters might be adjusted depending the font and character size you are using. Note that to make the highest Y label visible I have modified the number of divisions. To achieve the same goal you can also modify the top margin (and leave the number of divisions unchanged).
plots_prd.C (3.34 KB)

Hi,

first, thanks for your answer, it already helped me a lot! But I still have some issues using Divide(). As you can see in the plot I posted last time the label size for the upper and lower plot are different. I do not understand why is that. I tried the tutorial zones.C and find the same effect there. The strange thing is, if I do not use zero margins with Divide() then all labels have the same size (see plots attached). Does someone understand what happens and can tell me how to get the same label size with zero margins?

Thanks in advance

Petra




Set label font/size in pixels

h.GetXaxis()->SetLabelFont(63);
h.GetXaxis()->SetlabelSize(12);

same for y axis

Rene