Exponent label in a graph

Hi all,
is there a reason to modify the exponent on the top of the y axis in a hisrogram/TGraph?
For example in the attached i would like to modify the 10^3 into 10^6
unnamed.pdf (13.7 KB)


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi,
TGaxis::SetMaxDigits
in your case e.g. 3
for details see:
https://root.cern/doc/master/classTGaxis.html#GA12

Otto

Thank you…but it seems that command modifies all the axes. it is possible to do it only on Y axis?

Hi,
with root 6.20.00 this should work,
i.e.only yaxis is changed:

auto h1 = new TH1F("hh", "hh", 1000, 0,100000);
auto f1 = new TF1("ff", "gaus")
f1->SetParameters(100, 50000, 1000)
h1->FillRandom("ff", 1000000)
h1->Draw()
h1->GetYaxis()->SetMaxDigits(6)

Cheers
Otto

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