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


C++ TPaletteAxis::SetBorderSize方法代码示例

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


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

示例1: PlotRakeBunch


//.........这里部分代码省略.........
  hP1X1->GetZaxis()->SetLabelSize(0.05);
  hP1X1->GetZaxis()->SetTitleSize(0.04);
  hP1X1->GetZaxis()->SetTitleFont(42);

  hP1X1->Draw("colzsame");
  // hP1X1->SetContour(20);
  // hP1X1->Draw("contzsame");
  // hP1X1prof->SetMarkerStyle(1);
  // hP1X1prof->SetLineWidth(2);
  // hP1X1prof->Draw("zsame");

  //hP1->Draw("C");
  
  gPad->Update();

  TPaletteAxis *palette = (TPaletteAxis*)hP1X1->GetListOfFunctions()->FindObject("palette");
  if(palette) {
    Float_t y1 = gPad->GetBottomMargin();
    Float_t y2 = 1 - gPad->GetTopMargin();
    Float_t x1 = 1 - gPad->GetRightMargin();
    palette->SetY2NDC(y2 - 0.04);
    palette->SetY1NDC(y1 + 0.04);
    palette->SetX1NDC(x1 + 0.01);
    palette->SetX2NDC(x1 + 0.04);
    
    palette->SetLabelFont(42);
    
    palette->SetLabelSize(0.08);
    //palette->SetLabelOffset(0.005/vfactor);
    palette->SetTitleSize(0.10);
    //    palette->SetTitleOffset(9999.0*vfactor);
    palette->SetTitleOffset(0.6);
    
    palette->SetBorderSize(2);
    palette->SetLineColor(1);
  }


  textTime->Draw();
  textInfo->Draw();
  // textCharge->Draw();
  textMom->Draw();
   
  gPad->RedrawAxis(); 

  // Bottom plot -----------------------------------------

  C->cd();

  pad[0]->Draw();
  pad[0]->cd();

  hFrame[0]->GetYaxis()->SetRangeUser(0.0,1.1*yMax);
  hFrame[0]->Draw();
    

  hX1->SetLineWidth(2);
  hX1->SetFillStyle(1001);
  hX1->SetFillColor(PlasmaGlob::elecFill);
  // hX1->SetLineColor(kBlue);
  hX1->Draw("FL same");
  //hX1->Draw("C");

  TLine lZmean2(xmean,0.0,xmean,1.1*yMax);
  lZmean2.SetLineColor(kGray+2);
  lZmean2.SetLineStyle(2);
开发者ID:delaossa,项目名称:ptools,代码行数:67,代码来源:PlotRakeBunch.130712.C

示例2: PlotChargeFieldFocus2D


//.........这里部分代码省略.........
  
  if(opt.Contains("1dline")) {
    lineYzero->Draw();
    lineYdown->Draw();
    lineYup->Draw();
  }

  if(zStartPlasma>xmin && zStartPlasma<xmax)
    lineStartPlasma->Draw();
  if(zStartNeutral>xmin && zStartNeutral<xmax)
    lineStartNeutral->Draw();
  if(zEndNeutral>xmin && zEndNeutral<xmax)
    lineEndNeutral->Draw();
  
  pad[0]->Update();
  TPaletteAxis *palette = NULL;
  for(Int_t i=0;i<Nspecies;i++) {
    
    if(!hDen2D[i]) continue;
    palette = (TPaletteAxis*) hDen2D[i]->GetListOfFunctions()->FindObject("palette");
    if(!palette) continue;

    Float_t y1 = gPad->GetBottomMargin();
    Float_t y2 = 1 - gPad->GetTopMargin();
    Float_t x1 = gPad->GetLeftMargin();
    Float_t x2 = 1 - gPad->GetRightMargin();
    palette->SetY2NDC( (i+1)*(y2-y1)/Nspecies + y1);
    palette->SetY1NDC( i*(y2-y1)/Nspecies + y1);
    palette->SetX1NDC(x2 + 0.005);
    palette->SetX2NDC(x2 + 0.03);
    palette->SetTitleOffset(0.65);
    palette->SetTitleSize(0.07);
    palette->SetLabelSize(0.065);
    palette->SetBorderSize(2);
    palette->SetLineColor(1);
  
  }


  // 1D charge density plots:
  Float_t yaxismin  =  pad[0]->GetUymin();
  Float_t yaxismax  =  pad[0]->GetUymin() + 0.33*(pad[0]->GetUymax() - pad[0]->GetUymin()) - 0.00;
  
  //  Float_t denmin = (0.1001) * density;
  Float_t denmin = gMin;
  Float_t denmax = gMax;
  if(opt.Contains("logz")) {
    denmin = TMath::Log10(denmin);
    denmax = TMath::Log10(denmax);
  }
  
  for(Int_t i=0;i<Nspecies;i++) {
    if(!hDen1D[i]) continue;
    
    Float_t slope = (yaxismax - yaxismin)/(denmax - denmin);
    
    for(Int_t j=0;j<hDen1D[i]->GetNbinsX();j++) {
      Float_t content = hDen1D[i]->GetBinContent(j+1);
      if(opt.Contains("logz")) content = TMath::Log10(content); 
      
      if(content<denmin) 
	hDen1D[i]->SetBinContent(j+1,yaxismin);
      else 
	hDen1D[i]->SetBinContent(j+1,(content - denmin) * slope + yaxismin);
    }    
开发者ID:delaossa,项目名称:ptools,代码行数:66,代码来源:PlotChargeFieldFocus2D.130705.C

示例3: PlotRakeInjection


//.........这里部分代码省略.........
  
    hFrame[k]->Draw("axis");    
  


    exPlasma->Draw();

    // Sum of histograms!
    hDen2D[k][0]->Add(hDen2D[k][1]);
        
    //    hDen2D[k][0]->GetZaxis()->SetRangeUser(Min[1],Max[1]);
 
    hDen2D[k][0]->Draw("colz same");
    
    pad[k]->Update();
    TPaletteAxis *palette = (TPaletteAxis*)hDen2D[k][0]->GetListOfFunctions()->FindObject("palette");
    
    Float_t y1 = pad[k]->GetBottomMargin();
    Float_t y2 = 1 - pad[k]->GetTopMargin();
    Float_t x1 = pad[k]->GetLeftMargin();
    Float_t x2 = 1 - pad[k]->GetRightMargin();
    palette->SetY2NDC(y2 - 1*(y2-y1)/2.0 - 0.00);
    palette->SetY1NDC(y1 + 0*(y2-y1)/2.0 + 0.00);
    palette->SetX1NDC(x2 + 0.005);
    palette->SetX2NDC(x2 + 0.03);

    palette->SetLabelFont(42);

    palette->SetLabelSize(0.03/vfactor);
    palette->SetLabelOffset(-0.004);
    palette->SetTitleSize(0.03/vfactor);
    palette->SetTitleOffset(9999.0*vfactor);
  
    palette->SetBorderSize(2);
    palette->SetLineColor(1);
  
    exHot->Draw();
    hDen2D[k][2]->Draw("colz same");

    pad[k]->Update();
    palette = (TPaletteAxis*)hDen2D[k][2]->GetListOfFunctions()->FindObject("palette");
    
    palette->SetY2NDC(y2 - 0*(y2-y1)/2.0 - 0.00);
    palette->SetY1NDC(y1 + 1*(y2-y1)/2.0 + 0.00);
    palette->SetX1NDC(x2 + 0.005);
    palette->SetX2NDC(x2 + 0.03);

    palette->SetLabelFont(42);

    palette->SetLabelSize(0.03/vfactor);
    palette->SetLabelOffset(-0.004);
    palette->SetTitleSize(0.03/vfactor);
    palette->SetTitleOffset(9999.0*vfactor);

    palette->SetBorderSize(2);
    palette->SetLineColor(1);

    textTime[k] = new TPaveText(x2-0.17,y2-(0.05/vfactor),x2-0.02,y2-0.04,"NDC"); 
    PlasmaGlob::SetPaveTextStyle(textTime[k],32); 
    char ctext[128];
    if(opt.Contains("units")) 
      sprintf(ctext,"z = %5.0f #mum", skindepth * Time[k] / PUnits::um);
    else
      sprintf(ctext,"z = %5.1f #omega_{p}^{-1}",Time[k]);
    textTime[k]->AddText(ctext);
    textTime[k]->Draw();
开发者ID:delaossa,项目名称:ptools,代码行数:67,代码来源:PlotRakeInjection.C

示例4: PlotEvolutionsWIII


//.........这里部分代码省略.........
    } else {
      pad[ip]->SetLogz(0);
    }

    hFrame[ip]->Draw("col");

    //  hDen1DvsTime->GetZaxis()->SetNdivisions(503);
    hDen1DvsTime->GetZaxis()->SetTitleFont(fonttype);
    Float_t xFactor = pad[0]->GetAbsWNDC()/pad[ip]->GetAbsWNDC();
    Float_t yFactor = pad[0]->GetAbsHNDC()/pad[ip]->GetAbsHNDC();
    hDen1DvsTime->GetZaxis()->SetTickLength(xFactor*tylength/yFactor);
    
    exElec->Draw();
    hDen1DvsTime->Draw("colz same");

    pad[ip]->Update();
  
    y1 = pad[ip]->GetBottomMargin();
    y2 = 1 - pad[ip]->GetTopMargin();
    x1 = pad[ip]->GetLeftMargin();
    x2 = 1 - pad[ip]->GetRightMargin();
  
    palette = (TPaletteAxis*) hDen1DvsTime->GetListOfFunctions()->FindObject("palette");  
    if(palette) {
      palette->SetY2NDC(y2 - gap);
      palette->SetY1NDC(y1 + gap);
      palette->SetX1NDC(x2 + 0.005);
      palette->SetX2NDC(x2 + 0.03);
      palette->SetTitleOffset(tzoffset);
      palette->SetTitleSize(tzsize);
      palette->SetLabelFont(fonttype);
      palette->SetLabelSize(lzsize);
      palette->SetLabelOffset(lyoffset);
      palette->SetBorderSize(2);
      palette->SetLineColor(1);
    }
   
    pad[ip]->RedrawAxis(); 

    ip--;
    C->cd(0);
    
  }

  if(mask & 0x2) {

    pad[ip]->Draw();
    pad[ip]->cd(); 
    if(opt.Contains("logz")) {
      pad[ip]->SetLogz(1);
    } else {
      pad[ip]->SetLogz(0);
    }

    hFrame[ip]->Draw("col");

    //  hRmsvsTime->GetZaxis()->SetNdivisions(503);
    hRmsvsTime->GetZaxis()->SetTitleFont(fonttype);
    Float_t xFactor = pad[0]->GetAbsWNDC()/pad[ip]->GetAbsWNDC();
    Float_t yFactor = pad[0]->GetAbsHNDC()/pad[ip]->GetAbsHNDC();
    hRmsvsTime->GetZaxis()->SetTickLength(xFactor*tylength/yFactor);
    
    exElec->Draw();
    hRmsvsTime->Draw("colz same");

    pad[ip]->Update();
开发者ID:delaossa,项目名称:ptools,代码行数:67,代码来源:PlotEvolutionsWIII.C

示例5: PlotPotential2D


//.........这里部分代码省略.........
            lineStartNeutral->Draw();
        if(zEndNeutral>xmin && zEndNeutral<xmax)
            lineEndNeutral->Draw();
    }

    // lineYdown->Draw();
    // lineYup->Draw();

    // Palettes re-arrangement
    pad[0]->Update();
    Float_t y1 = pad[0]->GetBottomMargin();
    Float_t y2 = 1 - pad[0]->GetTopMargin();
    Float_t x1 = pad[0]->GetLeftMargin();
    Float_t x2 = 1 - pad[0]->GetRightMargin();

    TPaletteAxis *palette = NULL;
    if(Nspecies>=3) {
        if(hDen2D[2]) {
            palette = (TPaletteAxis*)hDen2D[2]->GetListOfFunctions()->FindObject("palette");
        }
    }
    if(palette) {
        palette->SetY2NDC(y2 - 0.00);
        palette->SetY1NDC(0.66*(y1+y2) + 0.00);
        palette->SetX1NDC(x2 + 0.005);
        palette->SetX2NDC(x2 + 0.03);
        //  palette->SetTitleFont(42);
        //  palette->SetTitleOffset(0.85);
        palette->SetTitleOffset(999.9);
        palette->SetTitleSize(0.075);
        palette->SetLabelFont(42);
        palette->SetLabelSize(0.075);
        palette->SetLabelOffset(0.001);
        palette->SetBorderSize(2);
        palette->SetLineColor(1);
    }

    palette = (TPaletteAxis*)hDen2D[0]->GetListOfFunctions()->FindObject("palette");
    if(palette) {
        palette->SetY2NDC(0.66*(y1+y2) - 0.00);
        palette->SetY1NDC(0.33*(y1+y2) + 0.00);
        palette->SetX1NDC(x2 + 0.005);
        palette->SetX2NDC(x2 + 0.03);
        // palette->SetTitleFont(42);
        palette->SetTitleOffset(0.80);
        palette->SetTitleSize(0.075);
        palette->SetLabelFont(42);
        palette->SetLabelSize(0.075);
        palette->SetLabelOffset(0.001);
        palette->SetBorderSize(2);
        palette->SetLineColor(1);
    }

    palette = (TPaletteAxis*)hDen2D[1]->GetListOfFunctions()->FindObject("palette");
    if(palette) {
        palette->SetY2NDC(0.33*(y1+y2) - 0.00);
        palette->SetY1NDC(y1 + 0.00);
        palette->SetX1NDC(x2 + 0.005);
        palette->SetX2NDC(x2 + 0.03);
        //palette->SetTitleFont(42);
        //palette->SetTitleOffset(0.85);
        palette->SetTitleOffset(999.9);
        palette->SetTitleSize(0.075);
        palette->SetLabelFont(42);
        palette->SetLabelSize(0.075);
        palette->SetLabelOffset(0.001);
开发者ID:delaossa,项目名称:ptools,代码行数:67,代码来源:PlotPotential2D.C

示例6: PlotField2D


//.........这里部分代码省略.........
  // Define the frames for plotting
  Int_t fonttype = 43;
  Int_t fontsize = 28;
  Int_t tfontsize = 30;
  Float_t txoffset = 1.3;
  Float_t lxoffset = 0.02;
  Float_t tyoffset = 1.0;
  Float_t lyoffset = 0.01;
  Float_t tylength = 0.02;
  Float_t txlength = 0.04;

  TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame");
  if(hFrame) delete hFrame;
  hFrame = (TH2F*) hE2D[index]->Clone("hFrame");
  hFrame->Reset();

  // Format for y axis
  hFrame->GetYaxis()->SetTitleFont(fonttype);
  hFrame->GetYaxis()->SetTitleSize(tfontsize);
  hFrame->GetYaxis()->SetTitleOffset(tyoffset);
  hFrame->GetYaxis()->SetLabelFont(fonttype);
  hFrame->GetYaxis()->SetLabelSize(fontsize);
  hFrame->GetYaxis()->SetLabelOffset(lyoffset);

  hFrame->GetYaxis()->SetTickLength(tylength);

  // Format for x axis
  hFrame->GetXaxis()->SetTitleFont(fonttype);
  hFrame->GetXaxis()->SetTitleSize(tfontsize+2);
  hFrame->GetXaxis()->SetTitleOffset(txoffset);
  hFrame->GetXaxis()->SetLabelFont(fonttype);
  hFrame->GetXaxis()->SetLabelSize(fontsize+2);
  hFrame->GetXaxis()->SetLabelOffset(lxoffset);
    
  hFrame->GetXaxis()->SetTickLength(txlength);      

  hFrame->Draw("col");            
 
  //  hE2D[index]->GetZaxis()->SetNdivisions(505);  
  hE2D[index]->GetZaxis()->SetTitleFont(fonttype);
  hE2D[index]->Draw("colz same");
    
  // Re-touchs
  gPad->Update();

  Float_t y1 = gPad->GetBottomMargin();
  Float_t y2 = 1 - gPad->GetTopMargin();
  Float_t x1 = gPad->GetLeftMargin();
  Float_t x2 = 1 - gPad->GetRightMargin();
  Float_t gap = 0.005;  

  TPaletteAxis *palette = (TPaletteAxis*)hE2D[index]->GetListOfFunctions()->FindObject("palette");
  if(palette) {
    palette->SetY2NDC(y2 - gap);
    palette->SetY1NDC(y1 + gap);
    palette->SetX1NDC(x2 + 0.005);
    palette->SetX2NDC(x2 + 0.03);
    palette->SetTitleOffset(tyoffset);
    palette->SetTitleSize(tfontsize);
    palette->SetLabelFont(fonttype);
    palette->SetLabelSize(fontsize);
    if(opt.Contains("logz")) 
      palette->SetLabelOffset(0);
    else
      palette->SetLabelOffset(lyoffset);
    palette->SetBorderSize(2);
    palette->SetLineColor(1);
  }
 
  
  // Text objects
  TPaveText *textTime = new TPaveText(xMax - 0.30*xRange, yMax-0.10*yRange, xMax-0.02*xRange, yMax-0.02*yRange);
  PGlobals::SetPaveTextStyle(textTime,32); 
  char ctext[128];
  if(opt.Contains("units") && n0) 
    sprintf(ctext,"z = %5.1f #mum", Time * skindepth / PUnits::um);
  else
    sprintf(ctext,"#omega_{p} t = %5.1f",Time);
  textTime->AddText(ctext);
  
  TPaveText *textDen = new TPaveText(xMin + 0.02*xRange, yMax-0.10*yRange, xMin + 0.40*xRange, yMax-0.02*yRange);
  PGlobals::SetPaveTextStyle(textDen,12); 
  textDen->SetTextColor(kOrange+10);
  if(opt.Contains("units") && n0) {
    sprintf(ctext,"n_{0} = %5.2f x 10^{17} / cm^{3}", 1e-17 * n0 * PUnits::cm3);
    textDen->AddText(ctext);
    textDen->Draw();
  }
  
  textTime->Draw();
  
  gPad->RedrawAxis(); 

  C->cd();

  // Print to a file
  PGlobals::imgconv(C,fOutName,opt);
  // ---------------------------------------------------------

}
开发者ID:delaossa,项目名称:ptools,代码行数:101,代码来源:PlotField2D.C


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