Home | News | Documentation | Download

Why Are The Axis Numbers Cutting off?

Dear experts,

I am trying to figure out why the numbers on my histogram axes are cutting off. I tried to use TGaxis::SetMaxDigits(2); to prevent that from happening, but that did not really help. The 10 on the top is still cut off. Can you please provide me with some methods that I can try to get rid of this problem? Thank you very much for your help!

This is the canvas I am using: TCanvas* myC=new TCanvas("myC", "", 10, 10, 1900, 800);

I also divide the canvas intro three different pads.

Here is a copy of the results from one of the pads:

You need to increase the margins inside each pad.
Check for example the code in this part of the ROOT Primer (in particular, the lines similar to c_divide->GetPad(1)->SetRightMargin(.01); at the bottom of the example); you can do the same for Bottom/Top/Left margins (i.e. SetBottomMargin and so on…).
More details here https://root.cern/doc/v622/classTAttPad.html


Thank you very much! This is exactly what I need!