本文整理汇总了C++中TStyle::SetCanvasDefH方法的典型用法代码示例。如果您正苦于以下问题:C++ TStyle::SetCanvasDefH方法的具体用法?C++ TStyle::SetCanvasDefH怎么用?C++ TStyle::SetCanvasDefH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStyle
的用法示例。
在下文中一共展示了TStyle::SetCanvasDefH方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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(kBlack);
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();
}
示例2: WZPaperStyle
void WZPaperStyle()
{
TStyle* WZPaperStyle = new TStyle("WZPaperStyle", "WZPaperStyle");
gStyle = WZPaperStyle;
//----------------------------------------------------------------------------
// Canvas
//----------------------------------------------------------------------------
WZPaperStyle->SetCanvasBorderMode( 0);
WZPaperStyle->SetCanvasBorderSize( 10);
WZPaperStyle->SetCanvasColor ( 0);
WZPaperStyle->SetCanvasDefH (600);
WZPaperStyle->SetCanvasDefW (550);
WZPaperStyle->SetCanvasDefX ( 10);
WZPaperStyle->SetCanvasDefY ( 10);
//----------------------------------------------------------------------------
// Pad
//----------------------------------------------------------------------------
WZPaperStyle->SetPadBorderMode ( 0);
WZPaperStyle->SetPadBorderSize ( 10);
WZPaperStyle->SetPadColor ( 0);
WZPaperStyle->SetPadBottomMargin(0.20);
WZPaperStyle->SetPadTopMargin (0.08);
WZPaperStyle->SetPadLeftMargin (0.18);
WZPaperStyle->SetPadRightMargin (0.05);
//----------------------------------------------------------------------------
// Frame
//----------------------------------------------------------------------------
WZPaperStyle->SetFrameBorderMode( 0);
WZPaperStyle->SetFrameBorderSize(10);
WZPaperStyle->SetFrameFillStyle ( 0);
WZPaperStyle->SetFrameFillColor ( 0);
WZPaperStyle->SetFrameLineColor ( 1);
WZPaperStyle->SetFrameLineStyle ( 0);
WZPaperStyle->SetFrameLineWidth ( 2);
//----------------------------------------------------------------------------
// Hist
//----------------------------------------------------------------------------
WZPaperStyle->SetHistFillColor(0);
WZPaperStyle->SetHistFillStyle(1);
WZPaperStyle->SetHistLineColor(1);
WZPaperStyle->SetHistLineStyle(0);
WZPaperStyle->SetHistLineWidth(1);
//----------------------------------------------------------------------------
// Axis
//----------------------------------------------------------------------------
WZPaperStyle->SetLabelFont ( 42, "xyz");
WZPaperStyle->SetLabelOffset(0.015, "xyz");
WZPaperStyle->SetLabelSize (0.040, "xyz");
WZPaperStyle->SetNdivisions ( 505, "xyz");
WZPaperStyle->SetTitleFont ( 42, "xyz");
WZPaperStyle->SetTitleSize (0.040, "xyz");
WZPaperStyle->SetTitleOffset( 1.15, "x");
WZPaperStyle->SetTitleOffset( 1.15, "y");
WZPaperStyle->SetPadTickX ( 1);
WZPaperStyle->SetPadTickY ( 1);
//----------------------------------------------------------------------------
// Title
//----------------------------------------------------------------------------
WZPaperStyle->SetTitleAlign ( 33);
WZPaperStyle->SetTitleBorderSize( 0);
WZPaperStyle->SetTitleFillColor ( 10);
WZPaperStyle->SetTitleFont ( 42);
WZPaperStyle->SetTitleFontSize (0.045);
WZPaperStyle->SetTitleX (0.960);
WZPaperStyle->SetTitleY (0.990);
//----------------------------------------------------------------------------
// Stat
//----------------------------------------------------------------------------
WZPaperStyle->SetOptStat ( 0);
WZPaperStyle->SetStatBorderSize( 0);
WZPaperStyle->SetStatColor ( 10);
WZPaperStyle->SetStatFont ( 42);
WZPaperStyle->SetStatX (0.94);
WZPaperStyle->SetStatY (0.91);
}
示例3: SemiFormalStyle
// Create my custom FORMAL style
// *****************************
void SemiFormalStyle(void) {
std::cout << " *** void getSemiFormalStyle(void) *** Custom TStyle initialized!" << std::endl;
TStyle *semiFStyle = new TStyle("semiFStyle","Style for AN09");
// For the canvas:
semiFStyle->SetCanvasBorderMode(0);
semiFStyle->SetCanvasColor(kWhite);
semiFStyle->SetCanvasDefH(600); //Height of canvas
semiFStyle->SetCanvasDefW(600); //Width of canvas
semiFStyle->SetCanvasDefX(0); //POsition on screen
semiFStyle->SetCanvasDefY(0);
// For the Pad:
semiFStyle->SetPadBorderMode(0);
// semiFStyle->SetOptTitle(0); // delete histogram titles
// semiFStyle->SetPadBorderSize(Width_t size = 1);
semiFStyle->SetPadColor(kWhite);
semiFStyle->SetPadGridX(true);
semiFStyle->SetPadGridY(true);
semiFStyle->SetGridColor(0);
semiFStyle->SetGridStyle(3);
semiFStyle->SetGridWidth(1);
// For the frame:
semiFStyle->SetFrameBorderMode(0);
semiFStyle->SetFrameBorderSize(1);
semiFStyle->SetFrameFillColor(0);
semiFStyle->SetFrameFillStyle(0);
semiFStyle->SetFrameLineColor(1);
semiFStyle->SetFrameLineStyle(1);
semiFStyle->SetFrameLineWidth(1);
// For the histo:
// semiFStyle->SetHistFillColor(1);
// semiFStyle->SetHistFillStyle(0);
semiFStyle->SetHistLineColor(1);
semiFStyle->SetHistLineStyle(0);
semiFStyle->SetHistLineWidth(1);
// semiFStyle->SetLegoInnerR(Float_t rad = 0.5);
// semiFStyle->SetNumberContours(Int_t number = 20);
semiFStyle->SetEndErrorSize(2);
//semiFStyle->SetErrorMarker(20);
semiFStyle->SetErrorX(0.);
semiFStyle->SetMarkerStyle(20);
//For the fit/function:
semiFStyle->SetOptFit(1);
semiFStyle->SetFitFormat("5.4g");
semiFStyle->SetFuncColor(2);
semiFStyle->SetFuncStyle(1);
semiFStyle->SetFuncWidth(1);
//For the date:
semiFStyle->SetOptDate(1);
// For the statistics box:
semiFStyle->SetOptFile(0);
semiFStyle->SetOptStat("mnre"); // stats box
semiFStyle->SetOptFit(1111); // fit box
semiFStyle->SetStatColor(kWhite);
semiFStyle->SetStatFont(42);
semiFStyle->SetStatFontSize(0.025);
semiFStyle->SetStatTextColor(1);
semiFStyle->SetStatFormat("6.4g");
semiFStyle->SetStatBorderSize(1);
semiFStyle->SetStatH(0.1);
semiFStyle->SetStatW(0.15);
// Margins:
semiFStyle->SetPadTopMargin(0.15);
semiFStyle->SetPadBottomMargin(0.13);
semiFStyle->SetPadLeftMargin(0.13);
semiFStyle->SetPadRightMargin(0.15);
// For the Global title:
// semiFStyle->SetOptTitle(0);
semiFStyle->SetTitleFont(42);
semiFStyle->SetTitleColor(1);
semiFStyle->SetTitleTextColor(1);
semiFStyle->SetTitleFillColor(10);
semiFStyle->SetTitleFontSize(0.05);
// For the axis titles:
semiFStyle->SetTitleColor(1, "XYZ");
semiFStyle->SetTitleFont(42, "XYZ");
semiFStyle->SetTitleSize(0.06, "XYZ");
semiFStyle->SetTitleXOffset(1.5);
semiFStyle->SetTitleYOffset(1.5);
semiFStyle->SetTitleOffset(1.5, "Y"); // Another way to set the Offset
// For the axis labels:
semiFStyle->SetLabelColor(1, "XYZ");
semiFStyle->SetLabelFont(42, "XYZ");
semiFStyle->SetLabelOffset(0.007, "XYZ");
semiFStyle->SetLabelSize(0.05, "XYZ");
//.........这里部分代码省略.........
示例4: SetStyle
void SetStyle()
{
TStyle *MITStyle = new TStyle("MIT-Style","The Perfect Style for Plots ;-)");
gStyle = MITStyle;
// Canvas
MITStyle->SetCanvasColor (0);
MITStyle->SetCanvasBorderSize(10);
MITStyle->SetCanvasBorderMode(0);
MITStyle->SetCanvasDefH (700);
MITStyle->SetCanvasDefW (700);
MITStyle->SetCanvasDefX (100);
MITStyle->SetCanvasDefY (100);
// Pads
MITStyle->SetPadColor (0);
MITStyle->SetPadBorderSize (10);
MITStyle->SetPadBorderMode (0);
MITStyle->SetPadBottomMargin(0.13);
MITStyle->SetPadTopMargin (0.08);
MITStyle->SetPadLeftMargin (0.15);
MITStyle->SetPadRightMargin (0.05);
MITStyle->SetPadGridX (0);
MITStyle->SetPadGridY (0);
MITStyle->SetPadTickX (0);
MITStyle->SetPadTickY (0);
// Frames
MITStyle->SetFrameFillStyle ( 0);
MITStyle->SetFrameFillColor ( 0);
MITStyle->SetFrameLineColor ( 1);
MITStyle->SetFrameLineStyle ( 0);
MITStyle->SetFrameLineWidth ( 1);
MITStyle->SetFrameBorderSize(10);
MITStyle->SetFrameBorderMode( 0);
// Histograms
MITStyle->SetHistFillColor(2);
MITStyle->SetHistFillStyle(0);
MITStyle->SetHistLineColor(1);
MITStyle->SetHistLineStyle(0);
MITStyle->SetHistLineWidth(2);
MITStyle->SetNdivisions(505);
// Functions
MITStyle->SetFuncColor(1);
MITStyle->SetFuncStyle(0);
MITStyle->SetFuncWidth(2);
// Various
MITStyle->SetMarkerStyle(20);
MITStyle->SetMarkerColor(kBlack);
MITStyle->SetMarkerSize (1.2);
MITStyle->SetTitleSize (0.055,"X");
MITStyle->SetTitleOffset(1.200,"X");
MITStyle->SetLabelOffset(0.005,"X");
MITStyle->SetLabelSize (0.050,"X");
MITStyle->SetLabelFont (42 ,"X");
MITStyle->SetStripDecimals(kFALSE);
MITStyle->SetTitleSize (0.055,"Y");
MITStyle->SetTitleOffset(1.800,"Y");
MITStyle->SetLabelOffset(0.010,"Y");
MITStyle->SetLabelSize (0.050,"Y");
MITStyle->SetLabelFont (42 ,"Y");
MITStyle->SetTextSize (0.055);
MITStyle->SetTextFont (42);
MITStyle->SetStatFont (42);
MITStyle->SetTitleFont (42);
MITStyle->SetTitleFont (42,"X");
MITStyle->SetTitleFont (42,"Y");
MITStyle->SetOptStat (0);
return;
}
示例5: electronCompare
int electronCompare()
{
TString CMP_DIR = gSystem->Getenv( "CMP_DIR" ) ;
TString CMP_URL = gSystem->Getenv( "CMP_URL" ) ;
TString CMP_TITLE = gSystem->Getenv( "CMP_TITLE" ) ;
TString CMP_RED_FILE = gSystem->Getenv( "CMP_RED_FILE" ) ;
TString CMP_BLUE_FILE = gSystem->Getenv( "CMP_BLUE_FILE" ) ;
TString CMP_RED_NAME = gSystem->Getenv( "CMP_RED_NAME" ) ;
TString CMP_BLUE_NAME = gSystem->Getenv( "CMP_BLUE_NAME" ) ;
TString CMP_RED_COMMENT = gSystem->Getenv( "CMP_RED_COMMENT" ) ;
TString CMP_BLUE_COMMENT = gSystem->Getenv( "CMP_BLUE_COMMENT" ) ;
TString CMP_CONFIG = gSystem->Getenv( "CMP_CONFIG" ) ;
TString CMP_RED_RELEASE = gSystem->Getenv( "CMP_RED_RELEASE" ) ;
TString CMP_BLUE_RELEASE = gSystem->Getenv( "CMP_BLUE_RELEASE" ) ;
//-----
// AC
// std::cout << "red_file : C : " << CMP_RED_FILE << std::endl;
// std::cout << "blue_file : C : " << CMP_BLUE_FILE << std::endl;
std::cout << "red_release : C : " << CMP_RED_RELEASE << std::endl;
std::cout << "blue_release : C : " << CMP_BLUE_RELEASE << std::endl;
//-----
// style:
TStyle *eleStyle = new TStyle("eleStyle","Style for electron validation");
eleStyle->SetCanvasBorderMode(0);
eleStyle->SetCanvasColor(kWhite);
eleStyle->SetCanvasDefH(600);
eleStyle->SetCanvasDefW(800);
eleStyle->SetCanvasDefX(0);
eleStyle->SetCanvasDefY(0);
eleStyle->SetPadBorderMode(0);
eleStyle->SetPadColor(kWhite);
eleStyle->SetPadGridX(false);
eleStyle->SetPadGridY(false);
eleStyle->SetGridColor(0);
eleStyle->SetGridStyle(3);
eleStyle->SetGridWidth(1);
eleStyle->SetOptStat(1);
eleStyle->SetPadTickX(1);
eleStyle->SetPadTickY(1);
eleStyle->SetHistLineColor(1);
eleStyle->SetHistLineStyle(0);
eleStyle->SetHistLineWidth(2);
eleStyle->SetEndErrorSize(2);
eleStyle->SetErrorX(0.);
eleStyle->SetOptStat(1);
eleStyle->SetTitleColor(1, "XYZ");
eleStyle->SetTitleFont(42, "XYZ");
eleStyle->SetTitleXOffset(1.0);
eleStyle->SetTitleYOffset(1.0);
eleStyle->SetLabelOffset(0.005, "XYZ");
eleStyle->SetTitleSize(0.05, "XYZ");
eleStyle->SetTitleFont(22,"X");
eleStyle->SetTitleFont(22,"Y");
eleStyle->SetHistLineWidth(2);
eleStyle->SetPadBottomMargin(0.13);
eleStyle->SetPadLeftMargin(0.15);
eleStyle->SetMarkerStyle(21);
eleStyle->SetMarkerSize(0.8);
//-- AC --
eleStyle->SetPadRightMargin(0.2) ;
eleStyle->cd();
gROOT->ForceStyle();
TString internal_path("DQMData/Run 1/EgammaV/Run summary/") ;
TString old_internal_path("DQMData/EgammaV/") ;
TString file_ref_dir ;
TFile * file_ref = 0 ;
if ( CMP_BLUE_FILE != "" )
{
file_ref = TFile::Open(CMP_BLUE_FILE) ;
if (file_ref!=0)
{
std::cout<<"open "<<CMP_BLUE_FILE<<std::endl ;
if (file_ref->cd(internal_path)==kTRUE)
{
std::cerr<<"cd "<<internal_path<<std::endl ;
file_ref_dir = internal_path ;
file_ref->cd() ;
}
else if (file_ref->cd(old_internal_path)==kTRUE)
{
std::cerr<<"cd "<<old_internal_path<<std::endl ;
file_ref_dir = old_internal_path ;
file_ref->cd() ;
}
else
{
std::cerr<<"Failed move to: "<<internal_path<<" and "<<old_internal_path<<std::endl ;
file_ref_dir = "" ;
}
}
else
{ std::cerr<<"Failed to open: "<<CMP_BLUE_FILE<<std::endl ; }
}
//.........这里部分代码省略.........
示例6: setTDRStyle
void setTDRStyle() {
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasColor(kWhite);
tdrStyle->SetCanvasDefH(750); //Height of canvas
tdrStyle->SetCanvasDefW(1050); //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.010);
tdrStyle->SetStatTextColor(1);
tdrStyle->SetStatFormat("6.4g");
tdrStyle->SetStatBorderSize(1);
tdrStyle->SetStatH(0.25);
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.14);
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.005);
// 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.06, "XYZ");
// tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
// tdrStyle->SetTitleYSize(Float_t size = 0.02);
//.........这里部分代码省略.........
开发者ID:latinos,项目名称:UserCode-HZZ4L_Combination-CombinationPy,代码行数:101,代码来源:extractSignificanceStats_add.C
示例7: 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);
//.........这里部分代码省略.........
示例8: setTDRStyle
void setTDRStyle() {
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
tdrStyle->SetCanvasColor (0);
tdrStyle->SetCanvasBorderSize(10);
tdrStyle->SetCanvasBorderMode(0);
tdrStyle->SetCanvasDefH (700);
tdrStyle->SetCanvasDefW (700);
tdrStyle->SetCanvasDefX (100);
tdrStyle->SetCanvasDefY (100);
// color palette for 2D temperature plots
tdrStyle->SetPalette(1,0);
// Pads
tdrStyle->SetPadColor (0);
tdrStyle->SetPadBorderSize (5);
tdrStyle->SetPadBorderMode (0);
tdrStyle->SetPadBorderMode (0);
tdrStyle->SetPadBottomMargin(0.15);
tdrStyle->SetPadTopMargin (0.08);
tdrStyle->SetPadLeftMargin (0.12);
tdrStyle->SetPadRightMargin (0.07);
tdrStyle->SetPadGridX (0);
tdrStyle->SetPadGridY (0);
tdrStyle->SetPadTickX (1);
tdrStyle->SetPadTickY (1);
// Frames
tdrStyle->SetLineWidth(3);
tdrStyle->SetFrameFillStyle ( 0);
tdrStyle->SetFrameFillColor ( 0);
tdrStyle->SetFrameLineColor ( 1);
tdrStyle->SetFrameLineStyle ( 0);
tdrStyle->SetFrameLineWidth ( 2);
tdrStyle->SetFrameBorderSize(5);
tdrStyle->SetFrameBorderMode( 0);
tdrStyle->SetFillStyle( 0);
// Histograms
tdrStyle->SetHistFillColor(2);
tdrStyle->SetHistFillStyle(0);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(4);
tdrStyle->SetNdivisions(510);
// Functions
tdrStyle->SetFuncColor(1);
tdrStyle->SetFuncStyle(0);
tdrStyle->SetFuncWidth(2);
// Various
tdrStyle->SetMarkerStyle(20);
tdrStyle->SetMarkerColor(kBlack);
tdrStyle->SetMarkerSize (1.4);
tdrStyle->SetTitleBorderSize(0);
tdrStyle->SetTitleFillColor (0);
tdrStyle->SetTitleX (0.2);
tdrStyle->SetTitleSize (0.055,"X");
tdrStyle->SetTitleOffset(1.200,"X");
tdrStyle->SetLabelOffset(0.005,"X");
tdrStyle->SetLabelSize (0.050,"X");
tdrStyle->SetLabelFont (42 ,"X");
tdrStyle->SetStripDecimals(kFALSE);
tdrStyle->SetTitleSize (0.055,"Y");
tdrStyle->SetTitleOffset(1.000,"Y");
tdrStyle->SetLabelOffset(0.010,"Y");
tdrStyle->SetLabelSize (0.050,"Y");
tdrStyle->SetLabelFont (42 ,"Y");
tdrStyle->SetTextSize (0.055);
tdrStyle->SetTextFont (42);
tdrStyle->SetStatFont (42);
tdrStyle->SetTitleFont (42);
tdrStyle->SetTitleFont (42,"X");
tdrStyle->SetTitleFont (42,"Y");
tdrStyle->SetOptStat (0);
tdrStyle->SetOptTitle (0);
tdrStyle->SetLineStyleString(11,"20 10");
tdrStyle->SetLegendBorderSize(0);
tdrStyle->cd();
}
示例9: getStyle
/*
* Define different TStyles; use them with:
* getStyle->cd();
*
* 2003 NCA
*/
TStyle * getStyle(TString name="myStyle")
{
TStyle *theStyle;
if ( name == "myStyle" ) {
theStyle = new TStyle("myStyle", "myStyle");
// theStyle->SetOptStat(0);
theStyle->SetPadBorderMode(0);
theStyle->SetCanvasBorderMode(0);
theStyle->SetPadColor(0);
theStyle->SetCanvasColor(0);
theStyle->SetMarkerStyle(8);
theStyle->SetMarkerSize(0.7);
theStyle->SetStatH(0.3);
theStyle->SetStatW(0.15);
// theStyle->SetTextFont(132);
// theStyle->SetTitleFont(132);
theStyle->SetTitleBorderSize(1);
theStyle->SetPalette(1);
} else if( name == "tdr" ) {
theStyle = new TStyle("tdrStyle","Style for P-TDR");
// For the canvas:
theStyle->SetCanvasBorderMode(0);
theStyle->SetCanvasColor(kWhite);
theStyle->SetCanvasDefH(600); //Height of canvas
theStyle->SetCanvasDefW(600); //Width of canvas
theStyle->SetCanvasDefX(0); //POsition on screen
theStyle->SetCanvasDefY(0);
// For the Pad:
theStyle->SetPadBorderMode(0);
// theStyle->SetPadBorderSize(Width_t size = 1);
theStyle->SetPadColor(kWhite);
theStyle->SetPadGridX(true);
theStyle->SetPadGridY(true);
theStyle->SetGridColor(0);
theStyle->SetGridStyle(3);
theStyle->SetGridWidth(1);
// For the frame:
theStyle->SetFrameBorderMode(0);
theStyle->SetFrameBorderSize(1);
theStyle->SetFrameFillColor(0);
theStyle->SetFrameFillStyle(0);
theStyle->SetFrameLineColor(1);
theStyle->SetFrameLineStyle(1);
theStyle->SetFrameLineWidth(1);
// For the histo:
// theStyle->SetHistFillColor(1);
// theStyle->SetHistFillStyle(0);
theStyle->SetHistLineColor(1);
theStyle->SetHistLineStyle(0);
theStyle->SetHistLineWidth(1);
// theStyle->SetLegoInnerR(Float_t rad = 0.5);
// theStyle->SetNumberContours(Int_t number = 20);
theStyle->SetEndErrorSize(2);
// theStyle->SetErrorMarker(20);
theStyle->SetErrorX(0.);
theStyle->SetMarkerStyle(20);
//For the fit/function:
theStyle->SetOptFit(1);
theStyle->SetFitFormat("5.4g");
theStyle->SetFuncColor(2);
theStyle->SetFuncStyle(1);
theStyle->SetFuncWidth(1);
//For the date:
theStyle->SetOptDate(0);
// theStyle->SetDateX(Float_t x = 0.01);
// theStyle->SetDateY(Float_t y = 0.01);
// For the statistics box:
theStyle->SetOptFile(0);
// theStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
theStyle->SetOptStat(10);
theStyle->SetStatColor(kWhite);
theStyle->SetStatFont(42);
theStyle->SetStatFontSize(0.07);
theStyle->SetStatTextColor(1);
theStyle->SetStatFormat("6.4g");
theStyle->SetStatBorderSize(1);
theStyle->SetStatH(0.3);
theStyle->SetStatW(0.2);
// theStyle->SetStatStyle(Style_t style = 1001);
// theStyle->SetStatX(Float_t x = 0);
// theStyle->SetStatY(Float_t y = 0);
// Margins:
theStyle->SetPadTopMargin(0.05);
//.........这里部分代码省略.........
示例10: Style
void Style(){
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(1100); //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);
tdrStyle->SetHistLineWidth(1.5);
//For the fit/function:
tdrStyle->SetOptFit(1);
tdrStyle->SetStatColor(kWhite);
tdrStyle->SetStatFont(42);
tdrStyle->SetStatFontSize(0.025);
tdrStyle->SetOptStat(000000);
tdrStyle->SetStatColor(kWhite);
// Margins:
tdrStyle->SetPadTopMargin(0.05);
tdrStyle->SetPadBottomMargin(0.13);
tdrStyle->SetPadLeftMargin(0.10);
tdrStyle->SetPadRightMargin(0.02);
// 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.04, "XYZ");
tdrStyle->SetTitleXOffset(1.1);
tdrStyle->SetTitleYOffset(1.1);
// For the axis labels:
tdrStyle->SetLabelColor(1, "XYZ");
tdrStyle->SetLabelFont(42, "XYZ");
tdrStyle->SetLabelOffset(0.007, "XYZ");
tdrStyle->SetLabelSize(0.04, "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);
// Postscript options:
tdrStyle->SetPaperSize(20.,20.);
tdrStyle->cd();
gStyle->SetFillColor(-1);
}
示例11: 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?
//.........这里部分代码省略.........
示例12: 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);
//.........这里部分代码省略.........
示例13: setNCUStyle
void setNCUStyle(bool gridOn=false) {
TStyle* ncuStyle = new TStyle("ncuStyle","Style for P-NCU");
// For the canvas:
ncuStyle->SetCanvasBorderMode(0);
ncuStyle->SetCanvasColor(kWhite);
ncuStyle->SetCanvasDefH(600); //Height of canvas
ncuStyle->SetCanvasDefW(600); //Width of canvas
ncuStyle->SetCanvasDefX(0); //POsition on screen
ncuStyle->SetCanvasDefY(0);
// For the Pad:
ncuStyle->SetPadBorderMode(0);
// ncuStyle->SetPadBorderSize(Width_t size = 1);
ncuStyle->SetPadColor(kWhite);
ncuStyle->SetPadGridX(gridOn);
ncuStyle->SetPadGridY(gridOn);
ncuStyle->SetGridColor(0);
ncuStyle->SetGridStyle(3);
ncuStyle->SetGridWidth(1);
// For the frame:
ncuStyle->SetFrameBorderMode(0);
ncuStyle->SetFrameBorderSize(1);
ncuStyle->SetFrameFillColor(0);
ncuStyle->SetFrameFillStyle(0);
ncuStyle->SetFrameLineColor(1);
ncuStyle->SetFrameLineStyle(1);
ncuStyle->SetFrameLineWidth(3);
// For the Legend:
ncuStyle->SetLegendBorderSize(0);
ncuStyle->SetLegendFillColor(0);
ncuStyle->SetLegendFont(42);
//ncuStyle->SetLegendFont(62);
// For the histo:
// ncuStyle->SetHistFillColor(1);
// ncuStyle->SetHistFillStyle(0);
ncuStyle->SetHistLineColor(1);
ncuStyle->SetHistLineStyle(0);
ncuStyle->SetHistLineWidth(3);
// ncuStyle->SetLegoInnerR(Float_t rad = 0.5);
// ncuStyle->SetNumberContours(Int_t number = 20);
ncuStyle->SetEndErrorSize(2);
// ncuStyle->SetErrorMarker(20);
//ncuStyle->SetErrorX(0.);
ncuStyle->SetMarkerStyle(20);
//For the fit/function:
ncuStyle->SetOptFit(1);
ncuStyle->SetFitFormat("5.4g");
ncuStyle->SetFuncColor(2);
ncuStyle->SetFuncStyle(1);
ncuStyle->SetFuncWidth(1);
//For the date:
ncuStyle->SetOptDate(0);
// ncuStyle->SetDateX(Float_t x = 0.01);
// ncuStyle->SetDateY(Float_t y = 0.01);
// For the statistics box:
ncuStyle->SetOptFile(0);
ncuStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
ncuStyle->SetStatColor(kWhite);
ncuStyle->SetStatFont(42);
ncuStyle->SetStatFontSize(0.025);
ncuStyle->SetStatTextColor(1);
ncuStyle->SetStatFormat("6.4g");
ncuStyle->SetStatBorderSize(1);
ncuStyle->SetStatH(0.1);
ncuStyle->SetStatW(0.15);
// ncuStyle->SetStatStyle(Style_t style = 1001);
// ncuStyle->SetStatX(Float_t x = 0);
// ncuStyle->SetStatY(Float_t y = 0);
// Margins:
ncuStyle->SetPadTopMargin(0.08);
ncuStyle->SetPadBottomMargin(0.13);
ncuStyle->SetPadLeftMargin(0.13);
ncuStyle->SetPadRightMargin(0.04);
// For the Global title:
ncuStyle->SetOptTitle(0);
ncuStyle->SetTitleFont(62);
ncuStyle->SetTitleColor(1);
ncuStyle->SetTitleTextColor(1);
ncuStyle->SetTitleFillColor(10);
ncuStyle->SetTitleFontSize(0.05);
// ncuStyle->SetTitleH(0); // Set the height of the title box
// ncuStyle->SetTitleW(0); // Set the width of the title box
// ncuStyle->SetTitleX(0); // Set the position of the title box
// ncuStyle->SetTitleY(0.985); // Set the position of the title box
// ncuStyle->SetTitleStyle(Style_t style = 1001);
// ncuStyle->SetTitleBorderSize(2);
// For the axis titles:
//.........这里部分代码省略.........
示例14: setTDRStyle
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->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(63);
// tdrStyle->SetHistFillStyle(0);
tdrStyle->SetHistLineColor(1);
tdrStyle->SetHistLineStyle(0);
tdrStyle->SetHistLineWidth(1);
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(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.1);
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.04, "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
//.........这里部分代码省略.........
示例15: 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);
//.........这里部分代码省略.........