ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/setTDRStyle.C
Revision: 1.1
Committed: Wed Jun 22 11:07:38 2011 UTC (13 years, 10 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Log Message:
Initial commit of Plotting tools

File Contents

# User Rev Content
1 buchmann 1.1 #include "TStyle.h"
2    
3     void setTDRStyle() {
4     TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
5    
6     // For the canvas:
7     tdrStyle->SetCanvasBorderMode(0);
8     tdrStyle->SetCanvasColor(kWhite);
9     tdrStyle->SetCanvasDefH(600); //Height of canvas
10     tdrStyle->SetCanvasDefW(600); //Width of canvas
11     tdrStyle->SetCanvasDefX(0); //POsition on screen
12     tdrStyle->SetCanvasDefY(0);
13    
14     // For the Pad:
15     tdrStyle->SetPadBorderMode(0);
16     // tdrStyle->SetPadBorderSize(Width_t size = 1);
17     tdrStyle->SetPadColor(kWhite);
18     tdrStyle->SetPadGridX(false);
19     tdrStyle->SetPadGridY(false);
20     tdrStyle->SetGridColor(0);
21     tdrStyle->SetGridStyle(3);
22     tdrStyle->SetGridWidth(1);
23    
24     // For the frame:
25     tdrStyle->SetFrameBorderMode(0);
26     tdrStyle->SetFrameBorderSize(1);
27     tdrStyle->SetFrameFillColor(0);
28     tdrStyle->SetFrameFillStyle(0);
29     tdrStyle->SetFrameLineColor(1);
30     tdrStyle->SetFrameLineStyle(1);
31     tdrStyle->SetFrameLineWidth(1);
32    
33     // For the histo:
34     // tdrStyle->SetHistFillColor(1);
35     // tdrStyle->SetHistFillStyle(0);
36     tdrStyle->SetHistLineColor(1);
37     tdrStyle->SetHistLineStyle(0);
38     tdrStyle->SetHistLineWidth(1);
39     // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
40     // tdrStyle->SetNumberContours(Int_t number = 20);
41    
42     tdrStyle->SetEndErrorSize(2);
43     //tdrStyle->SetErrorMarker(20);
44     tdrStyle->SetErrorX(0.);
45    
46     tdrStyle->SetMarkerStyle(20);
47    
48     //For the fit/function:
49     tdrStyle->SetOptFit(1);
50     tdrStyle->SetFitFormat("5.4g");
51     tdrStyle->SetFuncColor(2);
52     tdrStyle->SetFuncStyle(1);
53     tdrStyle->SetFuncWidth(1);
54    
55     //For the date:
56     tdrStyle->SetOptDate(0);
57     // tdrStyle->SetDateX(Float_t x = 0.01);
58     // tdrStyle->SetDateY(Float_t y = 0.01);
59    
60     // For the statistics box:
61     tdrStyle->SetOptFile(0);
62     tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
63     tdrStyle->SetStatColor(kWhite);
64     tdrStyle->SetStatFont(42);
65     tdrStyle->SetStatFontSize(0.025);
66     tdrStyle->SetStatTextColor(1);
67     tdrStyle->SetStatFormat("6.4g");
68     tdrStyle->SetStatBorderSize(1);
69     tdrStyle->SetStatH(0.1);
70     tdrStyle->SetStatW(0.15);
71     // tdrStyle->SetStatStyle(Style_t style = 1001);
72     // tdrStyle->SetStatX(Float_t x = 0);
73     // tdrStyle->SetStatY(Float_t y = 0);
74    
75     // Margins:
76     tdrStyle->SetPadTopMargin(0.05);
77     tdrStyle->SetPadBottomMargin(0.13);
78     tdrStyle->SetPadLeftMargin(0.13);
79     tdrStyle->SetPadRightMargin(0.05);
80    
81     // For the Global title:
82    
83     // tdrStyle->SetOptTitle(0);
84     tdrStyle->SetTitleFont(42);
85     tdrStyle->SetTitleColor(1);
86     tdrStyle->SetTitleTextColor(1);
87     tdrStyle->SetTitleFillColor(10);
88     tdrStyle->SetTitleFontSize(0.05);
89     // tdrStyle->SetTitleH(0); // Set the height of the title box
90     // tdrStyle->SetTitleW(0); // Set the width of the title box
91     // tdrStyle->SetTitleX(0); // Set the position of the title box
92     // tdrStyle->SetTitleY(0.985); // Set the position of the title box
93     // tdrStyle->SetTitleStyle(Style_t style = 1001);
94     // tdrStyle->SetTitleBorderSize(2);
95    
96     // For the axis titles:
97    
98     tdrStyle->SetTitleColor(1, "XYZ");
99     tdrStyle->SetTitleFont(42, "XYZ");
100     tdrStyle->SetTitleSize(0.06, "XYZ");
101     // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
102     // tdrStyle->SetTitleYSize(Float_t size = 0.02);
103     tdrStyle->SetTitleXOffset(0.9);
104     tdrStyle->SetTitleYOffset(1.05);
105     // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
106    
107     // For the axis labels:
108    
109     tdrStyle->SetLabelColor(1, "XYZ");
110     tdrStyle->SetLabelFont(42, "XYZ");
111     tdrStyle->SetLabelOffset(0.007, "XYZ");
112     tdrStyle->SetLabelSize(0.05, "XYZ");
113    
114     // For the axis:
115    
116     tdrStyle->SetAxisColor(1, "XYZ");
117     tdrStyle->SetStripDecimals(kTRUE);
118     tdrStyle->SetTickLength(0.03, "XYZ");
119     tdrStyle->SetNdivisions(510, "XYZ");
120     tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
121     tdrStyle->SetPadTickY(1);
122    
123     // Change for log plots:
124     tdrStyle->SetOptLogx(0);
125     tdrStyle->SetOptLogy(0);
126     tdrStyle->SetOptLogz(0);
127    
128     // Postscript options:
129     // tdrStyle->SetPaperSize(15.,15.);
130     // tdrStyle->SetLineScalePS(Float_t scale = 3);
131     // tdrStyle->SetLineStyleString(Int_t i, const char* text);
132     // tdrStyle->SetHeaderPS(const char* header);
133     // tdrStyle->SetTitlePS(const char* pstitle);
134    
135     // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
136     // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
137     // tdrStyle->SetPaintTextFormat(const char* format = "g");
138     // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
139     // tdrStyle->SetTimeOffset(Double_t toffset);
140     // tdrStyle->SetHistMinimumZero(kTRUE);
141    
142     tdrStyle->cd();
143     }