This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| plot:cms_lumi [2016/09/22 22:17] – created iwn | plot:cms_lumi [2016/09/24 01:19] (current) – removed iwn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <file python tdrstyle.py> | ||
| - | import ROOT as rt | ||
| - | def tdrGrid( gridOn): | ||
| - | tdrStyle.SetPadGridX(gridOn) | ||
| - | tdrStyle.SetPadGridY(gridOn) | ||
| - | |||
| - | # | ||
| - | def fixOverlay(): | ||
| - | |||
| - | def setTDRStyle(): | ||
| - | tdrStyle = rt.TStyle(" | ||
| - | |||
| - | #for the canvas: | ||
| - | tdrStyle.SetCanvasBorderMode(0) | ||
| - | tdrStyle.SetCanvasColor(rt.kWhite) | ||
| - | tdrStyle.SetCanvasDefH(600) #Height of canvas | ||
| - | tdrStyle.SetCanvasDefW(600) #Width of canvas | ||
| - | tdrStyle.SetCanvasDefX(0) | ||
| - | tdrStyle.SetCanvasDefY(0) | ||
| - | |||
| - | |||
| - | tdrStyle.SetPadBorderMode(0) | ||
| - | # | ||
| - | tdrStyle.SetPadColor(rt.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.SetMarkerStyle(20) | ||
| - | | ||
| - | #For the fit/ | ||
| - | tdrStyle.SetOptFit(1) | ||
| - | tdrStyle.SetFitFormat(" | ||
| - | 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: | ||
| - | tdrStyle.SetStatColor(rt.kWhite) | ||
| - | tdrStyle.SetStatFont(42) | ||
| - | tdrStyle.SetStatFontSize(0.025) | ||
| - | tdrStyle.SetStatTextColor(1) | ||
| - | tdrStyle.SetStatFormat(" | ||
| - | 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.02) | ||
| - | |||
| - | # 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, | ||
| - | tdrStyle.SetTitleFont(42, | ||
| - | tdrStyle.SetTitleSize(0.06, | ||
| - | # tdrStyle.SetTitleXSize(Float_t size = 0.02) # Another way to set the size? | ||
| - | # tdrStyle.SetTitleYSize(Float_t size = 0.02) | ||
| - | tdrStyle.SetTitleXOffset(0.9) | ||
| - | tdrStyle.SetTitleYOffset(1.25) | ||
| - | # tdrStyle.SetTitleOffset(1.1, | ||
| - | |||
| - | # For the axis labels: | ||
| - | |||
| - | tdrStyle.SetLabelColor(1, | ||
| - | tdrStyle.SetLabelFont(42, | ||
| - | tdrStyle.SetLabelOffset(0.007, | ||
| - | tdrStyle.SetLabelSize(0.05, | ||
| - | |||
| - | # For the axis: | ||
| - | |||
| - | tdrStyle.SetAxisColor(1, | ||
| - | tdrStyle.SetStripDecimals(True) | ||
| - | tdrStyle.SetTickLength(0.03, | ||
| - | tdrStyle.SetNdivisions(510, | ||
| - | tdrStyle.SetPadTickX(1) | ||
| - | tdrStyle.SetPadTickY(1) | ||
| - | |||
| - | # Change for log plots: | ||
| - | tdrStyle.SetOptLogx(0) | ||
| - | tdrStyle.SetOptLogy(0) | ||
| - | tdrStyle.SetOptLogz(0) | ||
| - | |||
| - | # Postscript options: | ||
| - | tdrStyle.SetPaperSize(20., | ||
| - | # tdrStyle.SetLineScalePS(Float_t scale = 3) | ||
| - | # tdrStyle.SetLineStyleString(Int_t i, const char* text) | ||
| - | # tdrStyle.SetHeaderPS(const char* header) | ||
| - | # tdrStyle.SetTitlePS(const char* pstitle) | ||
| - | |||
| - | # tdrStyle.SetBarOffset(Float_t baroff = 0.5) | ||
| - | # tdrStyle.SetBarWidth(Float_t barwidth = 0.5) | ||
| - | # tdrStyle.SetPaintTextFormat(const char* format = " | ||
| - | # tdrStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0) | ||
| - | # tdrStyle.SetTimeOffset(Double_t toffset) | ||
| - | # tdrStyle.SetHistMinimumZero(kTRUE) | ||
| - | |||
| - | tdrStyle.SetHatchesLineWidth(5) | ||
| - | tdrStyle.SetHatchesSpacing(0.05) | ||
| - | |||
| - | tdrStyle.cd() | ||
| - | </ | ||