Hi,

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:

```
Double_t getNextToMinimumBinContent(TH2* histo)
{
Double_t tempMin = 999.;
if (histo)
{
for (Int_t binx = 0; binx<=histo->GetNbinsX(); binx++)
{
for (Int_t biny = 0; biny<=histo->GetNbinsY(); biny++)
{
if (histo->GetBinContent(binx, biny) <= tempMin && histo->GetBinContent(binx, biny) > 1e-50)
tempMin = histo->GetBinContent(binx, biny);
}
}
}
return tempMin;
}
```

Its usage is trivial:

```
some_2D_histogram->SetMinimum(getNextToMinimumBinContent(some_2D_histogram));
```

I think it’d be great if this was the default behaviour.