本文整理汇总了C++中TPaletteAxis::SetLabelOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaletteAxis::SetLabelOffset方法的具体用法?C++ TPaletteAxis::SetLabelOffset怎么用?C++ TPaletteAxis::SetLabelOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaletteAxis
的用法示例。
在下文中一共展示了TPaletteAxis::SetLabelOffset方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlotEvolutionsWIII
//.........这里部分代码省略.........
Int_t tzsize = tfontsize-4;
Int_t lzsize = fontsize-2;
Float_t txoffset = (250/ypadsize) * 2.4 / (950/ysize);
Float_t lxoffset = 0.015;
Float_t tyoffset = 1.2 / (950/ysize);
Float_t lyoffset = 0.01;
Float_t tzoffset = 1.4 / (950/ysize);
Float_t lzoffset = 0.01;
Float_t tylength = 0.015;
Float_t txlength = 0.04;
for(Int_t i=NPad-1;i>=0;i--) {
char name[16];
sprintf(name,"pad_%i",i);
pad[i] = (TPad*) gROOT->FindObject(name);
pad[i]->SetFrameLineWidth(2);
pad[i]->SetTickx(1);
pad[i]->SetTicky(1);
if(opt.Contains("trans"))
pad[i]->SetFillStyle(4000);
pad[i]->SetFrameFillStyle(4000);
sprintf(name,"hFrame_%i",i);
hFrame[i] = (TH2F*) gROOT->FindObject(name);
if(hFrame[i]) delete hFrame[i];
hFrame[i] = (TH2F*) hEvsTime[0]->Clone(name);
hFrame[i]->Reset();
Float_t xFactor = pad[NPad-1]->GetAbsWNDC()/pad[i]->GetAbsWNDC();
Float_t yFactor = pad[NPad-1]->GetAbsHNDC()/pad[i]->GetAbsHNDC();
// Format for y axis
hFrame[i]->GetYaxis()->SetLabelFont(fonttype);
hFrame[i]->GetYaxis()->SetLabelSize(lysize);
hFrame[i]->GetYaxis()->SetLabelOffset(lyoffset);
hFrame[i]->GetYaxis()->SetTitleFont(fonttype);
hFrame[i]->GetYaxis()->SetTitleSize(tysize);
hFrame[i]->GetYaxis()->SetTitleOffset(tyoffset);
hFrame[i]->GetYaxis()->SetTickLength(xFactor*tylength/yFactor);
// Format for x axis
hFrame[i]->GetXaxis()->SetLabelFont(fonttype);
hFrame[i]->GetXaxis()->SetLabelSize(lxsize);
hFrame[i]->GetXaxis()->SetLabelOffset(lxoffset);
hFrame[i]->GetXaxis()->SetTitleFont(fonttype);
hFrame[i]->GetXaxis()->SetTitleSize(txsize);
hFrame[i]->GetXaxis()->SetTitleOffset(txoffset);
hFrame[i]->GetXaxis()->SetTickLength(yFactor*txlength/xFactor);
if(i>0) { // skip x axis labels except for the lowest one
hFrame[i]->GetXaxis()->SetLabelSize(0.0);
hFrame[i]->GetXaxis()->SetTitleSize(0.0);
}
if(opt.Contains("nomar")) {
hFrame[i]->GetYaxis()->SetTickLength(0.0);
hFrame[i]->GetXaxis()->SetTickLength(0.0);
}
// Labels for the frames
}
// Access to color Palettes
TExec *exPlasma = new TExec("exPlasma","plasmaPalette->cd();");
示例2: PlotRakeInjection
//.........这里部分代码省略.........
pad[k]->SetLeftMargin(hmarl);
pad[k]->SetRightMargin(hmarr);
pad[k]->SetBottomMargin(vmard);
pad[k]->SetTopMargin(vmaru);
pad[k]->SetFrameLineWidth(3);
if(opt.Contains("logz")) {
pad[k]->SetLogz(1);
} else {
pad[k]->SetLogz(0);
}
pad[k]->Draw();
pad[k]->cd();
sprintf(name,"hFrame_%i",k);
hFrame[k] = (TH2F*) gROOT->FindObject(name);
if(hFrame[k]) delete hFrame[k];
hFrame[k] = (TH2F*) hDen2D[k][0]->Clone(name);
hFrame[k]->Reset();
hFrame[k]->GetXaxis()->CenterTitle();
hFrame[k]->GetYaxis()->CenterTitle();
hFrame[k]->GetZaxis()->CenterTitle();
hFrame[k]->SetLabelFont(42,"xyz");
hFrame[k]->SetTitleFont(42,"xyz");
hFrame[k]->SetNdivisions(505,"xyz");
hFrame[k]->SetTickLength(0.04,"xyz");
hFrame[k]->SetTickLength(0.04*vfactor,"y");
hFrame[k]->GetYaxis()->SetLabelSize(0.03/vfactor);
hFrame[k]->GetYaxis()->SetLabelOffset(0.02);
hFrame[k]->GetYaxis()->SetTitleSize(0.03/vfactor);
hFrame[k]->GetYaxis()->SetTitleOffset(999.0*vfactor);
if(k==0) {
hFrame[k]->GetXaxis()->SetLabelSize(0.10);
hFrame[k]->GetXaxis()->SetLabelOffset(0.02);
hFrame[k]->GetXaxis()->SetTitleSize(0.14);
hFrame[k]->GetXaxis()->SetTitleOffset(1.0);
} else {
hFrame[k]->GetXaxis()->SetLabelSize(0.0);
hFrame[k]->GetXaxis()->SetTitleSize(0.0);
}
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();
示例3: MakeBioluminescencePlots
void MakeBioluminescencePlots(){
gStyle->SetOptStat(0);
gStyle->SetCanvasColor(0);
gStyle->SetPadColor(0);
gStyle->SetPadBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetLabelSize(0.03,"x");
gStyle->SetLabelSize(0.03,"y");
gStyle->SetLabelFont(42,"x");
gStyle->SetLabelFont(42,"y");
gStyle->SetOptStat(1111);
////////////// DECLARES HISTOGRAMS /////////////////////////////////////////////////////////////
TH2D * histXY = new TH2D("histXY","",200,-15,15,200,-15,15);
///////////////////// DECLARES CHAINS ////////////////////////////////////////////////////////////
TChain *chain1 = new TChain("OpticalData","");
///////////////////////////// ADDS NTUPLES TO CHAINS ////////////////////////////////////////////
chain1->Add("./Bioluminescence_skin.root/OpticalData");
//////////////////////////////////// MAKES SELECTIONS IN EACH CHAIN ////////////////////////////////////////////////////////////
chain1->Draw("CrystalLastHitPos_Y:CrystalLastHitPos_X>>histXY","CrystalLastHitPos_Z == 30.0 && CrystalLastHitEnergy > 0.0","goff");
TCanvas *XY = new TCanvas("XY", " ",0,22,800,802);
XY->Range(-125,-125,125,125);
XY->SetGridx();
XY->SetGridy();
XY->SetTickx(1);
XY->SetTicky(1);
XY->SetFrameBorderMode(0);
XY->SetFrameBorderMode(0);
XY->SetFillColor(kWhite);
TPaletteAxis *palette = new TPaletteAxis(13.23807,-14.97093,14.93405,15.01938,histXY);
palette->SetLabelColor(1);
palette->SetLabelFont(62);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.02);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.04);
palette->SetFillColor(0);
palette->SetFillStyle(1001);
histXY->GetListOfFunctions()->Add(palette,"br");
histXY->GetXaxis()->SetTitle("x-position(mm)");
histXY->GetXaxis()->SetLabelFont(42);
histXY->GetXaxis()->SetTitleFont(42);
histXY->GetYaxis()->SetTitle("y-position(mm)");
histXY->GetYaxis()->SetLabelFont(42);
histXY->GetYaxis()->SetTitleOffset(1.43);
histXY->GetYaxis()->SetTitleFont(42);
histXY->Draw("colz");
histXY->GetXaxis()->SetTitleSize(0.03);
histXY->GetYaxis()->SetTitleSize(0.03);
histXY->GetXaxis()->SetLabelSize(0.03);
histXY->GetYaxis()->SetLabelSize(0.03);
XY->Modified();
XY->cd();
XY->SetSelected(XY);
}
示例4: PlotPotential2D
//.........这里部分代码省略.........
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");
}
{
TGraph *gr = (TGraph*) graphsV2D.At(4);
gr->Draw("C");
}
示例5: printEff
void printEff(TTree* HltTree,const char *cut,const char *title, char *projectTitle)
{
cout <<" * "<<title<<":"<<endl;
cout <<" * Efficiencies:"<<endl;
double nEvt = HltTree->GetEntries(cut);
cout <<" | "<<setw(20)<<"HLT Path";
cout <<" | "<<setw(25)<<"Efficiency";
cout <<" | "<<endl;
triggers->clear();
triggerCuts->clear();
vector <double*> effs;
// calculate the efficiency //
effs.push_back(calcEff(HltTree,"L1Tech_BSC_OR",nEvt,Form("(%s)&&L1Tech_BSC_minBias_OR.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_thr1",nEvt,Form("(%s)&&L1Tech_BSC_minBias_threshold1.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_thr2",nEvt,Form("(%s)&&L1Tech_BSC_minBias_threshold2.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_inner_thr1",nEvt,Form("(%s)&&L1Tech_BSC_minBias_inner_threshold1.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_inner_thr2",nEvt,Form("(%s)&&L1Tech_BSC_minBias_inner_threshold2.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_HF_coinc_PM",nEvt,Form("(%s)&&L1Tech_HCAL_HF_coincidence_PM.v0==1",cut)));
effs.push_back(calcEff(HltTree,"HLT_MBPixel_1Track",nEvt,Form("(%s)&&HLT_MinBiasPixel_SingleTrack==1",cut)));
//effs.push_back(calcEff(HltTree,"L1Tech_BSC_splash_beam1.v0",nEvt,Form("(%s)&&L1Tech_BSC_splash_beam1.v0==1",cut)));
//effs.push_back(calcEff(HltTree,"L1Tech_BSC_splash_beam2.v0",nEvt,Form("(%s)&&L1Tech_BSC_splash_beam2.v0==1",cut)));
//effs.push_back(calcEff(HltTree,"All",nEvt,Form("(%s)&&(L1Tech_BSC_minBias_threshold1.v0||L1Tech_BSC_minBias_threshold2.v0||L1Tech_BSC_minBias_OR.v0||L1Tech_BSC_minBias_inner_threshold1.v0||L1Tech_BSC_minBias_inner_threshold2.v0||L1Tech_BSC_splash_beam1.v0||L1Tech_BSC_splash_beam2.v0)",cut)));
results->push_back(effs);
cout <<" * Correlation Matrix:"<<endl;
int tsize = (int)triggers->size();
TH2D *h = new TH2D(Form("h%s",title),"",tsize,0,tsize,tsize,0,tsize);
TH2D *hct = new TH2D(Form("h%s_ct",title),"",tsize,0,tsize,tsize,0,tsize);
for (int i=tsize-1;i>=0;i--){
int nEvtAfterCut = HltTree->GetEntries((*triggerCuts)[i].c_str());
h->GetXaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
h->GetYaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
hct->GetXaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
hct->GetYaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
for (int j=0;j<tsize;j++){
string cut ="("+(*triggerCuts)[i]+")&&("+(*triggerCuts)[j]+")";
double* eff = calcEff(HltTree,"",nEvtAfterCut,Form("%s",cut.c_str()),0);
if (nEvtAfterCut==0) eff[0]=0;
h->SetBinContent(i+1,j+1,int(eff[0]*100000)/1000.);
hct->SetBinContent(i+1,j+1,HltTree->GetEntries(cut.c_str()));
}
}
h->GetXaxis()->LabelsOption("v");
hct->GetXaxis()->LabelsOption("v");
TCanvas *c1 = new TCanvas(Form("c%s",title), Form("c_%s",title),800,600);
c1->Range(-3.609756,-1.910995,12.7561,10.60209);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(0);
c1->SetTickx();
c1->SetTicky();
c1->SetLeftMargin(0.25);
c1->SetRightMargin(0.1684054);
c1->SetTopMargin(0.02);
c1->SetBottomMargin(0.3);
c1->SetFrameLineColor(0);
c1->SetFrameBorderMode(0);
c1->SetFrameLineColor(0);
c1->SetFrameBorderMode(0);
h->Draw("col text");
TPaletteAxis *palette = new TPaletteAxis(tsize*1.02,0,tsize*1.1,tsize,h);
palette->SetLabelColor(1);
palette->SetLabelFont(42);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.045);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.04);
palette->SetFillColor(100);
palette->SetFillStyle(1001);
h->GetListOfFunctions()->Add(palette,"br");
h->Draw("col text z");
string fname(Form("plot_%s_%s.gif",projectTitle,title));
c1->SaveAs(fname.c_str());
c1->SaveAs(Form("plot_%s_%s.C",projectTitle,title));
cout <<"<img src=\"%ATTACHURLPATH%/"<<fname<<"\" alt=\""<<fname<<"\" width='671' height='478' />"<<endl;
}
示例6: BinCovarianceHggRazor
//.........这里部分代码省略.........
corr->SetBinContent(415,0.5727072);
corr->SetBinContent(416,-1.17764);
corr->SetBinContent(417,-1.085029);
corr->SetBinContent(418,30.42);
corr->SetMinimum(-4000);
corr->SetMaximum(4000);
corr->SetEntries(361);
corr->SetStats(0);
corr->SetContour(20);
corr->SetContourLevel(0,-4000);
corr->SetContourLevel(1,-3600);
corr->SetContourLevel(2,-3200);
corr->SetContourLevel(3,-2800);
corr->SetContourLevel(4,-2400);
corr->SetContourLevel(5,-2000);
corr->SetContourLevel(6,-1600);
corr->SetContourLevel(7,-1200);
corr->SetContourLevel(8,-800);
corr->SetContourLevel(9,-400);
corr->SetContourLevel(10,0);
corr->SetContourLevel(11,400);
corr->SetContourLevel(12,800);
corr->SetContourLevel(13,1200);
corr->SetContourLevel(14,1600);
corr->SetContourLevel(15,2000);
corr->SetContourLevel(16,2400);
corr->SetContourLevel(17,2800);
corr->SetContourLevel(18,3200);
corr->SetContourLevel(19,3600);
TPaletteAxis *palette = new TPaletteAxis(19.11905,-0.7931685,20.2619,19.82922,corr);
palette->SetLabelColor(1);
palette->SetLabelFont(42);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.035);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.035);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#f9f90e");
palette->SetFillColor(ci);
palette->SetFillStyle(1001);
corr->GetListOfFunctions()->Add(palette,"br");
ci = TColor::GetColor("#000099");
corr->SetLineColor(ci);
corr->GetXaxis()->SetBinLabel(1,"Bin 0");
corr->GetXaxis()->SetBinLabel(2,"Bin 1");
corr->GetXaxis()->SetBinLabel(3,"Bin 2");
corr->GetXaxis()->SetBinLabel(4,"Bin 3");
corr->GetXaxis()->SetBinLabel(5,"Bin 4");
corr->GetXaxis()->SetBinLabel(6,"Bin 5");
corr->GetXaxis()->SetBinLabel(7,"Bin 6");
corr->GetXaxis()->SetBinLabel(8,"Bin 7");
corr->GetXaxis()->SetBinLabel(9,"Bin 8");
corr->GetXaxis()->SetBinLabel(10,"Bin 9 HighRes");
corr->GetXaxis()->SetBinLabel(11,"Bin 10 HighRes");
corr->GetXaxis()->SetBinLabel(12,"Bin 11 HighRes");
corr->GetXaxis()->SetBinLabel(13,"Bin 12 HighRes");
corr->GetXaxis()->SetBinLabel(14,"Bin 13 HighRes");
corr->GetXaxis()->SetBinLabel(15,"Bin 9 LowRes");
corr->GetXaxis()->SetBinLabel(16,"Bin 10 LowRes");
corr->GetXaxis()->SetBinLabel(17,"Bin 11 LowRes");
corr->GetXaxis()->SetBinLabel(18,"Bin 12 LowRes");
corr->GetXaxis()->SetBinLabel(19,"Bin 13 LowRes");
示例7: PlotField2D
//.........这里部分代码省略.........
gPad->SetRightMargin(rMargin);
gPad->SetBottomMargin(bMargin);
gPad->SetTopMargin(tMargin);
if(opt.Contains("logz")) {
gPad->SetLogz(1);
} else {
gPad->SetLogz(0);
}
gPad->SetFrameLineWidth(2);
// 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);