Numbers in scientific format on the x-axis of 1D histogram

I want to make the numbers appearing the x-axis of my 1D histogram to appear in a scientific format, i.e. 0.0006 will look like 6x10^-4. I am using ROOT Version: 5.34/09. Is there any function in this version of this ROOT which will help me to display the numbers in x-axis in scientific format ?

try to use SetMaxDigits, like this.


Should work also in the ROOT old version.


Getting an error like this,
AttributeError: ‘TAxis’ object has no attribute 'SetMaxDigits’

Try just


before drawing hist. Just note that this, as the Documentation says, changes the max number of digits in all axes.

Shouldn’t that set the precision for both the axes ?

With the version you are using SetMaxDigits was a global setting only (for all axis). The possibility to set it “per axis” appeared later.