Get a label one stepdown

Dear all,
I would like to have one label step down like this axis


But instead I got this You can see that the 9 and the 10 on X axis are regrouped so if I could have one step of the 10 like the first figure I show it would be very helpful. Can someone tell me please how to do it.
Thanks in advance.
Cheers,
Diallo.

You can make it smaller:

{
   TCanvas* c1 = new TCanvas("c1","",10,10,600,300);
   c1->Range(-10,-1,10,1);

   TGaxis *a1 = new TGaxis(-8,0,8,0,1,60,15,"G");
   a1->SetLabelSize(0.07);
   a1->SetMoreLogLabels();

   a1->ChangeLabel(2,-1.,0.05);

   a1->Draw();
}

Or may be making the intermediate labels smaller and the main ones bigger is better:

{
   TCanvas* c1 = new TCanvas("c1","",10,10,600,300);
   c1->Range(-10,-1,10,1);

   TGaxis *a1 = new TGaxis(-8,0,8,0,1,60,15,"G");
   a1->SetLabelSize(0.05);
   a1->SetMoreLogLabels();

   a1->ChangeLabel(1,-1.,0.07);
   a1->ChangeLabel(2,-1.,0.07);

   a1->Draw();
}

Hi,
Thanks for replying, you are right this could help too, but I need to do like the one I showed (one step down not smaller or bigger) because they need to be in the same paper and like that they are not the same.
Thanks.
Cheers,
Diallo.

It is not possible to change the label position using ChangeLabel (see the doc), that’s why I proposed you this other solution.

Hi,
Ok I see, but is it possible to change the offset of a label ? If it’s possible for instance I can apply it to 10.
Cheers,
Diallo.

no, see the doc … ROOT: TGaxis Class Reference

Hi Couet,
OK I see, thank you.
Cheers,
Diallo

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