Programmatically resizing the histogram frame in the pad

Dear all,

Sometimes I have to manually (I mean with the mouse) resize the borders of the TFrame where an histogram is drawn within the current pad, for example when I draw 2D histos with the “zcol” option and the labels of the “coloured axis” goes out of the pad, or to make more room for an second axis on the top without overlapping the title.

I’m wondering how I can do that in a script, let’s say for example putting the right margin of the frame at 85% of the width of the pad (so possibly using NDCs)

Thanks a lot,

P.S. I’m using ROOT version 5.28.00b


See for example TPad::SetMargin()

Or, to set the right margin at 85%:

Cheers, Bertrand.