本文整理汇总了C++中TPaveStats::SetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveStats::SetTextSize方法的具体用法?C++ TPaveStats::SetTextSize怎么用?C++ TPaveStats::SetTextSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveStats
的用法示例。
在下文中一共展示了TPaveStats::SetTextSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeNiceStatBox
void MakeNiceStatBox(TH1* histo){
TObject *statObj;
TPaveStats *stats;
statObj = histo->GetListOfFunctions()->FindObject("stats");
stats= static_cast<TPaveStats*>(statObj);
stats->SetFillColor(10);
stats->SetLineWidth(1);
stats->SetShadowColor(0);
stats->SetTextFont(42);
stats->SetTextSize(0.05);
//stats->SetLineColor(LineColors);
//stats->SetTextColor(LineColors);
stats->SetX1NDC(0.615);
stats->SetY1NDC(0.747);
stats->SetX2NDC(0.979);
stats->SetY2NDC(0.986);
}
示例2: DrawAllHistos
//.........这里部分代码省略.........
TDirectory *stardir = gDirectory;
TObject *thesourcedir;
TIter nextdir(stardir->GetListOfKeys());
while((thesourcedir=nextdir())){
TString dirName = thesourcedir->GetName();
stardir->cd(dirName);
TDirectory *current_sourcedir = gDirectory;
TH1::AddDirectory(kFALSE);
std::cout << "*************************" <<std::endl;
std::cout << "Reading Directory: " << dirName <<std::endl;
TObject *obj;
TIter next(current_sourcedir->GetListOfKeys());
while ((obj=next())) {
TString objName =obj->GetName();
if(objName.Contains("pfx")) continue;
if (objName.Contains("h2") && !objName.Contains("pfx")) {
//std::cout << "Reading: " << obj->GetName() <<std::endl;
TH2F* h2 = (TH2F*)file->Get(dirName+"/"+objName);
h2->SetName(objName+dirName);
h2vec.push_back(h2);
TCanvas *c = new TCanvas(h2->GetName(),h2->GetName(),800,600);
c->cd();
gPad->SetTopMargin(0.08);
gPad->SetRightMargin(0.15);
h2->SetStats(kFALSE);
h2->Draw("colz");
c->Draw();
c->cd();
TProfile *hpfx_tmp = (TProfile*) h2->ProfileX("_pfx",1,-1,"o");
hpfx_tmp->SetStats(kFALSE);
//hpfx_tmp->SetMarkerColor(kBlack);
hpfx_tmp->SetMarkerColor(kRed);
hpfx_tmp->SetMarkerSize(1.2);
hpfx_tmp->SetMarkerStyle(20);
hpfx_tmp->Draw("psame");
c->Draw();
cmsPrel(60.,sa,sb, isMC);
TString canvName = h2->GetName();
c->cd()->SetLogz();
c->SaveAs(canvName+"."+format);
} else {
TH1F* h1 = (TH1F*)file->Get(dirName+"/"+objName);
h1->SetName(objName+dirName);
h1vec.push_back(h1);
TCanvas *c = new TCanvas(h1->GetName(),h1->GetName(),600,600);
c->cd()->SetLogy();
h1->SetMarkerColor(kBlack);
h1->SetMarkerStyle(20);
h1->SetLineWidth(1.5);
h1->SetFillColor(393);
//h1->SetFillStyle(3005);
h1->Draw("hist");
h1->Draw("e1same");
c->Draw();
TObject *statObj;
TPaveStats *stats;
statObj = h1->GetListOfFunctions()->FindObject("stats");
stats= static_cast<TPaveStats*>(statObj);
stats->SetFillColor(10);
stats->SetLineWidth(1);
stats->SetShadowColor(0);
stats->SetTextFont(42);
stats->SetTextSize(0.025);
//stats->SetLineColor(LineColors);
//stats->SetTextColor(LineColors);
stats->SetX1NDC(0.75);
stats->SetY1NDC(0.72);
stats->SetX2NDC(0.97);
stats->SetY2NDC(0.92);
stats->Draw("same");
cmsPrel(60.,sa,sb,isMC);
TString canvName = h1->GetName();
c->SaveAs(canvName+"."+format);
}
}
}
}
示例3: fixStats
void fixStats()
{
TH1* ratioHist = (TH1*) gROOT->FindObject("data");
TPaveStats* stats = (TPaveStats*) ratioHist->FindObject("stats");
if(stats)stats->SetTextSize(0.040209);
}