TGaxis in histograms


in the ROOT documentation it is said that the drawing of axis, managed by the TGaxis class, is done by the histograms and graphs and so “the user should not have to see it”. TGaxis is to be used only in the case of axis being plotted independently of histograms or graphs (i.e. secondary axis)

However, I would like to customize some of the properties of the axis on my histograms, like the max number of digits before the notation 10^N appears, which are managed by the TGaxis class. It seems there is no way to get access to this object for the axis automatically drawn by an histogram (only TAxis is accessible). It is true? there is no way to do this without having to redraw the full axis?

Thank you in advance,


call the static function TGaxis::SetMaxDigits, eg:

void TGaxis::SetMaxDigits(Int_t maxd)
// static function to set fgMaxDigits
//fgMaxDigits is the maximum number of digits permitted for the axis
//labels above which the notation with 10^N is used.
//For example, to accept 6 digits number like 900000 on an axis
//call TGaxis::SetMaxDigits(6). The default value is 5.
//fgMaxDigits must be greater than 0.

Before drawing your histogram, do, eg