ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/setTDRStyle.C
Revision: 1.5
Committed: Tue Aug 9 13:48:10 2011 UTC (13 years, 9 months ago) by fronga
Content type: text/plain
Branch: MAIN
Changes since 1.4: +1 -1 lines
Log Message:
Remove histogram title option.

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 fronga 1.4 tdrStyle->SetHistLineWidth(2);
39 buchmann 1.1 // 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 fronga 1.4 tdrStyle->SetFuncWidth(2);
54 buchmann 1.1
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 fronga 1.4 tdrStyle->SetOptStat(0);
63     // tdrStyle->SetOptStat("oueMri"); // To display the mean and RMS: SetOptStat("mr");
64 buchmann 1.1 tdrStyle->SetStatColor(kWhite);
65     tdrStyle->SetStatFont(42);
66     tdrStyle->SetStatFontSize(0.025);
67     tdrStyle->SetStatTextColor(1);
68     tdrStyle->SetStatFormat("6.4g");
69     tdrStyle->SetStatBorderSize(1);
70 fronga 1.4 tdrStyle->SetStatH(0.12);
71     tdrStyle->SetStatW(0.18);
72 buchmann 1.1 // tdrStyle->SetStatStyle(Style_t style = 1001);
73     // tdrStyle->SetStatX(Float_t x = 0);
74     // tdrStyle->SetStatY(Float_t y = 0);
75    
76     // Margins:
77 buchmann 1.2 tdrStyle->SetPadTopMargin(0.08);
78 buchmann 1.1 tdrStyle->SetPadBottomMargin(0.13);
79     tdrStyle->SetPadLeftMargin(0.13);
80     tdrStyle->SetPadRightMargin(0.05);
81    
82     // For the Global title:
83    
84 fronga 1.5 tdrStyle->SetOptTitle(0);
85 buchmann 1.1 tdrStyle->SetTitleFont(42);
86     tdrStyle->SetTitleColor(1);
87     tdrStyle->SetTitleTextColor(1);
88     tdrStyle->SetTitleFillColor(10);
89     tdrStyle->SetTitleFontSize(0.05);
90     // tdrStyle->SetTitleH(0); // Set the height of the title box
91     // tdrStyle->SetTitleW(0); // Set the width of the title box
92     // tdrStyle->SetTitleX(0); // Set the position of the title box
93     // tdrStyle->SetTitleY(0.985); // Set the position of the title box
94     // tdrStyle->SetTitleStyle(Style_t style = 1001);
95     // tdrStyle->SetTitleBorderSize(2);
96    
97     // For the axis titles:
98    
99     tdrStyle->SetTitleColor(1, "XYZ");
100     tdrStyle->SetTitleFont(42, "XYZ");
101 buchmann 1.2 tdrStyle->SetTitleSize(0.05, "XYZ");
102 buchmann 1.1 // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
103     // tdrStyle->SetTitleYSize(Float_t size = 0.02);
104 buchmann 1.2 tdrStyle->SetTitleXOffset(1.0);
105     tdrStyle->SetTitleYOffset(1.1);
106 buchmann 1.1 // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
107    
108     // For the axis labels:
109    
110     tdrStyle->SetLabelColor(1, "XYZ");
111     tdrStyle->SetLabelFont(42, "XYZ");
112     tdrStyle->SetLabelOffset(0.007, "XYZ");
113 buchmann 1.2 tdrStyle->SetLabelSize(0.04, "XYZ");
114 buchmann 1.1
115     // For the axis:
116    
117     tdrStyle->SetAxisColor(1, "XYZ");
118     tdrStyle->SetStripDecimals(kTRUE);
119     tdrStyle->SetTickLength(0.03, "XYZ");
120     tdrStyle->SetNdivisions(510, "XYZ");
121     tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
122     tdrStyle->SetPadTickY(1);
123    
124     // Change for log plots:
125     tdrStyle->SetOptLogx(0);
126     tdrStyle->SetOptLogy(0);
127     tdrStyle->SetOptLogz(0);
128    
129     // Postscript options:
130     // tdrStyle->SetPaperSize(15.,15.);
131     // tdrStyle->SetLineScalePS(Float_t scale = 3);
132     // tdrStyle->SetLineStyleString(Int_t i, const char* text);
133     // tdrStyle->SetHeaderPS(const char* header);
134     // tdrStyle->SetTitlePS(const char* pstitle);
135    
136     // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
137     // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
138     // tdrStyle->SetPaintTextFormat(const char* format = "g");
139     // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
140     // tdrStyle->SetTimeOffset(Double_t toffset);
141     // tdrStyle->SetHistMinimumZero(kTRUE);
142    
143 buchmann 1.3 Double_t stops[5] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
144     Double_t red[5] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
145     Double_t green[5] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
146     Double_t blue[5] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
147     TColor::CreateGradientColorTable(5, stops, red, green,blue, 255);
148     tdrStyle->SetNumberContours(255);
149    
150 buchmann 1.1 tdrStyle->cd();
151     }