TH2Poly first bin missing

I am using the new histogram type TH2Poly. I defined several bins with the addbin-function. Then I defined a TH2D histogram, filled both histograms and plotted them. First TH2D, then TH2Poly (“TEXT SAME”) (It doesn’t matter if I use “same” or just overdraw it).
In the plot is always the first (first means first added) bin of TH2Poly missing and I don’t understand why. Can you tell me what I am doing wrong?

Thanks, Verena

Can you provide a small example showing this problem ?

I am very sorry, but I described the wrong part of my program. As I created an example I found out, that another part creates the missing bin. It seems that I am doing something wrong when dividing two nearly identical histograms. Here is the code


TH2Poly* grid=new TH2Poly("grid", "grid", 0, 3.0, 0, 1.0);


TH2Poly* grid_help=(TH2Poly*)grid->Clone("grid_help");

grid->Fill(0.5, 0.5, 2);
grid->Fill(1.5, 0.5, 2);
grid->Fill(2.5, 0.5, 2);
grid_help->Fill(0.5, 0.5);
grid_help->Fill(1.5, 0.5);
grid_help->Fill(2.5, 0.5);


and the plot shows three bins, 0-1, 1-2, 2-3. The first two ones contain the number 2 and the last one is empty

I hope my explanation is now easier to understand!
Thank you again

I do not think Divide is working … in a general case it cannot work on TH2Poly

What do you mean with “not working”? it seems to me that it actually divides the figures and the results are correct. Is there a bigger problem behind that doesn’t appear to me?

If you look at he doc you will see that the Divide methods are inherited from TH1.
So they have not been implemented for TH2Poly.
It has not been implemented because Divide() can work only if the two histograms have the same binning.
Checking the binning is the same between two TH1 is easy but for TH2Poly it is more complex.
A loop on all the bins and bins vertices should be done. It is even more complex if you consider that 2 TH2Poly can be the same and have the bins in different orders…