本文整理汇总了C++中TGaxis::SetTitleSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TGaxis::SetTitleSize方法的具体用法?C++ TGaxis::SetTitleSize怎么用?C++ TGaxis::SetTitleSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGaxis
的用法示例。
在下文中一共展示了TGaxis::SetTitleSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TGaxis
ReverseXAxis (TGraphAsymmErrors *g, double size)
{
// Remove the current axis
g->GetXaxis()->SetLabelOffset(999);
g->GetXaxis()->SetTickLength(0);
// Redraw the new axis
gPad->Update();
g->GetYaxis()->SetTitle("Event Selection Efficiency");
TGaxis *newaxis = new TGaxis(gPad->GetUxmax(),
gPad->GetUymin(),
gPad->GetUxmin(),
gPad->GetUymin(),
g->GetXaxis()->GetXmin(),
g->GetXaxis()->GetXmax(),
510,"-");
newaxis->SetLabelOffset(-0.04);
newaxis->SetTitle("Centrality");
newaxis->SetTitleFont(42);
newaxis->SetTitleSize(size);
newaxis->SetLabelSize(size);
newaxis->CenterTitle();
newaxis->SetLabelFont(42);
newaxis->Draw();
}
示例2: plotPair
//==========================================
//==========================================
void plotPair(TH1F *h1,TH1F *h0 ) {
h1->Draw();
// edit fonts/sizes
TAxis *ax =h1->GetYaxis();
float ss=ax->GetTitleSize();
//printf("ss=%f\n",ss);
ax->SetTitleSize(2*ss);
ax->SetTitleOffset(0.5);
ax =h1->GetXaxis();
ax->SetTitleSize(1.5*ss);
ax->SetLabelSize(1.5*ss);
ax->SetTitleOffset(0.7);
// edit fonts/sizes DONE
gPad->Update();
//scale hint1 to the pad coordinates
Float_t rightmax = 1.1*h0->GetMaximum();
Float_t scale = gPad->GetUymax()/rightmax;
h0->Scale(scale);
h0->Draw("same");
//draw an axis on the right side
TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"-R");
int col=h0->GetLineColor();
axis->SetLineColor(col);
axis->SetTextColor(col);
axis->SetLabelColor(col);
axis ->SetTitle("LCP yield");
axis->SetTitleSize(2*ss);
axis->SetTitleOffset(.5);
axis->Draw();
TPaveStats *st =( TPaveStats *)gPad->GetPrimitive("stats");
st->SetX1NDC(0.35);
st->SetX2NDC(0.5);
st->SetY1NDC(0.7);
st->SetY2NDC(1.);
}
示例3: PlotPotential2D
//.........这里部分代码省略.........
TPaveText **textLabel = new TPaveText*[2];
C->cd(0);
char pname[16];
sprintf(pname,"pad_%i",1);
pad[0] = (TPad*) gROOT->FindObject(pname);
pad[0]->Draw();
pad[0]->cd(); // <---------------------------------------------- Top Plot ---------
if(opt.Contains("logz")) {
pad[0]->SetLogz(1);
} else {
pad[0]->SetLogz(0);
}
pad[0]->SetFrameLineWidth(3);
pad[0]->SetTickx(1);
// Re-range:
for(Int_t i=0; i<Nspecies; i++) {
if(!hDen2D[i]) continue;
hDen2D[i]->GetYaxis()->SetRangeUser(yMin -(factor-1)*yRange, yMax);
}
TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame1");
if(hFrame) delete hFrame;
hFrame = (TH2F*) hDen2D[0]->Clone("hFrame1");
hFrame->Reset();
hFrame->SetLabelFont(42,"xyz");
hFrame->SetTitleFont(42,"xyz");
hFrame->GetYaxis()->SetNdivisions(505);
hFrame->GetYaxis()->SetLabelSize(0.085);
hFrame->GetYaxis()->SetTitleSize(0.09);
hFrame->GetYaxis()->SetTitleOffset(0.7);
hFrame->GetYaxis()->SetTickLength(0.02);
hFrame->GetXaxis()->SetLabelOffset(999.);
hFrame->GetXaxis()->SetTitleOffset(999.);
hFrame->GetXaxis()->SetTickLength(0.04);
// Frame asymmetry:
hFrame->Draw("col");
// hDen2D[0]->GetZaxis()->SetNdivisions(505);
// Injected electrons if any
if(Nspecies>=3) {
if(hDen2D[2]) {
exHot->Draw();
hDen2D[2]->Draw("colz same");
}
}
// Plasma
hDen2D[0]->GetZaxis()->SetTitleFont(42);
exPlasma->Draw();
hDen2D[0]->Draw("colz same");
// Beam driver.
if(hDen2D[1]) {
// hDen2D[1]->GetZaxis()->SetNdivisions(505);
exElec->Draw();
hDen2D[1]->Draw("colz same");
}
示例4: PlotField1D
//.........这里部分代码省略.........
if(yEMaxPos[i][j]>maxPhase)
maxPhase = yEMaxPos[i][j];
if(yEMaxPos[i][j]<minPhase)
minPhase = yEMaxPos[i][j];
if(yEMaxValue[i][j]>maxField)
maxField = yEMaxValue[i][j];
if(yEMaxValue[i][j]<minField)
minField = yEMaxValue[i][j];
}
}
Float_t margin = (maxPhase - minPhase)/10;
gEMaxPos[0]->GetYaxis()->SetRangeUser(minPhase-margin,maxPhase+margin);
gEMaxPos[0]->GetYaxis()->CenterTitle();
gEMaxPos[0]->GetXaxis()->CenterTitle();
gEMaxPos[0]->SetLineColor(phaseC);
gEMaxPos[0]->SetMarkerColor(phaseC);
gEMaxPos[0]->SetLineWidth(3);
gEMaxPos[0]->SetMarkerStyle(20);
gEMaxPos[0]->SetMarkerSize(1.4);
gEMaxPos[0]->Draw("APC");
if(Nfields>1) {
gEMaxPos[1]->SetLineStyle(1);
gEMaxPos[1]->SetLineColor(phaseC);
gEMaxPos[1]->SetMarkerColor(phaseC);
gEMaxPos[1]->SetLineWidth(1);
gEMaxPos[1]->SetMarkerStyle(24);
gEMaxPos[1]->SetMarkerSize(1.4);
gEMaxPos[1]->Draw("PC");
}
// Emax value
// New axis first:
C->Update(); // Needed for the axis!
margin = (maxField - minField)/10;
if (margin==0) margin = 1;
Float_t rightmin = minField-margin;
Float_t rightmax = maxField+margin;
Float_t slope = (gPad->GetUymax() - gPad->GetUymin())/(rightmax-rightmin);
TGaxis *axisEmax = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),gPad->GetUxmax(),
gPad->GetUymax(),rightmin,rightmax,505,"+L");
axisEmax->SetLineWidth(1);
axisEmax->SetLineColor(fieldC);
axisEmax->SetLabelColor(fieldC);
axisEmax->SetTitleColor(fieldC);
if(opt.Contains("units") && n0)
axisEmax->SetTitle("E_{min} [GV/m]");
else
axisEmax->SetTitle("E_{min} [E_{0}]");
axisEmax->CenterTitle();
axisEmax->SetTitleSize(0.05);
axisEmax->SetTitleOffset(1.2);
axisEmax->SetLabelSize(0.05);
axisEmax->SetLabelOffset(0.006);
axisEmax->Draw();
// Adjust the TGraph
Double_t *x = gEMaxValue[0]->GetX();
Double_t *y = gEMaxValue[0]->GetY();
for(Int_t i=0;i<gEMaxValue[0]->GetN();i++) {
gEMaxValue[0]->SetPoint(i,x[i],(y[i]-rightmin)*slope + gPad->GetUymin());
}
gEMaxValue[0]->SetLineColor(fieldC);
gEMaxValue[0]->SetMarkerColor(fieldC);
gEMaxValue[0]->SetLineWidth(3);
gEMaxValue[0]->SetMarkerStyle(20);
gEMaxValue[0]->SetMarkerSize(1.4);
gEMaxValue[0]->Draw("PC");
if(Nfields>1) {
x = gEMaxValue[1]->GetX();
y = gEMaxValue[1]->GetY();
for(Int_t i=0;i<gEMaxValue[1]->GetN();i++) {
gEMaxValue[1]->SetPoint(i,x[i],(y[i]-rightmin)*slope + gPad->GetUymin());
}
gEMaxValue[1]->SetLineColor(fieldC);
gEMaxValue[1]->SetMarkerColor(fieldC);
gEMaxValue[1]->SetLineWidth(1);
gEMaxValue[1]->SetMarkerStyle(24);
gEMaxValue[1]->SetMarkerSize(1.4);
gEMaxValue[1]->Draw("PC");
}
// Emax value
// New axis first:
C->Update(); // Needed for the axis!
C->cd();
ifile->Close();
// Print to a file
PlasmaGlob::imgconv(C,fOutName,opt);
// ---------------------------------------------------------
}