Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SetOKStyle.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SetOKStyle.C
1 
2 #ifndef SetOKStyle_C
3 #define SetOKStyle_C
4 
5 
6 void
8 {
9  TStyle* OKStyle = new TStyle("OKStyle", "OK Default Style");
10 
11  // Colors
12 
13  //set the background color to white
14  OKStyle->SetFillColor(10);
15  OKStyle->SetFrameFillColor(kWhite);
16  OKStyle->SetFrameFillStyle(0);
17  OKStyle->SetFillStyle(0);
18  OKStyle->SetCanvasColor(kWhite);
19  OKStyle->SetPadColor(kWhite);
20  OKStyle->SetTitleFillColor(0);
21  OKStyle->SetStatColor(kWhite);
22 
23  // Get rid of drop shadow on legends
24  // This doesn't seem to work. Call SetBorderSize(1) directly on your TLegends
25  OKStyle->SetLegendBorderSize(1);
26 
27  //don't put a colored frame around the plots
28  OKStyle->SetFrameBorderMode(0);
29  OKStyle->SetCanvasBorderMode(0);
30  OKStyle->SetPadBorderMode(0);
31 
32  //use the primary color palette
33  OKStyle->SetPalette(1, 0);
34 
35  //set the default line color for a histogram to be black
36  OKStyle->SetHistLineColor(kBlack);
37 
38  //set the default line color for a fit function to be red
39  OKStyle->SetFuncColor(kBlue);
40 
41  //make the axis labels black
42  OKStyle->SetLabelColor(kBlack, "xyz");
43 
44  //set the default title color to be black
45  OKStyle->SetTitleColor(kBlack);
46 
47  //set the margins
48  OKStyle->SetPadBottomMargin(0.15);
49  OKStyle->SetPadLeftMargin(0.1);
50  OKStyle->SetPadTopMargin(0.075);
51  OKStyle->SetPadRightMargin(0.1);
52 
53  //set axis label and title text sizes
54  OKStyle->SetLabelSize(0.035, "xyz");
55  OKStyle->SetTitleSize(0.05, "xyz");
56  OKStyle->SetTitleOffset(0.9, "xyz");
57  OKStyle->SetStatFontSize(0.035);
58  OKStyle->SetTextSize(0.05);
59  OKStyle->SetTitleBorderSize(0);
60  OKStyle->SetTitleStyle(0);
61 
62  OKStyle->SetLegendBorderSize(0);
63 
64  //set line widths
65  OKStyle->SetHistLineWidth(1);
66  OKStyle->SetFrameLineWidth(2);
67  OKStyle->SetFuncWidth(2);
68 
69  // Misc
70 
71  //align the titles to be centered
72  //OKStyle->SetTextAlign(22);
73 
74  //turn off xy grids
75  OKStyle->SetPadGridX(1);
76  OKStyle->SetPadGridY(1);
77 
78  //set the tick mark style
79  OKStyle->SetPadTickX(1);
80  OKStyle->SetPadTickY(1);
81 
82  //don't show the fit parameters in a box
83  OKStyle->SetOptFit(0);
84 
85  //set the default stats shown
86  OKStyle->SetOptStat(1);
87 
88  //marker settings
89 // OKStyle->SetMarkerStyle(8);
90 // OKStyle->SetMarkerSize(0.7);
91 
92  // Fonts
93  OKStyle->SetStatFont(42);
94  OKStyle->SetLabelFont(42, "xyz");
95  OKStyle->SetTitleFont(42, "xyz");
96  OKStyle->SetTextFont(42);
97 
98  // Set the paper size for output
99  OKStyle->SetPaperSize(TStyle::kUSLetter);
100 
101  //done
102  OKStyle->cd();
103 
104  cout << "Using Jin's Style" << endl;
105 }
106 
107 #endif