Hi,
I have a 2D graph and I am trying to draw a transparent plane at z = 9.2.
I defined the plane as a TF2 object with the equation (0x + 0y + 9.2). The problem is, the plane is always drawn at z = 8.85, no matter what I set instead of “9.2”.
And also I don’t know how to make the plane transparent.
Thanks,
Here is my code:
{
TCanvas c1(“c1”, “Number of Events”, 1400, 1000); c1.SetTickx(1); c1.SetTicky(1); //c1.SetLogy();
Double_t xxx[9] = {8.375, 8.5, 8.625, 8.750, 8.875, 9, 9.125, 9.250, 9.375};
Double_t yyx[9] = {12, 10, 8, 7, 6, 5, 4, 2, 1};
Double_t Sig[9] = {42, 40, 38, 37, 36, 35, 34, 32, 31};
TGraph2D *g = new TGraph2D(9,Sig, yyx, xxx);
//g->SetTitle(“L=3000/fb”);
g->GetZaxis()->SetTitle(“M (TeV)”);
g->GetXaxis()->SetTitle(“Significance”);
g->GetYaxis()->SetTitle(“Number of Events”);
g->GetYaxis()->SetTitleOffset(2);
g->GetXaxis()->SetTitleOffset(2);
g->GetZaxis()->SetTitleOffset(1.4);
g->GetYaxis()->CenterTitle(kTRUE);
g->GetXaxis()->CenterTitle(kTRUE);
g->SetMarkerStyle(21);
g->SetMarkerSize(1.5);
g->SetMarkerColor(kBlue);
g->SetLineWidth(2);
TF2 myPlane = new TF2(“myPlane”,"0x + 0*y + 9.2");
myPlane->SetNpy(200);
myPlane->SetNpx(200);
myPlane->SetLineColorAlpha(kBlack, 0.0001);
g->Draw(“P”);
c1.Update();
myPlane->Draw(“surf1 same”);
c1.SaveAs(“ques.png”);
}