当前位置: 首页>>代码示例>>C++>>正文


C++ TPaveLabel::SetTextSize方法代码示例

本文整理汇总了C++中TPaveLabel::SetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveLabel::SetTextSize方法的具体用法?C++ TPaveLabel::SetTextSize怎么用?C++ TPaveLabel::SetTextSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPaveLabel的用法示例。


在下文中一共展示了TPaveLabel::SetTextSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EpEd

void EpEd()
{
  TCanvas *c1 = new TCanvas("c1","multipads",700,700);
  gStyle->SetPadBorderMode(0);
  gStyle->SetOptStat(0);
  gStyle->SetOptTitle(0);
  gStyle->SetFrameLineWidth(1);

  c1->Divide(1,2,0.001,0.000001);


  c1->cd(1);

  gPad->SetTopMargin(0.2);
  gPad->SetBottomMargin(0.0);
  gPad->SetRightMargin(0.15);
  /// Near site
  {
    TFile f("../../data/Sample/P12e_1.5MeV/H/Near.root");
    
    h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
    h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);
    //h2dAccSum->GetZaxis()->SetRangeUser(-20,1.5308177e+03);

    h2dAccSum->GetYaxis()->SetLabelSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
    h2dAccSum->GetZaxis()->SetLabelSize(0.05);
    h2dAccSum->GetZaxis()->SetTitleSize(0.05);

    //h2dAccSum->SetMinimum(0);
    // What is this principle?
    h2dAccSum->DrawCopy("col");
    TExec *ex1 = new TExec("ex1","Pal1();");
    ex1->Draw();
    h2dAccSum->SetContour(500);
    h2dAccSum->DrawCopy("colz same");
    h2dAccSum->DrawCopy("same axis");    


    // top frame is blocked. Now redraw it.
    TLine *line = new TLine;
    line->DrawLine(1.3,10.6, 10.1,10.6);
    line->DrawLine(10.1,10.6, 10.1,1.3);

    TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Near site");
    label->SetFillColor(0);
    label->SetShadowColor(0);
    label->SetTextSize(0.5);
    label->Draw();

    f.Close();
  }

  c1->cd(2);
  gPad->SetTopMargin(0.0);
  gPad->SetRightMargin(0.15);
  gPad->SetBottomMargin(0.2);
  /// Far site
  {
    TFile ff("../../data/Sample/P12e_1.5MeV/H/EH3.root");
    
    h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
    h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);

    h2dAccSum->GetXaxis()->SetLabelSize(0.06);
    h2dAccSum->GetXaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetLabelSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
    h2dAccSum->GetZaxis()->SetLabelSize(0.05);
    h2dAccSum->GetZaxis()->SetTitleSize(0.05);

    // What is this principle?
    h2dAccSum->DrawCopy("col");
    TExec *ex2 = new TExec("ex2","Pal2();");
    ex2->Draw();
    h2dAccSum->SetContour(500);
    h2dAccSum->DrawCopy("same colz");
    h2dAccSum->DrawCopy("same axis");

    // top frame is blocked. Now redraw it.
    TLine *line = new TLine;
    line->DrawLine(1.3,10.6, 10.1,10.6);
    line->DrawLine(10.1,10.6, 10.1,1.3);

    TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Far site");
    label->SetFillColor(0);
    label->SetShadowColor(0);
    label->SetTextSize(0.5);
    label->Draw();
    ff.Close();
  }

}
开发者ID:zhangzc11,项目名称:CPTV,代码行数:95,代码来源:EpEd.C

示例2: drawValueBox

void drawValueBox(double x1, double x2, double x3, int colour)
{

  char optionfile[60];
  std::vector<double> options;
  
  double delta1(0.), delta2(0.), delta3(0.), delta4(0.);
  double tsize(0.7);

  sprintf(optionfile,"./config/drawValueBox.dat");
  
  readData(optionfile,options);
  delta1 = options[0];
  delta2 = options[1];
  delta3 = options[2];
  delta4 = options[3];
  tsize  = options[4];
  
  double xmin = x1 + delta1;
  double xmax = x1 + delta2;
  double ymin = x2 + delta3;
  double ymax = x2 + delta4;

  if ( x1 < 0 && x2 > 0) {
    xmin = x1 - delta1;
    xmax = x1 - delta2;
  } 
  else if ( x1 < 0 && x2 < 0) {
    xmin = x1 - delta1;
    xmax = x1 - delta2;
    ymin = x2 - delta3;
    ymax = x2 - delta4;
  }
  else if ( x1 > 0 && x2 < 0) {
    ymin = x2 - delta3;
    ymax = x2 - delta4;
  }
  else if ( x1 == 0.0 ) {
    xmin = xmin - delta1;
    xmax = xmax ;
  }
  else if ( x2 == 0.0 ) {
    ymin = ymin - delta3;
    ymax = ymax ;
  }
  else {}


  char label[10];
  sprintf(label,"%.1f",float(x3));

  TPaveLabel *box = new TPaveLabel(xmin,ymin,xmax,ymax,label);
  box->SetBorderSize(0);
  box->SetTextFont(42);
  box->SetTextSize(tsize);
  box->SetTextAlign(22);
  box->SetTextColor(colour);
  if (colour == 1) box->SetFillStyle(4000);
  else {
    box->SetFillColor(10);
    box->SetTextColor(colour);
    box->SetBorderSize(1);
  }
  box->Draw("same");
  
  TLine * ln = new TLine(x1,x2,xmin,ymin);
  ln->SetLineWidth(1);
  ln->SetLineStyle(1);
  ln->SetLineColor(14);
  ln->Draw("same");
  
}
开发者ID:andres0sorio,项目名称:CMSWork,代码行数:72,代码来源:Utilities.C

示例3: ClassTree

void ClassTree()
{

   TCanvas *ClassTree = new TCanvas("ClassTree", "",186,135,594,449);
   ClassTree->SetHighLightColor(2);
   ClassTree->Range(0,5,20,20);
   ClassTree->SetFillColor(33);
   ClassTree->SetBorderSize(2);
   TLine *line = new TLine(0.5,18.15,4.4,18.15);
   line->Draw();
   line = new TLine(4.4,17.725,4.4,18.575);
   line->Draw();
   
   TPaveLabel *pl = new TPaveLabel(1,17.895,4.205,18.405,"TArray","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,16.875,1,16.875);
   line->Draw();
   
   pl = new TPaveLabel(1,16.62,4.205,17.13,"TAttFill","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,16.025,1,16.025);
   line->Draw();
   
   pl = new TPaveLabel(1,15.77,4.205,16.28,"TAttLine","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,15.175,1,15.175);
   line->Draw();
   
   pl = new TPaveLabel(1,14.92,4.205,15.43,"TAttMarker","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,9.775,4.4,9.775);
   line->Draw();
   line = new TLine(4.4,7.65,4.4,12.325);
   line->Draw();
   
   pl = new TPaveLabel(1,9.52,4.205,10.03,"TObject","br");
   pl->SetFillColor(5);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,12.325,4.9,12.325);
   line->Draw();
   
   pl = new TPaveLabel(4.9,12.07,8.105,12.58,"AliArrayI","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,11.475,4.9,11.475);
   line->Draw();
   
   pl = new TPaveLabel(4.9,11.22,8.105,11.73,"AliArrayS","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,18.575,4.9,18.575);
   line->Draw();
   
   pl = new TPaveLabel(4.9,18.32,8.105,18.83,"TArrayI","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,17.725,4.9,17.725);
   line->Draw();
   
   pl = new TPaveLabel(4.9,17.47,8.105,17.98,"TArrayS","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,10.2,8.3,10.2);
   line->Draw();
   
   pl = new TPaveLabel(4.9,9.945,8.105,10.455,"TCollection","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,7.65,8.3,7.65);
   line->Draw();
   line = new TLine(8.3,6.8,8.3,8.075);
   line->Draw();
   
   pl = new TPaveLabel(4.9,7.395,8.105,7.905,"TNamed","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(8.3,8.075,12.2,8.075);
   line->Draw();
   
   pl = new TPaveLabel(8.8,7.82,12.005,8.33,"AliSegmentArray","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(8.3,10.2,12.2,10.2);
   line->Draw();
//.........这里部分代码省略.........
开发者ID:alisw,项目名称:AliRoot,代码行数:101,代码来源:ClassTree.C


注:本文中的TPaveLabel::SetTextSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。