Axis Title Offset in ROOT 6.26

Hello,

after switching from ROOT 6.24 to ROOT 6.26 I realized that all of my precisely adjusted Title Offsets come out wrong now. Looking into the Changelog I found the issue:
* Offsets for axis titles with absolute-sized fonts (size%10 == 3) are now relative only to the font size (i.e. no longer relative to pad dimensions).

Is there any way to turn this feature off and switch back to the ROOT 6.24 behaviour concerning title offsets? Otherwise I would have to readjust all of my title offsets (and probably also further offsets like label offsets) which would mean a gigantic effort.

Thank you very much and best regards


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.26.10
Platform: Debian 11
Compiler: g++ 12.2.0


I looked at the fix. It was a bug fix in the case of font size in pixels. That cannot be turned off. Are you using Pixel size? (precision 3)

Yes, I am using Pixel Font sizes.

I don’t get why you consider it a bugfix - I consider it the exactly opposite as everything was working fine and with the so called fix it does’nt, so it is a newly introduced bug!

I think in the meantime I found the responsible PR: Fixed title offsetting when using absolute-size fonts and multiple pads by will-cern · Pull Request #8235 · root-project/root · GitHub
That way I know at least the changes I have to undo to get ROOT working as expected again.

Thank you

Yes, it is this PR. Can you post a small script showing the problem you get?

It is not directly a problem, however to make the plots look like they did under ROOT 6.24 I have to adjust the title offsets in all of my macros which is a huge effort and then my macros will no longer produce the correct plots under ROOT 6.24, so in principle I would have to change every SetTitleOffset(xxx) to something like SetTitleOffset(ROOT_VERSION_CODE >= ROOT_VERSION(6,26,0) ? yyy : xxx), but I’m not gonna do that since I can just undo the so-called fix in my ROOT installation.

You also had doubts about this PR: Fixed title offsetting when using absolute-size fonts and multiple pads by will-cern · Pull Request #8235 · root-project/root · GitHub
Seems to me that I am the earthquake.

I see. Can you provide a small example showing the effect?

Lets assume I had written the following code under ROOT 6.24:

TH1D* h = new TH1D("h", "Test;x-Title;y-Title", 1, 0., 1.);
h->GetXaxis()->SetTitleFont(43);
h->GetXaxis()->SetTitleSize(30);
h->GetXaxis()->SetTitleOffset(0.7);
h->GetYaxis()->SetTitleFont(43);
h->GetYaxis()->SetTitleSize(30);
h->GetYaxis()->SetTitleOffset(0.7);
h->Draw();

Running it with ROOT 6.24 gives me Titles perfectly adjusted to the canvas borders:

Running it however with ROOT 6.26, the position of the y-Title changes and overlaps with the space for the labels:

Many Thanks, I see the effect, on the Y Title. I will check closely.

I went through the PR discussion checking all details, and indeed the new version is fixing a bug. With the old version, the title offset was depending on the canvas size. With the new one, it does not anymore. That’s an improvement. We keep it that way.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.