Change significant figures of the axis labels

How to change the significant figures of the axis labels when drawing a TGraph object ? Please can you give me some instructions?


Thank you! But it doesn’t seem to work. Maybe ROOT has not provided this function.

Can you provide a small example macro showing what you get ?

Maybe I failed to describe my thought clearly. Here is an example:

void DrawAxis()
TCanvas c1 = new TCanvas(“c1”,“Example of Gaxis”,10,10,700,500);
axis=new TGaxis(0.1,0.1,0.9,0.1,0,2,505,"");

By calling axis->SetMaxDigits(2), I wish to get axis label values like:
0, 0.5, 1.0, 1.5, 2.0
But the result wouldn’t change no matter wether or not I called this function, the axis label values are:
0, 0.5, 1, 1.5, 2

I appreciate very much your help, can you give some advise?

use TAxis::SetDecimals


Thanks Rene, it DOES work! haha!