本文整理汇总了C++中TCanvas::ResetAttPad方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::ResetAttPad方法的具体用法?C++ TCanvas::ResetAttPad怎么用?C++ TCanvas::ResetAttPad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCanvas
的用法示例。
在下文中一共展示了TCanvas::ResetAttPad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TCanvas
//.........这里部分代码省略.........
contLevel = m_contours["exp95"];
curv = (TGraph*)(contLevel->First());
for (int i=0; i<contLevel->GetSize(); i++) {
curv->SetLineColor(kGreen);
curv->SetLineWidth(2);
curv->SetLineStyle(9);
curv->Draw("SAME C");
if (!i) legend->AddEntry(curv,"Expected 95% C.L.","L");
curv=(TGraph *)(contLevel->After(curv));
}
cout << "Drawing expected 99%" << endl;
contLevel = m_contours["exp99"];
curv = (TGraph*)(contLevel->First());
for (int i=0; i<contLevel->GetSize(); i++) {
curv->SetLineColor(kRed);
curv->SetLineWidth(2);
curv->SetLineStyle(9);
curv->Draw("SAME C");
if (!i) legend->AddEntry(curv,"Expected 99% C.L.","L");
curv=(TGraph *)(contLevel->After(curv));
}
contLevel = m_contours["obs95"];
if (contLevel) {
cout << "Drawing obs95" << endl;
curv = (TGraph*)(contLevel->First());
for (int i=0; i<contLevel->GetSize(); i++) {
curv->Draw("SAME C");
curv->SetLineWidth(3);
if (!i) legend->AddEntry(curv,"Observed 95% C.L.","L");
curv=(TGraph *)(contLevel->After(curv));
}
}
TGraph *SMpoint = new TGraph(1);
SMpoint->SetPoint(1,0,0);
SMpoint->Draw("SAME P");
legend->AddEntry(SMpoint,"SM","P");
TGraph *bestfit = new TGraph(1);
bestfit->SetPoint(1,par1_bestfit,par2_bestfit);
bestfit->Draw("SAME *");
legend->AddEntry(bestfit,"Best fit value","P");
//smLabel = TPaveText(0,
// m_contours["-2s"]->GetYaxis()->GetXmax()/8,
// m_contours["-2s"]->GetXaxis()->GetXmax()/3->5,
// -m_contours["-2s"]->GetYaxis()->GetXmax()/8);
//smLabel->SetFillStyle(0);
//smLabel->SetBorderSize(0);
//smLabel->AddText(" SM");
//smLabel->Draw();
legend->Draw();
TPaveText *text = new TPaveText(0.566,0.89,0.965,1.13,"NDC");
text->SetFillStyle(0);
text->SetBorderSize(0);
text->SetTextFont(42);
text->SetTextSize(0.05);
//text->AddText(Form("95%% CL Limit on %s and %s",par2latex(par1).Data(),par2latex(par2).Data()));
text->AddText(0,0.35,Form("2.3 fb^{-1} (%d TeV)",beamcometev));
text->Draw();
// text2 = TPaveText(0.155,0.199,0.974,0.244,"NDC");
// text2->SetFillStyle(0);
// text2->SetBorderSize(0);
// text2->AddText("Values outside contour excluded");
// text2->Draw();
//text3 = TPaveText(0.506,0.699,0.905,0.758,"NDC");
//text3->SetFillStyle(0);
//text3->SetBorderSize(0);
//text3->AddText(options.flavorText);
//text3->Draw();
gPad->SetGrid(1,1);
finalPlot->RedrawAxis();
finalPlot->ResetAttPad();
finalPlot->Update();
finalPlot->Draw();
finalPlot->Update();
finalPlot->Modified();
finalPlot->Update();
finalPlot->Print(Form("%s.pdf",plotprefix.Data()));
finalPlot->Print(Form("%s.eps",plotprefix.Data()));
//finalPlot->Print(Form("%s.png",plotprefix.Data()));
} // draw2DlimitContours