when I set the SetLogz() for a canvas with a TH2, I noticed the minimum of the z-axis of the histogram can go much lower than needed. This is pretty bad as it shrinks (from below) the possible color range for the bins. So I wrote a small function that takes a histogram, scans over all bins and finds the one with min bin content (zero content does not count). I’m aware about the GetMinimum() function, but it accounts for non-filled bins and returns 0 in most of my cases. Here is the function:
Yes, and I use my function to figure out what new minimum I should use. It’s 1 for this case clearly, but sometimes it’s not that easy to figure out. Anyway, Wile_E_Coyote suggested a better solution below.