TH2 "COLZ" out of range bins

Hello,
Over the years I’ve seen the change in behaviour of the draw option for TH2 “colz”, and I am wondering if this feature already exists.

Suppose I have
TH2I* blah= new TH2I(~~~);
/
blah->SetBinContent(some_x,some_y,some_content);
/
blah->SetMaximum(some_max_int);
blah->SetMaximum(some_min_int);
blah->Draw(“colz”);

Now, I’ve hard coded some_max_int and some_min_int. The colour palette shows that near the minimum the colour should be blue
and near the maximum the colour should be red or yellow (depending on ROOT version).

Now, I want the

  1. bins those have larger value than some_max_int to appear red/yellow,
  2. bins that have smaller value than some_min_int to appear blue.

Right now, I can observe that 1. is part of the default gStyle. but I am wondering how to force 2. without “min-filling” the bins with smaller content.

I would appreciate any input.
Thank you.
-SJL


_ROOT Version: 6.16 && 5.36
Platform: Not Provided
Compiler: Not Provided


The option “col0z” does that

1 Like

This seems to work perfectly fine in Root 6, but not so much for ROOT5. Is there a way to force col0z formatting in ROOT5?
Thank you.

No, ROOT 5 is very old now.

Great,
Thank you for letting me know.

It was due to a typo, please disregard.

Now, here’s another “fun” part. I can’t seem to set maximum correctly with “col0z” option. Is there a way to enable it? I am talking about ROOT6.

I cannot reproduce this . Do you have a set of commands reproducing this effect ?

Sorry, this was due to a typo. My mistake.

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