本文整理汇总了C++中TStyle::SetFitFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ TStyle::SetFitFormat方法的具体用法?C++ TStyle::SetFitFormat怎么用?C++ TStyle::SetFitFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStyle
的用法示例。
在下文中一共展示了TStyle::SetFitFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setRBellanStyle
void setRBellanStyle() {
TStyle *theStyle = new TStyle("rbStyle", "Style for Bellan Thesis");
theStyle->SetOptStat(0);
theStyle->SetPadBorderMode(0);
theStyle->SetCanvasBorderMode(0);
theStyle->SetPadColor(0);
theStyle->SetCanvasColor(0);
theStyle->SetMarkerStyle(8);
theStyle->SetMarkerSize(0.7);
theStyle->SetPalette(1);
theStyle->SetStatH(0.3);
// theStyle->SetTextFont(132);
// theStyle->SetTitleFont(132);
theStyle->SetTitleBorderSize(1);
// theStyle->SetPalette(1);
theStyle->SetOptStat(0);
theStyle->SetFitFormat("4.4g");
theStyle->SetStatY(0.99);
theStyle->SetStatX(0.99);
theStyle->SetTitleYOffset(1.6);
theStyle->SetLabelSize(0.035, "XYZ");
theStyle->SetPadGridX(true);
theStyle->SetPadGridY(true);
theStyle->SetFrameBorderMode(0);
theStyle->SetTitleFillColor(0);
theStyle->SetLegendBorderSize();
// theStyle->SetCanvasDefH(600);
// theStyle->SetCanvasDefW(400);
//theStyle->SetOptLogy(); //aaa
// theStyle->SetOptLogx();
theStyle->cd();
}
示例2: Style_Toby_2
//.........这里部分代码省略.........
tmpStyle->SetLegendFont(42);
tmpStyle->SetHatchesLineWidth(1);
tmpStyle->SetHatchesSpacing(1);
tmpStyle->SetFrameFillColor(0);
tmpStyle->SetFrameLineColor(1);
tmpStyle->SetFrameFillStyle(1001);
tmpStyle->SetFrameLineStyle(1);
tmpStyle->SetFrameLineWidth(1);
tmpStyle->SetFrameBorderSize(1);
tmpStyle->SetFrameBorderMode(0);
tmpStyle->SetHistFillColor(0);
tmpStyle->SetHistLineColor(602);
tmpStyle->SetHistFillStyle(1001);
tmpStyle->SetHistLineStyle(1);
tmpStyle->SetHistLineWidth(1);
tmpStyle->SetHistMinimumZero(kFALSE);
tmpStyle->SetCanvasPreferGL(kFALSE);
tmpStyle->SetCanvasColor(0);
tmpStyle->SetCanvasBorderSize(2);
tmpStyle->SetCanvasBorderMode(0);
tmpStyle->SetCanvasDefH(500);
tmpStyle->SetCanvasDefW(700);
tmpStyle->SetCanvasDefX(10);
tmpStyle->SetCanvasDefY(10);
tmpStyle->SetPadColor(0);
tmpStyle->SetPadBorderSize(2);
tmpStyle->SetPadBorderMode(0);
tmpStyle->SetPadBottomMargin(0.1);
tmpStyle->SetPadTopMargin(0.1);
tmpStyle->SetPadLeftMargin(0.1);
tmpStyle->SetPadRightMargin(0.1);
tmpStyle->SetPadGridX(kFALSE);
tmpStyle->SetPadGridY(kFALSE);
tmpStyle->SetPadTickX(0);
tmpStyle->SetPadTickY(0);
tmpStyle->SetPaperSize(20, 26);
tmpStyle->SetScreenFactor(1);
tmpStyle->SetStatColor(0);
tmpStyle->SetStatTextColor(1);
tmpStyle->SetStatBorderSize(1);
tmpStyle->SetStatFont(42);
tmpStyle->SetStatFontSize(0);
tmpStyle->SetStatStyle(1001);
tmpStyle->SetStatFormat("6.4g");
tmpStyle->SetStatX(0.9);
tmpStyle->SetStatY(0.97);
tmpStyle->SetStatW(0.15);
tmpStyle->SetStatH(0.16);
tmpStyle->SetStripDecimals(kTRUE);
tmpStyle->SetTitleAlign(23);
tmpStyle->SetTitleFillColor(0);
tmpStyle->SetTitleTextColor(1);
tmpStyle->SetTitleBorderSize(0);
tmpStyle->SetTitleFont(42);
tmpStyle->SetTitleFontSize(0.05);
tmpStyle->SetTitleStyle(0);
tmpStyle->SetTitleX(0.5);
tmpStyle->SetTitleY(0.995);
tmpStyle->SetTitleW(0);
tmpStyle->SetTitleH(0);
tmpStyle->SetLegoInnerR(0.5);
Int_t fPaletteColor[50] = {51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100};
tmpStyle->SetPalette(50, fPaletteColor);
TString fLineStyleArrayTmp[30] = {"", " ", " 12 12", " 4 8",
" 12 16 4 16", " 20 12 4 12", " 20 12 4 12 4 12 4 12", " 20 20", " 20 12 4 12 4 12",
" 80 20", " 80 40 4 40", " ", " ", " ",
" ", " ", " ", " ", " ",
" ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " "};
for (Int_t i=0; i<30; i++)
tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);
tmpStyle->SetHeaderPS("");
tmpStyle->SetTitlePS("");
tmpStyle->SetFitFormat("5.4g");
tmpStyle->SetPaintTextFormat("g");
tmpStyle->SetLineScalePS(3);
tmpStyle->SetColorModelPS(0);
tmpStyle->SetTimeOffset(788918400);
tmpStyle->SetLineColor(1);
tmpStyle->SetLineStyle(1);
tmpStyle->SetLineWidth(1);
tmpStyle->SetFillColor(19);
tmpStyle->SetFillStyle(1001);
tmpStyle->SetMarkerColor(1);
tmpStyle->SetMarkerSize(1);
tmpStyle->SetMarkerStyle(1);
tmpStyle->SetTextAlign(11);
tmpStyle->SetTextAngle(0);
tmpStyle->SetTextColor(1);
tmpStyle->SetTextFont(62);
tmpStyle->SetTextSize(0.05);
}
示例3: set_plot_style
void set_plot_style() {
TStyle* style = new TStyle("style", "Style for P-TDR");
// For the canvas:
style->SetCanvasBorderMode(0);
style->SetCanvasColor(kWhite);
style->SetCanvasDefX(0); //Position on screen
style->SetCanvasDefY(0);
// For the Pad:
style->SetPadBorderMode(0);
style->SetPadColor(kWhite);
style->SetPadGridX(false);
style->SetPadGridY(false);
style->SetGridColor(kBlack);
style->SetGridStyle(3);
style->SetGridWidth(1);
// For the frame:
style->SetFrameBorderMode(0);
style->SetFrameBorderSize(1);
style->SetFrameFillColor(kWhite);
style->SetFrameFillStyle(0);
style->SetFrameLineColor(kBlack);
style->SetFrameLineStyle(1);
style->SetFrameLineWidth(1);
// For the histo:
// style->SetHistFillColor(1);
style->SetHistFillStyle(0); //
style->SetHistLineColor(kBlack);
style->SetHistLineStyle(0);
style->SetHistLineWidth(1);
style->SetEndErrorSize(2);
style->SetErrorX(0.);
style->SetMarkerStyle(20);
//For the fit/function:
style->SetOptFit(1);
style->SetFitFormat("5.4g");
style->SetFuncColor(kRed);
style->SetFuncStyle(1);
style->SetFuncWidth(1);
//For the date:
style->SetOptDate(0);
// For the statistics box:
style->SetOptFile(0);
style->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
style->SetStatColor(kWhite);
style->SetStatFont(42);
style->SetStatFontSize(0.025);
style->SetStatTextColor(kBlack);
style->SetStatFormat("6.4g");
style->SetStatBorderSize(1);
style->SetStatH(0.1);
style->SetStatW(0.15);
// Margins:
style->SetPadTopMargin(1 - 0.95);
style->SetPadBottomMargin(0.1);
style->SetPadLeftMargin(0.12);
style->SetPadRightMargin(1 - 0.96);
// For the Global title:
style->SetOptTitle(0);
style->SetTitleFont(42);
style->SetTitleColor(kBlack);
style->SetTitleTextColor(kBlack);
style->SetTitleFillColor(kWhite); //10 is roughly kWhite, 10% grey?
style->SetTitleFontSize(0.05);
// For the axis titles:
style->SetTitleColor(kBlack, "XYZ");
style->SetTitleFont(42, "XYZ");
style->SetTitleSize(0.06, "XYZ");
style->SetTitleXOffset(0.9);
style->SetTitleYOffset(1.25);
// For the axis labels:
style->SetLabelColor(kBlack, "XYZ");
style->SetLabelFont(42, "XYZ");
style->SetLabelOffset(0.007, "XYZ");
style->SetLabelSize(0.05, "XYZ");
// For the axis:
style->SetAxisColor(kBlack, "XYZ");
style->SetStripDecimals(true);
style->SetTickLength(0.03, "XYZ");
style->SetNdivisions(510, "XYZ");
style->SetPadTickX(true); // To get tick marks on the opposite side of the frame
style->SetPadTickY(true);
// Change for log plots:
style->SetOptLogx(false);
style->SetOptLogy(false);
style->SetOptLogz(false);
//.........这里部分代码省略.........
示例4: setTDRStyle
void setTDRStyle() {
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600);
tdrStyle->SetCanvasDefW(600);
tdrStyle->SetCanvasDefX(0);
tdrStyle->SetCanvasDefY(0);
tdrStyle->SetPadBorderMode(0);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
tdrStyle->SetEndErrorSize(2);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
tdrStyle->SetMarkerSize(2);
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncColor(2);
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
tdrStyle->SetOptDate(0);
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat(0);
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.1);
tdrStyle->SetStatW(0.15);
tdrStyle->SetPadTopMargin(0.05);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.10);
tdrStyle->SetPadRightMargin(0.05);
tdrStyle->SetOptTitle(0);
tdrStyle->SetTitleFont(42);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.05);
// For the axis labels:
tdrStyle->SetLabelColor(1, "XYZ");
tdrStyle->SetLabelOffset(0.007, "XYZ");
tdrStyle->SetLabelSize(0.03, "XYZ");
tdrStyle->SetAxisColor(1, "XYZ");
tdrStyle->SetStripDecimals(kTRUE);
tdrStyle->SetTickLength(0.03, "XYZ");
tdrStyle->SetNdivisions(510, "XYZ");
tdrStyle->SetPadTickX(1);
tdrStyle->SetPadTickY(1);
tdrStyle->SetOptLogx(0);
tdrStyle->SetOptLogy(0);
tdrStyle->SetOptLogz(0);
tdrStyle->SetPaperSize(20.,20.);
tdrStyle->cd();
}
示例5: getFormalStyle
// Create my custom FORMAL style
//********************************************************************//
void getFormalStyle(void) {
// std::cout << " *** void getFormalStyle(void) *** Custom TStyle initialized!" << std::endl;
TStyle *formalStyle = new TStyle("formalStyle","Style for AN09");
// For the canvas:
//********************
formalStyle->SetCanvasBorderMode(0);
formalStyle->SetCanvasColor(kWhite);
formalStyle->SetCanvasDefH(600); //Height of canvas
formalStyle->SetCanvasDefW(600); //Width of canvas
formalStyle->SetCanvasDefX(0); //POsition on screen
formalStyle->SetCanvasDefY(0);
// For the Pad:
//********************
formalStyle->SetPadBorderMode(0);
formalStyle->SetOptTitle(0); // delete histogram titles
// formalStyle->SetPadBorderSize(Width_t size = 1);
formalStyle->SetPadColor(kWhite);
formalStyle->SetPadGridX(false);
formalStyle->SetPadGridY(false);
formalStyle->SetGridColor(0);
formalStyle->SetGridStyle(3);
formalStyle->SetGridWidth(1);
// For the frame:
//********************
formalStyle->SetFrameBorderMode(0);
formalStyle->SetFrameBorderSize(1);
formalStyle->SetFrameFillColor(0);
formalStyle->SetFrameFillStyle(0);
formalStyle->SetFrameLineColor(1);
formalStyle->SetFrameLineStyle(1);
formalStyle->SetFrameLineWidth(1);
// For the histo:
//********************
// formalStyle->SetHistFillColor(1);
// formalStyle->SetHistFillStyle(0);
formalStyle->SetHistLineColor(1);
formalStyle->SetHistLineStyle(0);
formalStyle->SetHistLineWidth(1);
// formalStyle->SetLegoInnerR(Float_t rad = 0.5);
// formalStyle->SetNumberContours(Int_t number = 20);
formalStyle->SetEndErrorSize(2);
//formalStyle->SetErrorMarker(20);
formalStyle->SetErrorX(0.);
formalStyle->SetMarkerStyle(20);
//For the fit/function:
//********************
formalStyle->SetOptFit(1);
formalStyle->SetFitFormat("5.4g");
formalStyle->SetFuncColor(2);
formalStyle->SetFuncStyle(1);
formalStyle->SetFuncWidth(1);
//For the date:
//********************
formalStyle->SetOptDate(0);
// formalStyle->SetDateX(Float_t x = 0.01);
// formalStyle->SetDateY(Float_t y = 0.01);
// For the statistics box:
//********************
formalStyle->SetOptFile(0);
formalStyle->SetOptStat(0); // stats box
formalStyle->SetOptFit(0000); // fit box
formalStyle->SetStatColor(kWhite);
formalStyle->SetStatFont(42);
formalStyle->SetStatFontSize(0.025);
formalStyle->SetStatTextColor(1);
formalStyle->SetStatFormat("6.4g");
formalStyle->SetStatBorderSize(1);
formalStyle->SetStatH(0.1);
formalStyle->SetStatW(0.15);
// formalStyle->SetStatStyle(Style_t style = 1001);
// formalStyle->SetStatX(Float_t x = 0);
// formalStyle->SetStatY(Float_t y = 0);
// Margins:
//********************
formalStyle->SetPadTopMargin(0.15);
formalStyle->SetPadBottomMargin(0.13);
formalStyle->SetPadLeftMargin(0.13);
formalStyle->SetPadRightMargin(0.15);
// For the Global title:
//********************
// formalStyle->SetOptTitle(0);
formalStyle->SetTitleFont(42);
formalStyle->SetTitleColor(1);
formalStyle->SetTitleTextColor(1);
formalStyle->SetTitleFillColor(10);
formalStyle->SetTitleFontSize(0.05);
// formalStyle->SetTitleH(0); // Set the height of the title box
// formalStyle->SetTitleW(0); // Set the width of the title box
// formalStyle->SetTitleX(0); // Set the position of the title box
//.........这里部分代码省略.........
示例6: TDRStyle
void TDRStyle() {
TStyle *TDRStyle = new TStyle("TDRStyle", "TDR style");
/// helvetica, size absolute
// TDRStyle->font = 43
// TDRStyle->titleSize = 33
// TDRStyle->labelSize = 27
// TDRStyle->statSize = 14
/// for the canvas
TDRStyle->SetCanvasBorderMode(0);
TDRStyle->SetCanvasColor(kWhite);
TDRStyle->SetCanvasDefH(600); // Height of canvas
TDRStyle->SetCanvasDefW(600); // Width of canvas
TDRStyle->SetCanvasDefX(0); // POsition on screen
TDRStyle->SetCanvasDefY(0);
/// For the Pad:
TDRStyle->SetPadBorderMode(0);
TDRStyle->SetPadColor(kWhite);
TDRStyle->SetPadGridX(false);
TDRStyle->SetPadGridY(false);
TDRStyle->SetGridColor(0);
TDRStyle->SetGridStyle(3);
TDRStyle->SetGridWidth(1);
/// For the frame:
TDRStyle->SetFrameBorderMode(0);
TDRStyle->SetFrameBorderSize(1);
TDRStyle->SetFrameFillColor(0);
TDRStyle->SetFrameFillStyle(0);
TDRStyle->SetFrameLineColor(1);
TDRStyle->SetFrameLineStyle(1);
TDRStyle->SetFrameLineWidth(1);
/// For the histo:
TDRStyle->SetHistLineColor(1);
TDRStyle->SetHistLineStyle(0);
TDRStyle->SetHistLineWidth(1);
TDRStyle->SetEndErrorSize(2);
TDRStyle->SetErrorX(0.5); // needed for uncertainty histograms
TDRStyle->SetMarkerStyle(20);
/// For the fit/function:
TDRStyle->SetOptFit(1);
TDRStyle->SetFitFormat("5.4g");
TDRStyle->SetFuncColor(2);
TDRStyle->SetFuncStyle(1);
TDRStyle->SetFuncWidth(1);
/// For the date:
TDRStyle->SetOptDate(0);;
/// For the statistics box:
TDRStyle->SetOptFile(0);
TDRStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");;
TDRStyle->SetStatColor(kWhite);
TDRStyle->SetStatFont(43);
TDRStyle->SetStatFontSize(14);
TDRStyle->SetStatTextColor(1);
TDRStyle->SetStatFormat("6.4g");
TDRStyle->SetStatBorderSize(1);
TDRStyle->SetStatH(0.1);
TDRStyle->SetStatW(0.15);
/// Margins:
TDRStyle->SetPadTopMargin(0.05); // default
TDRStyle->SetPadBottomMargin(0.13);
TDRStyle->SetPadLeftMargin(0.16);
TDRStyle->SetPadRightMargin(0.05); // default
/// For the Global title:
TDRStyle->SetOptTitle(0);
TDRStyle->SetTitleFont(43);
TDRStyle->SetTitleColor(1);
TDRStyle->SetTitleTextColor(1);
TDRStyle->SetTitleFillColor(10);
TDRStyle->SetTitleFontSize(27);
/// For the axis titles:
TDRStyle->SetTitleColor(1, "XYZ");
TDRStyle->SetTitleFont(43, "XYZ");
TDRStyle->SetTitleSize(33, "XYZ");
TDRStyle->SetTitleXOffset(0.9);
TDRStyle->SetTitleYOffset(1.25);
/// For the axis labels:
TDRStyle->SetLabelColor(1, "XYZ");
TDRStyle->SetLabelFont(43, "XYZ");
TDRStyle->SetLabelOffset(0.007, "XYZ");
TDRStyle->SetLabelSize(27, "XYZ");
/// For the axis:
TDRStyle->SetAxisColor(1, "XYZ");
TDRStyle->SetStripDecimals(true);
TDRStyle->SetTickLength(0.03, "XYZ");
TDRStyle->SetNdivisions(510, "XYZ");
TDRStyle->SetPadTickX(1); /// To get tick marks on the opposite side of the frame
TDRStyle->SetPadTickY(1);
/// For the text boxes
//.........这里部分代码省略.........
示例7: createMyStyle
TStyle* createMyStyle() {
TStyle *myStyle = new TStyle("myStyle", "myStyle");
// For the canvas:
myStyle->SetCanvasBorderMode(0);
myStyle->SetCanvasColor(kWhite);
myStyle->SetCanvasDefH(800); //Height of canvas
myStyle->SetCanvasDefW(800); //Width of canvas
myStyle->SetCanvasDefX(0); //POsition on screen
myStyle->SetCanvasDefY(0);
// For the Pad:
myStyle->SetPadBorderMode(0);
myStyle->SetPadColor(kWhite);
myStyle->SetPadGridX(false);
myStyle->SetPadGridY(false);
myStyle->SetGridColor(0);
myStyle->SetGridStyle(3);
myStyle->SetGridWidth(1);
// For the frame:
myStyle->SetFrameBorderMode(0);
myStyle->SetFrameBorderSize(1);
myStyle->SetFrameFillColor(0);
myStyle->SetFrameFillStyle(0);
myStyle->SetFrameLineColor(1);
myStyle->SetFrameLineStyle(1);
myStyle->SetFrameLineWidth(1);
// For the histo:
myStyle->SetHistLineStyle(1);
myStyle->SetHistLineWidth(2);
myStyle->SetEndErrorSize(2);
//For the fit/function:
myStyle->SetFitFormat("5.4g");
myStyle->SetFuncColor(2);
myStyle->SetFuncStyle(1);
myStyle->SetFuncWidth(1);
// For the statistics box:
myStyle->SetOptFile(0);
myStyle->SetStatColor(kWhite);
//myStyle->SetStatFont(43);
//myStyle->SetStatFontSize(0.025);
myStyle->SetStatTextColor(1);
myStyle->SetStatFormat("6.4g");
myStyle->SetStatBorderSize(1);
myStyle->SetStatH(0.12);
myStyle->SetStatW(0.3);
myStyle->SetStatY(0.92);
myStyle->SetStatX(0.94);
//For the date:
myStyle->SetOptDate(0);
// Margins:
myStyle->SetPadTopMargin(TOP_MARGIN);
myStyle->SetPadBottomMargin(BOTTOM_MARGIN);
myStyle->SetPadLeftMargin(LEFT_MARGIN);
myStyle->SetPadRightMargin(RIGHT_MARGIN);
// For the Global title:
myStyle->SetOptTitle(0);
myStyle->SetTitleFont(63);
myStyle->SetTitleColor(1);
myStyle->SetTitleTextColor(1);
myStyle->SetTitleFillColor(10);
myStyle->SetTitleBorderSize(0);
myStyle->SetTitleAlign(33);
myStyle->SetTitleX(1);
myStyle->SetTitleFontSize(TITLE_FONTSIZE);
// For the axis titles:
myStyle->SetTitleColor(1, "XYZ");
myStyle->SetTitleFont(43, "XYZ");
myStyle->SetTitleSize(TITLE_FONTSIZE, "XYZ");
myStyle->SetTitleYOffset(2.);
myStyle->SetTitleXOffset(1.25);
myStyle->SetLabelColor(1, "XYZ");
myStyle->SetLabelFont(43, "XYZ");
myStyle->SetLabelOffset(0.01, "YZ");
myStyle->SetLabelOffset(0.015, "X");
myStyle->SetLabelSize(LABEL_FONTSIZE, "XYZ");
myStyle->SetAxisColor(1, "XYZ");
myStyle->SetStripDecimals(kTRUE);
myStyle->SetTickLength(0.03, "XYZ");
myStyle->SetNdivisions(510, "XYZ");
myStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
myStyle->SetPadTickY(1);
myStyle->SetOptLogx(0);
myStyle->SetOptLogy(0);
myStyle->SetOptLogz(0);
myStyle->SetHatchesSpacing(1.3);
myStyle->SetHatchesLineWidth(1);
//.........这里部分代码省略.........
示例8: if
//.........这里部分代码省略.........
glmap_id2style.insert(pair<string,TStyle*>(*sid,thestyle));
continue;
}
else if (!sid) {
// assume the style is the global style
thestyle = gStyle;
sid = new string("using global"); // so as to pass this check the next time
cerr << "No style ID defined, assuming global style" << endl;
continue;
}
if (key == "style") {
if (value == "TDR")
setTDRStyle();
else if (value == "Plain")
gROOT->SetStyle("Plain");
else
cerr << "unknown style name " << value << endl;
}
else if (key == "optstat") {
if (gl_verbose) cout << "OptStat = " << thestyle->GetOptStat() << endl;
thestyle->SetOptStat(value.c_str());
if (gl_verbose) cout << "OptStat = " << thestyle->GetOptStat() << endl;
}
else if (key == "opttitle") thestyle->SetOptTitle(str2int(value));
else if (key == "padrightmargin") thestyle->SetPadRightMargin (str2flt(value));
else if (key == "padleftmargin") thestyle->SetPadLeftMargin (str2flt(value));
else if (key == "padtopmargin") thestyle->SetPadTopMargin (str2flt(value));
else if (key == "padbottommargin") thestyle->SetPadBottomMargin(str2flt(value));
else if (key == "padgridx") thestyle->SetPadGridX (str2int(value));
else if (key == "padgridy") thestyle->SetPadGridY (str2int(value));
// Set the position/size of the title box
else if (key == "titlexndc") thestyle->SetTitleX(str2flt(value));
else if (key == "titleyndc") thestyle->SetTitleY(str2flt(value));
else if (key == "titlewndc") thestyle->SetTitleW(str2flt(value));
else if (key == "titlehndc") thestyle->SetTitleH(str2flt(value));
else if (key == "titlefont") thestyle->SetTitleFont(str2int(value));
else if (key == "titlebordersize") thestyle->SetTitleBorderSize(str2int(value));
else if (key == "markercolor") thestyle->SetMarkerColor(str2int(value));
else if (key == "markerstyle") thestyle->SetMarkerStyle(str2int(value));
else if (key == "markersize") thestyle->SetMarkerSize(str2int(value));
else if (key == "linecolor") thestyle->SetLineColor(str2int(value));
else if (key == "linestyle") thestyle->SetLineStyle(str2int(value));
else if (key == "linewidth") thestyle->SetLineWidth(str2int(value));
else if (key == "fillcolor") thestyle->SetFillColor(str2int(value));
else if (key == "fillstyle") thestyle->SetFillStyle(str2int(value));
// axes
else if (key == "xtitlesize") thestyle->SetTitleSize(str2flt(value),"X");
else if (key == "ytitlesize") thestyle->SetTitleSize(str2flt(value),"Y");
else if (key == "ztitlesize") thestyle->SetTitleSize(str2flt(value),"Z");
else if (key == "xtitleoffset") thestyle->SetTitleOffset(str2flt(value),"X");
else if (key == "ytitleoffset") thestyle->SetTitleOffset(str2flt(value),"Y");
else if (key == "ztitleoffset") thestyle->SetTitleOffset(str2flt(value),"Z");
else if (key == "xlabeloffset") thestyle->SetLabelOffset(str2flt(value),"X");
else if (key == "ylabeloffset") thestyle->SetLabelOffset(str2flt(value),"Y");
else if (key == "zlabeloffset") thestyle->SetLabelOffset(str2flt(value),"Z");
else if (key == "xtitlefont") thestyle->SetTitleFont(str2int(value),"X");
else if (key == "ytitlefont") thestyle->SetTitleFont(str2int(value),"Y");
else if (key == "ztitlefont") thestyle->SetTitleFont(str2int(value),"Z");
else if (key == "xlabelsize") thestyle->SetLabelSize(str2flt(value),"X");
else if (key == "ylabelsize") thestyle->SetLabelSize(str2flt(value),"Y");
else if (key == "zlabelsize") thestyle->SetLabelSize(str2flt(value),"Z");
else if (key == "xlabelfont") thestyle->SetLabelFont(str2int(value),"X");
else if (key == "ylabelfont") thestyle->SetLabelFont(str2int(value),"Y");
else if (key == "zlabelfont") thestyle->SetLabelFont(str2int(value),"Z");
else if (key == "xndiv") thestyle->SetNdivisions(str2int(value),"X");
else if (key == "yndiv") thestyle->SetNdivisions(str2int(value),"Y");
else if (key == "zndiv") thestyle->SetNdivisions(str2int(value),"Z");
// Set the position of the statbox
else if (key == "statx2ndc") thestyle->SetStatX(str2flt(value));
else if (key == "staty2ndc") thestyle->SetStatY(str2flt(value));
else if (key == "statwndc") thestyle->SetStatW(str2flt(value));
else if (key == "stathndc") thestyle->SetStatH(str2flt(value));
else if (key == "statfont") thestyle->SetStatFont (str2int(value));
else if (key == "statfontsize") thestyle->SetStatFontSize(str2flt(value));
else if (key == "statformat") thestyle->SetStatFormat (value.c_str());
else if (key == "statstyle") thestyle->SetStatStyle (str2int(value.c_str()));
else if (key == "fitformat") thestyle->SetFitFormat (value.c_str());
else if (key == "painttextfmt") thestyle->SetPaintTextFormat(value.c_str());
else if (key == "markersize") thestyle->SetMarkerSize(str2flt(value));
else if (key == "palette") thestyle->SetPalette(str2int(value));
else {
cerr << "Unknown key " << key << endl;
}
} // while loop
return true;
} // processStyleSection
示例9: setHHStyle
void setHHStyle(TStyle& HHStyle)
{
const int fontstyle=42;
HHStyle.SetPalette(1);
// ==============
// Canvas
// ==============
HHStyle.SetCanvasBorderMode(0);
HHStyle.SetCanvasColor(kWhite);
HHStyle.SetCanvasDefH(600); //Height of canvas
HHStyle.SetCanvasDefW(600); //Width of canvas
HHStyle.SetCanvasDefX(0); //Position on screen
HHStyle.SetCanvasDefY(0);
// ==============
// Pad
// ==============
HHStyle.SetPadBorderMode(0);
// HHStyle.SetPadBorderSize(Width_t size = 1);
HHStyle.SetPadColor(kWhite);
HHStyle.SetPadGridX(false);
HHStyle.SetPadGridY(false);
HHStyle.SetGridColor(kGray);
HHStyle.SetGridStyle(3);
HHStyle.SetGridWidth(1);
// ==============
// Frame
// ==============
HHStyle.SetFrameBorderMode(0);
HHStyle.SetFrameBorderSize(1);
HHStyle.SetFrameFillColor(0);
HHStyle.SetFrameFillStyle(0);
HHStyle.SetFrameLineColor(1);
HHStyle.SetFrameLineStyle(1);
HHStyle.SetFrameLineWidth(1);
// ==============
// Histo
// ==============
HHStyle.SetErrorX(0.0);
HHStyle.SetEndErrorSize(8);
// HHStyle.SetHistFillColor(1);
// HHStyle.SetHistFillStyle(0);
// HHStyle.SetHistLineColor(1);
HHStyle.SetHistLineStyle(0);
HHStyle.SetHistLineWidth(1);
// HHStyle.SetLegoInnerR(Float_t rad = 0.5);
// HHStyle.SetNumberContours(Int_t number = 20);
// HHStyle.SetErrorMarker(20);
HHStyle.SetMarkerStyle(20);
// ==============
// Fit/function
// ==============
HHStyle.SetOptFit(0);
HHStyle.SetFitFormat("5.4g");
HHStyle.SetFuncColor(2);
HHStyle.SetFuncStyle(1);
HHStyle.SetFuncWidth(1);
// ==============
// Date
// ==============
HHStyle.SetOptDate(0);
// HHStyle.SetDateX(Float_t x = 0.01);
// HHStyle.SetDateY(Float_t y = 0.01);
// =====================
// Statistics Box
// =====================
HHStyle.SetOptFile(0);
HHStyle.SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
HHStyle.SetStatColor(kWhite);
HHStyle.SetStatFont(fontstyle);
HHStyle.SetStatFontSize(0.025);
HHStyle.SetStatTextColor(1);
HHStyle.SetStatFormat("6.4g");
HHStyle.SetStatBorderSize(1);
HHStyle.SetStatH(0.1);
HHStyle.SetStatW(0.15);
// HHStyle.SetStatStyle(Style_t style = 1001);
// HHStyle.SetStatX(Float_t x = 0);
// HHStyle.SetStatY(Float_t y = 0);
// ==============
// Margins
// ==============
//.........这里部分代码省略.........
示例10: setTDRStyle
/////
// Set setTDRStyle_modified (from link https://twiki.cern.ch/twiki/pub/CMS/TRK10001/setTDRStyle_modified.C)
/////
void setTDRStyle(){
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600); //Height of canvas
tdrStyle->SetCanvasDefW(600); //Width of canvas
tdrStyle->SetCanvasDefX(0); //POsition on screen
tdrStyle->SetCanvasDefY(0);
// For the Pad:
tdrStyle->SetPadBorderMode(0);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetPadGridX(false);
tdrStyle->SetPadGridY(false);
tdrStyle->SetGridColor(0);
tdrStyle->SetGridStyle(3);
tdrStyle->SetGridWidth(1);
// For the frame:
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
// For the histo:
tdrStyle->SetHistFillColor(0);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
//For the date:
tdrStyle->SetOptDate(0);
// For the statistics box:
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat("e");
tdrStyle->SetStatColor(kGray);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(0);
tdrStyle->SetStatX(1.); //Starting position on X axis
tdrStyle->SetStatY(1.); //Starting position on Y axis
tdrStyle->SetStatFontSize(0.025); //Vertical Size
tdrStyle->SetStatW(0.15); //Horizontal size
// tdrStyle->SetStatStyle(Style_t style = 1001);
// Margins:
tdrStyle->SetPadTopMargin(0.05);
tdrStyle->SetPadBottomMargin(0.125);
tdrStyle->SetPadLeftMargin(0.105);
tdrStyle->SetPadRightMargin(0.1);
// For the Global title:
// tdrStyle->SetOptTitle(0);
tdrStyle->SetTitleFont(42);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.05);
// For the axis titles:
tdrStyle->SetTitleColor(1, "XYZ");
tdrStyle->SetTitleFont(42, "XYZ");
tdrStyle->SetTitleSize(0.05, "XYZ");
tdrStyle->SetTitleXOffset(0.9);
tdrStyle->SetTitleYOffset(0.8);
tdrStyle->SetTitleOffset(0.7, "Y"); // Another way to set the Offset
// For the axis labels:
tdrStyle->SetLabelColor(1, "XYZ");
tdrStyle->SetLabelFont(42, "XYZ");
tdrStyle->SetLabelOffset(0.007, "XYZ");
tdrStyle->SetLabelSize(0.045, "XYZ");
// For the axis:
tdrStyle->SetAxisColor(1, "XYZ");
tdrStyle->SetStripDecimals(kTRUE);
tdrStyle->SetTickLength(0.03, "XYZ");
tdrStyle->SetNdivisions(510, "XYZ");
tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
tdrStyle->SetPadTickY(1);
//.........这里部分代码省略.........
示例11: setEgammaStyle
void setEgammaStyle() {
TStyle *egammaStyle = new TStyle("egammaStyle","Style for P-TDR");
// For the palette:
egammaStyle->SetPalette(1);
// For the grid
egammaStyle->SetPadGridX(1);
egammaStyle->SetPadGridY(1);
// For the canvas:
egammaStyle->SetCanvasBorderMode(0);
egammaStyle->SetCanvasBorderSize(2);
egammaStyle->SetCanvasColor(0);
//egammaStyle->SetCanvasDefH(600);
//egammaStyle->SetCanvasDefW(600);
egammaStyle->SetCanvasDefX(0);
egammaStyle->SetCanvasDefY(0);
// For the pad:
egammaStyle->SetPadBorderMode(0);
egammaStyle->SetPadColor(kWhite);
egammaStyle->SetPadGridX(false);
egammaStyle->SetPadGridY(false);
egammaStyle->SetGridColor(0);
egammaStyle->SetGridStyle(3);
egammaStyle->SetGridWidth(1);
// For the frame:
egammaStyle->SetFrameBorderMode(0);
egammaStyle->SetFrameBorderSize(1);
egammaStyle->SetFrameFillColor(0);
egammaStyle->SetFrameFillStyle(0);
egammaStyle->SetFrameLineColor(1);
egammaStyle->SetFrameLineStyle(1);
egammaStyle->SetFrameLineWidth(1);
// For the histos:
egammaStyle->SetHistLineColor(1);
egammaStyle->SetHistLineStyle(0);
egammaStyle->SetHistLineWidth(2); // chiara: era 1
egammaStyle->SetEndErrorSize(2);
egammaStyle->SetErrorX(0.);
// for the graphs
egammaStyle->SetMarkerColor(1);
egammaStyle->SetMarkerStyle(20);
egammaStyle->SetMarkerSize(1.1); // chiara: era 1.2
// For the fit/function:
egammaStyle->SetOptFit(1);
egammaStyle->SetFitFormat("5.4g");
egammaStyle->SetFuncColor(2);
egammaStyle->SetFuncStyle(1);
egammaStyle->SetFuncWidth(2); // chiara: era 1
//For the date:
egammaStyle->SetOptDate(0);
// For the statistics box:
egammaStyle->SetOptFile(0);
egammaStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
egammaStyle->SetStatColor(kWhite);
egammaStyle->SetStatFont(42);
egammaStyle->SetStatFontSize(0.025);
egammaStyle->SetStatTextColor(1);
egammaStyle->SetStatFormat("6.4g");
egammaStyle->SetStatBorderSize(1);
egammaStyle->SetStatH(0.1);
egammaStyle->SetStatW(0.15);
// For the Global title:
egammaStyle->SetOptTitle(1); // 0=No Title
egammaStyle->SetTitleFont(42);
egammaStyle->SetTitleColor(1);
egammaStyle->SetTitleTextColor(1);
egammaStyle->SetTitleFillColor(10);
egammaStyle->SetTitleFontSize(0.05);
// For the axis titles:
egammaStyle->SetTitleColor(1, "XYZ");
egammaStyle->SetTitleFont(42, "XYZ");
egammaStyle->SetTitleSize(0.05, "XYZ"); // chiara: era 0.06
// egammaStyle->SetTitleXOffset(0.9); // chiara
// egammaStyle->SetTitleYOffset(1.25); // chiara
// For the axis labels:
egammaStyle->SetLabelColor(1, "XYZ");
egammaStyle->SetLabelFont(42, "XYZ");
egammaStyle->SetLabelOffset(0.007, "XYZ"); // chiara
egammaStyle->SetLabelSize(0.04, "XYZ"); // chiara: era 0.05
// For the axis:
egammaStyle->SetAxisColor(1, "XYZ");
egammaStyle->SetStripDecimals(kTRUE);
egammaStyle->SetTickLength(0.03, "XYZ");
egammaStyle->SetNdivisions(510, "XYZ");
egammaStyle->SetPadTickX(0); // 0=Text labels (and tics) only on bottom, 1=Text labels on top and bottom
egammaStyle->SetPadTickY(1);
//.........这里部分代码省略.........
示例12: met
void met(){
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600); //Height of canvas
tdrStyle->SetCanvasDefW(600); //Width of canvas
tdrStyle->SetCanvasDefX(0); //POsition on screen
tdrStyle->SetCanvasDefY(0);
// For the Pad:
tdrStyle->SetPadBorderMode(0);
// tdrStyle->SetPadBorderSize(Width_t size = 1);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetPadGridX(true);
tdrStyle->SetPadGridY(true);
tdrStyle->SetGridColor(0);
tdrStyle->SetGridStyle(3);
tdrStyle->SetGridWidth(1);
// For the frame:
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
// For the histo:
// tdrStyle->SetHistFillColor(1);
// tdrStyle->SetHistFillStyle(0);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
// tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
// tdrStyle->SetNumberContours(Int_t number = 20);
tdrStyle->SetEndErrorSize(2);
// tdrStyle->SetErrorMarker(20);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncColor(2);
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
//For the date:
tdrStyle->SetOptDate(0);
// tdrStyle->SetDateX(Float_t x = 0.01);
// tdrStyle->SetDateY(Float_t y = 0.01);
// For the statistics box:
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr");
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.1);
tdrStyle->SetStatW(0.15);
// tdrStyle->SetStatStyle(Style_t style = 1001);
// tdrStyle->SetStatX(Float_t x = 0);
// tdrStyle->SetStatY(Float_t y = 0);
// Margins:
tdrStyle->SetPadTopMargin(0.07);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.13);
tdrStyle->SetPadRightMargin(0.05);
// For the Global title:
//tdrStyle->SetOptTitle(0);
tdrStyle->SetTitleFont(35);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.045);
// tdrStyle->SetTitleH(0); // Set the height of the title box
// tdrStyle->SetTitleW(0); // Set the width of the title box
tdrStyle->SetTitleX(0.15); // Set the position of the title box
// tdrStyle->SetTitleY(0.985); // Set the position of the title box
// tdrStyle->SetTitleStyle(Style_t style = 1001);
tdrStyle->SetTitleBorderSize(0);
// For the axis titles:
tdrStyle->SetTitleColor(1, "XYZ");
tdrStyle->SetTitleFont(42, "XYZ");
tdrStyle->SetTitleSize(0.04, "XYZ");
// tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
// tdrStyle->SetTitleYSize(Float_t size = 0.02);
tdrStyle->SetTitleXOffset(1.05);
//.........这里部分代码省略.........
示例13: FakeRate
void FakeRate() {
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600); //Height of canvas
tdrStyle->SetCanvasDefW(600); //Width of canvas
tdrStyle->SetCanvasDefX(0); //POsition on screen
tdrStyle->SetCanvasDefY(0);
// For the Pad:
tdrStyle->SetPadBorderMode(0);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetPadGridX(true);
tdrStyle->SetPadGridY(true);
tdrStyle->SetGridColor(0);
tdrStyle->SetGridStyle(3);
tdrStyle->SetGridWidth(1);
// For the frame:
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
// For the histo:
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
tdrStyle->SetEndErrorSize(2);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncColor(2);
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
//For the date:
tdrStyle->SetOptDate(0);
// For the statistics box:
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr");
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.1);
tdrStyle->SetStatW(0.15);
// Margins:
tdrStyle->SetPadTopMargin(0.07);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.13);
tdrStyle->SetPadRightMargin(0.05);
// For the Global title:
tdrStyle->SetTitleFont(35);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.045);
tdrStyle->SetTitleX(0.15); // Set the position of the title box
tdrStyle->SetTitleBorderSize(0);
// For the axis titles:
tdrStyle->SetTitleColor(1, "XYZ");
tdrStyle->SetTitleFont(42, "XYZ");
tdrStyle->SetTitleSize(0.04, "XYZ");
tdrStyle->SetTitleXOffset(0.9);
tdrStyle->SetTitleYOffset(1.5);
// For the axis labels:
tdrStyle->SetLabelColor(1, "XYZ");
tdrStyle->SetLabelFont(42, "XYZ");
tdrStyle->SetLabelOffset(0.007, "XYZ");
tdrStyle->SetLabelSize(0.03, "XYZ");
// For the axis:
tdrStyle->SetAxisColor(1, "XYZ");
tdrStyle->SetStripDecimals(kTRUE);
tdrStyle->SetTickLength(0.03, "XYZ");
tdrStyle->SetNdivisions(510, "XYZ");
tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
tdrStyle->SetPadTickY(1);
// Change for log plots:
tdrStyle->SetOptLogx(0);
tdrStyle->SetOptLogy(0);
//.........这里部分代码省略.........
示例14: teenyWeenyBtagEffCalculation
void teenyWeenyBtagEffCalculation(){
// TDR style crap - include from Utilities.cc
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600); //Height of canvas
tdrStyle->SetCanvasDefW(600); //Width of canvas
tdrStyle->SetCanvasDefX(0); //Position on screen
tdrStyle->SetCanvasDefY(0);
// For the Pad:
tdrStyle->SetPadBorderMode(0);
// tdrStyle->SetPadBorderSize(Width_t size = 1);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetPadGridX(false);
tdrStyle->SetPadGridY(false);
tdrStyle->SetGridColor(0);
tdrStyle->SetGridStyle(3);
tdrStyle->SetGridWidth(1);
// For the frame:
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
// For the histo:
// tdrStyle->SetHistFillColor(1);
// tdrStyle->SetHistFillStyle(0);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
// tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
// tdrStyle->SetNumberContours(Int_t number = 20);
tdrStyle->SetEndErrorSize(2);
//tdrStyle->SetErrorMarker(20);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncColor(2);
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
//For the date:
tdrStyle->SetOptDate(0);
// tdrStyle->SetDateX(Float_t x = 0.01);
// tdrStyle->SetDateY(Float_t y = 0.01);
// For the statistics box:
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.1);
tdrStyle->SetStatW(0.15);
// tdrStyle->SetStatStyle(Style_t style = 1001);
// tdrStyle->SetStatX(Float_t x = 0);
// tdrStyle->SetStatY(Float_t y = 0);
// Margins:
tdrStyle->SetPadTopMargin(0.05);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.16);
tdrStyle->SetPadRightMargin(0.04);
// For the Global title:
tdrStyle->SetOptTitle(0);
tdrStyle->SetTitleFont(42);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.05);
// tdrStyle->SetTitleH(0); // Set the height of the title box
// tdrStyle->SetTitleW(0); // Set the width of the title box
// tdrStyle->SetTitleX(0); // Set the position of the title box
// tdrStyle->SetTitleY(0.985); // Set the position of the title box
// tdrStyle->SetTitleStyle(Style_t style = 1001);
// tdrStyle->SetTitleBorderSize(2);
// For the axis titles:
tdrStyle->SetTitleColor(1, "XYZ");
tdrStyle->SetTitleFont(42, "XYZ");
tdrStyle->SetTitleSize(0.05, "XYZ");
// tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
//.........这里部分代码省略.........
示例15: roc_plot
void roc_plot(){
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(600); //Height of canvas
tdrStyle->SetCanvasDefW(600); //Width of canvas
tdrStyle->SetCanvasDefX(0); //POsition on screen
tdrStyle->SetCanvasDefY(0);
// For the Pad:
tdrStyle->SetPadBorderMode(0);
tdrStyle->SetPadColor(kWhite);
tdrStyle->SetPadGridX(true);
tdrStyle->SetPadGridY(true);
tdrStyle->SetGridColor(0);
tdrStyle->SetGridStyle(3);
tdrStyle->SetGridWidth(1);
// For the frame:
tdrStyle->SetFrameBorderMode(0);
tdrStyle->SetFrameBorderSize(1);
tdrStyle->SetFrameFillColor(0);
tdrStyle->SetFrameFillStyle(0);
tdrStyle->SetFrameLineColor(1);
tdrStyle->SetFrameLineStyle(1);
tdrStyle->SetFrameLineWidth(1);
// For the histo:
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
tdrStyle->SetEndErrorSize(2);
tdrStyle->SetErrorX(0.);
tdrStyle->SetMarkerStyle(20);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetFitFormat("5.4g");
tdrStyle->SetFuncColor(2);
tdrStyle->SetFuncStyle(1);
tdrStyle->SetFuncWidth(1);
//For the date:
tdrStyle->SetOptDate(0);
// For the statistics box:
tdrStyle->SetOptFile(0);
tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr");
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.1);
tdrStyle->SetStatW(0.15);
// Margins:
tdrStyle->SetPadTopMargin(0.05);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.13);
tdrStyle->SetPadRightMargin(0.05);
// For the Global title:
tdrStyle->SetOptTitle(0);
tdrStyle->SetTitleFont(42);
tdrStyle->SetTitleColor(1);
tdrStyle->SetTitleTextColor(1);
tdrStyle->SetTitleFillColor(10);
tdrStyle->SetTitleFontSize(0.05);
// For the axis titles:
tdrStyle->SetTitleColor(1, "XYZ");
tdrStyle->SetTitleFont(42, "XYZ");
tdrStyle->SetTitleSize(0.06, "XYZ");
tdrStyle->SetTitleXOffset(0.9);
tdrStyle->SetTitleYOffset(1.05);
// For the axis labels:
tdrStyle->SetLabelColor(1, "XYZ");
tdrStyle->SetLabelFont(42, "XYZ");
tdrStyle->SetLabelOffset(0.007, "XYZ");
tdrStyle->SetLabelSize(0.05, "XYZ");
// For the axis:
tdrStyle->SetAxisColor(1, "XYZ");
tdrStyle->SetStripDecimals(kTRUE);
tdrStyle->SetTickLength(0.03, "XYZ");
tdrStyle->SetNdivisions(510, "XYZ");
tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
tdrStyle->SetPadTickY(1);
// Change for log plots:
tdrStyle->SetOptLogx(0);
tdrStyle->SetOptLogy(0);
tdrStyle->SetOptLogz(0);
//.........这里部分代码省略.........