# TGraph question

Dear experts,

a (rather strange) question about how TGraph works if anyone can help. So looking here:
cern.ch/go/BK6k. We have:

Case 0) which is a 2D histogram but we fill it with values between 0 and 1.0 (the values are a 95% exp. U.L contour if you’re wondering).
Case 1) which is the histogram above but we draw a contour between 0 and 1 using a TGraph (exact code is labelled under “CODE SNIPPET”)
Case 2) which is a 2D histogram of 1. / 2Dhistovalue now (the inverse of case 0) but now plot from 1e6 to 1 (exact code again is labelled under “CODE SNIPPET”)

So aside from asking “why are you comparing these two cases in the first place?”, my questions were:

1. Is it understood why Case 1 and 2 are different (I’d expect them to be the same)? It’s negligibly different at high masses but noticibly different when the 2Dhisto has holes (case 2 draws smaller holes compared to case 1 as you can tell).

2. Would you recommend using Case 1 or 2 when making a contour plot (or in fact neither of them)?

Thanks,
Michael

note that the contours must be defined in increasing order like in the following example:

``````{
h1  = new TH2F("h1","h1",40,-4,4,40,-4,4);
Float_t px, py;

gRandom->SetSeed();

for (Int_t i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
h1->Fill(px,py);
}

TCanvas* c1 = new TCanvas("c1","Contour",100,100,600,600);
h1->SetContour(3);
h1->SetContourLevel(0,4.0);
h1->SetContourLevel(1,4.5);
h1->SetContourLevel(2,8.5);
h1->Draw("cont1");
}``````