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:


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,

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:


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();

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.