COLZ color box values in scientific notation

Hi everyone,

I am sure this is an easy question but I could not find the answer anywhere… so once again I am looking for your help :blush:

I have a histogram with a color axis which I drew with COLZ. However the numerical values corresponding to these colors are very high (the legend goes from -5e10 to +1e10) so I am looking for a way to display them in scientific notation.

I tried to go using TGaxis but apparently the color box is not considered an axis :frowning:

Anyone would know how to do this?

Thanks a lot!! :slight_smile:

Try to used TGaxis::SetMaxDigits()

root.cern.ch/root/html/TGaxis.ht … tMaxDigits

Thanks, I had thought about it but here is what I was getting:

I did this: ppat->GetZaxis()->SetMaxDigits(2);
and got this error: error: ‘class ppat’ has no member named ‘GetZaxis’

I thought that when drawing with COLZ, it was considered to be a Zaxis but apparently not…

So how should I use TGaxis? Should I declare a new one and somehow superimpose it to the color box?

I guess my problem is not how to use TGaxis, but more how to implement it with the color box drawn from COLZ.

What is really this color box anyway, is it considered an axis? How do you customize it in general?

Thanks again!

It is a static function just do

TGaxis::SetMaxDigits(2);