Problems in "morphing" Y axis labels

Dear ROOTers,

my final aim is to have a plot with, on the y axis, a cubic-root scale, analog to the log scale: I would like the labels to be plot at the position of their cubic root (as in the log scale, the labels are put in the position of their logarithm).
I have two problems in doing it. The first one is that I still did not figure out how to do it exactly, the second one is that even with my intermediate attempt I am having hard times understanding what’s happening.

Please check the example I attached to the message.
Here, I would simply like to have a vertical axis overlapped to the y axis, covering the same range, and applying the identity function to the labels. Unfortunately, it does not work:

  • the range is not large enough (the red line is shorter than the black one)
  • the labels do not appear, for an error that I cannot understad.

Could you please help me fix my problem, or provide me with an example of my objective?

Best regards,


testaxis.cpp (1.2 KB)

ROOT Version: ROOT 6.18/05
Platform: macosx
Compiler: Apple clang version 11.0.3 (clang-1103.0.32.29)

PS I tried to use TPad::GetUxmin () and TPad::GetUxmin (), but the code fails miserably. Either I did not understand what those functions are there for (I thought it’s the real axis ranges), or they are bugged, since the Y range then goes from 0 to 1.


TGaxis newaxis (
clims.GetUxmin (),
clims.GetUymin (),
clims.GetUxmin (),
clims.GetUymax (),

At least:

  // ...
  dh->Draw ("hist") ;
  dh->SetLabelSize(0, "Y");
  dh->SetTickLength(0, "Y");
  TF1 *transform = new TF1("transform", axistransform,
                           dh->GetMinimum(), dh->GetMaximum(), 0) ;
  // ...

Thanks, this helps, pietro

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