Setting a constant number of decimal points on plot axis


Please read tips for efficient and successful posting and posting code

ROOT Version: 5.34/36
Platform: Scientiic Linux


I am looking to change number of digits in my axis labels, so that instead of labeling like {0.5, 1, 1.5, 2}, it is instead displayed as {0.5, 1.0, 1.5, 2.0}. I have tried using SetMaxDigits, but have not had success, presumably because I am looking to add more digits. Is there a simple command to do this that I have missed somewhere? I am trying to this for both the x and y axes on a 2D colz plot, if that makes a difference.

SetMaxDigits does something else. Try this instead:

  gStyle->SetStripDecimals(0);
2 Likes

Thanks! This is what I needed.