Setting max digits per TAxis

Hi all.

This question was asked some years ago, see [1]. I’d like to
ask again as 11 years have passed since then. Is there a possibility
to set the maxDigits option per histogram or even per axis of
the histogram? For example, I have a code that makes 4 histograms
and one of them should have an x axis with max digits set to 10 while
the others should have max digits at 3.

Is there a way to do this other than setting max digits of TGaxis
once to 10 and once to 3 (hence executing the code twice)?

Thank you,
heico

[1] - root.cern.ch/root/roottalk/roottalk04/2319.html

Hi!

If you look at the code of TGaxis, the SetMaxDigit Method is still static:

root.cern.ch/root/html604/TGaxi … tMaxDigits

and it sets a static internal variable. From this I would deduce that this is
still a global property.

Cheers,
Jochen

In general, this should work, I think (just don’t “click” on these pads):
TGaxis::SetMaxDigits(3);
MyPad3->Modified(); MyPad3->Update(); // make sure “MyPad3” is redrawn
TGaxis::SetMaxDigits(10);
MyPad10->Modified(); MyPad10->Update(); // make sure “MyPad10” is redrawn
TGaxis::SetMaxDigits(5); // restore the default value