A problem about changing the labels on the axis

I want to go from the first graph to the second graph.Can you help me?Thank you very much!
%E6%8D%95%E8%8E%B7 %E6%8D%95%E8%8E%B7%20-%20%E5%89%AF%E6%9C%AC __
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


@couet can you help here?

Change the value of TGaxis::SetMaxDigits();
For instance:

TGaxis::SetMaxDigits(1);

I’m sorry, I just saw it. Thank you. I tried it, but there was an error in the code. I want to use it this way in graph,
image

but it is not allowed. A friend on forum suggested I try running the following code on root6 that is g1->GetHistogram()->GetYaxis()->SetMaxDigits(1);
but I can’t use root6 in my current environment.
I use root 5.34,an old version.
Thank you very much!

For the older versions use the global setting:

TGaxis::SetMaxDigits(1);

I am sorry that I did not achieve the purpose. After setting, the figure below,

and the horizontal coordinate of the figure has changed at the same time.Thank you very much!

I use:

{
   auto g = new TGraph();
   g->SetPoint(0,1,10000000);
   g->SetPoint(1,9,20000000);
   g->Draw("A*");
}

An i get:

The power of 10 is always a multiple of 3.

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