I was trying to enlarge the labels of the X axis of some plots
but unfortunately the labels are cut by the Pad limit.
I tried enlarging the Pad bottom margin
but even if I set it to the maximum value (1), the labels are cut the pad.
I can manage to fix this by reducing the histogram height, using the mouse
and then dragging the histogram up.
With reduced histogram height, labels can fit inside the Pad.
However I’d like to do this inside my macro and not “by hand”.
May you please point me to the relevant methods to be used?
Once you have done the right changes using the mouse, save the Canvas as a .C file from the menu File->Save->canvasname.C
Then you can take in the macro canvasname.C the settings you like.
I already tried this, I noticed that the method used in the canvasname.C to move the pad is Range()
However I cannot reproduce this in my macro.
Using canvasname.C to replot the figure is quite unpractical since I read histograms from file,
while canvasname.C fill them as points.
no … Range() defines the Pad range … you shoul have some "Margin"s methods in you C file.
I saved two distinct .C files, one with the output of the standard macro and the other one
with the macro where I resized “by hand” the histogram.
[biassoni@pcbabar9 figure]$ diff c1.C c1b.C
< //========= (Thu Jun 3 15:08:03 2010) by ROOT version5.22/00
//========= (Thu Jun 3 15:07:28 2010) by ROOT version5.22/00
However pad->SetBottomMargin(0.2322275); doesn’t sort any effect in the original macro.
as already said neither pad->SetBottomMargin(1) works
Can you post a small (working) macro reproducing your problem ?
I eventually solved the problem by chance.
I report the solution for future recording.
In the original macro I did
and this couldn’t manage the problem described above.
Switching the order of the commands
fixes the problem.
Thanks for your support