How to obtain a given font size in the statistics box?


I do not manage to force the font size to a given value in the statistics box. I tried using SetStatFontSize. It appears to me that, if one of the values needs a long string to be displayed, the font size adapts automatically, no matter what. See attached example.

Many thanks in advance

Yes the stat box width remains the same when you change the font size. If you increase the font size it is use as a maximum but the text never exit the box. If you reduce the font size then the height of the box is change (the width is constant). If you need a bigger box you should change the box width with:


Thank you very much for the clarification but … the way to achieve a consistent formatting style is rather twisted, this way :frowning:
Especially for plots in publications, it would be nice if it was more straightforward

May be you can use pixel font size. like in:

   h = new TH1F("h", "h", 10, 1, 11);

It works, thank you!