Alphanumeric label size

When I assign alphanumeric labels to an axis, the labels are smaller than they should be. The attached example demonstrates this. You can run it to see the differences in label size:
root -l ‘he_plot.C(0)’
root -l ‘he_plot.C(1)’

The first command will show the numeric labels at the correct size. The second command will show alphanumeric labels on the Y axis at a smaller size. Images of both plots are attached.

How can I make the alphanumeric labels the same size as the numeric labels?





he_plot.C (1.96 KB)

Yes, the algorithm is different. Labels are not drawn by the same code. May be you can submit a Jira report …

Is there any way to figure out the conversion for the “label size” value in the code that plots alphanumeric labels? The value itself is set to be the same for both the numeric and alphanumeric cases, so it must be that the code is interpreting it differently. If there is some factor applied which makes the effective size smaller, I could divide out this factor when setting the size with TAxis::SetLabelSize().

Can you point me to the code which plots the alphanumeric labels vs. the code which plots the numeric labels?

I am not at work right now (9pm here)… I will look tomorrow. It is in TGaxis…
To keep track a Jira report would be useful.

[quote=“couet”]I am not at work right now (9pm here)… I will look tomorrow. It is in TGaxis…
To keep track a Jira report would be useful.[/quote]

Thanks, with that info I was able to find it in TGaxis. On line 1074 of TGaxis.cxx (root.cern.ch/root/html/src/TGaxis.cxx.html#1074), the charheight is multiplied by a factor 0.66666 (for certain fonts). Multiplying the value in SetLabelSize by 1/0.66666 = 1.500015 appears to restore the proper size. Example plot and macro are attached.

I will log this in a Jira report.
he_plot.C (2.04 KB)


The Jira report is submitted: sft.its.cern.ch/jira/browse/ROOT-6493

Thanks (fixed)