void test(){ TCanvas *c44 = new TCanvas("c44","c44",200,10,600,400); double ax[] = {0, 1, 2, 3, 4}; double ay[] = {0, 2, 4, 1, 3}; double aexl[] = {0.1, 0.2, 0.3, 0.4, 0.5}; double aexh[] = {0.5, 0.4, 0.3, 0.2, 0.1}; double aeyl[] = {1, 0.5, 1, 0.5, 1}; double aeyh[] = {0.5, 1, 0.5, 1, 0.5}; TGraphAsymmErrors* gae = new TGraphAsymmErrors(5, ax, ay, aexl, aexh, aeyl, aeyh); gae->SetFillColor(2); gae->SetFillStyle(3001); gae->Draw("a2"); gae->Draw("p"); DrawExclusion(0.5,0.8,-1.5,5,3008,kBlue,"Ex1"); //c44->Modified(); //c44->Update(); DrawExclusion(3.2,3.5,-1.5,5,3008,kGreen,"Ex2"); c44->Update(); } TCutG* DrawExclusion (double Xlow, double Xhigh, double Ylow, double Yhigh, unsigned int fillStyle, unsigned int color,TString name){ TCutG* ExclusionZone = new TCutG(name.Data(),5); ExclusionZone->SetVarX(""); ExclusionZone->SetVarY(""); ExclusionZone->SetPoint(0,Xlow,Ylow); ExclusionZone->SetPoint(1,Xhigh,Ylow); ExclusionZone->SetPoint(2,Xhigh,Yhigh); ExclusionZone->SetPoint(3,Xlow,Yhigh); ExclusionZone->SetPoint(4,Xlow,Ylow); ExclusionZone->SetFillColor(color); ExclusionZone->SetFillStyle(fillStyle); ExclusionZone->Draw("F"); return ExclusionZone; }