TH2 Empty bins

Hi everybody,

I’ve searched in the forum but I’ve found no clear answer:

Is there a way to do not plot the empty bins of a TH2?

Thank you.

What kind of representation are you using ? lego ? box ? col ? surf ?
Which ROOT version are you using ?

Yes I forgot to tell that I want to use the SURF representation.

Of course empty bin are represented with a zero value and that generate false slopes in the graphe.

Your are not lucky. It is the only option not able to do that. In ROOT 5.18 we have introduced the option “0” which allows to do it for LEGO (see, but we have not done it for SURF.
SURF is more tricky because each cell is drawn by joining the center of 4 bins. If the 4 bins contain 0 I guess it should be easy to skip the drawing but what do you do if only 1 2 or 3 bins are empty ?

Not my lucky day…
Ok I’ll try with the lego option…

But I was wondering… Isn’t it possible to to draw the limit of the cell at the same hight if the neighbouring cell is empty?

Anyway thank you!

I can have a look.