Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#if !defined( __CINT__) || defined (__MAKECINT__)
#ifndef ROOT_TStyle
#include "TStyle.h"
#endif
#endif
void MultiSquarePlot(){
TStyle *sty = new TStyle("MultiSquarePlot","Multi Square Plot Style");
/// Turn off some borders
sty->SetFrameBorderMode(0);
sty->SetFrameFillColor(0);
sty->SetCanvasBorderMode(0);
sty->SetCanvasColor(0);
sty->SetPadBorderMode(0);
sty->SetPadColor(0);
sty->SetStatColor(0);
//sty->SetDrawBorder(0);
//sty->SetCanvasBorderSize(0);
//sty->SetFrameBorderSize(0);
//sty->SetPadBorderSize(0);
//sty->SetTitleBorderSize(0);
///// Text font code = 10*fontnumber + precision
//// Fonts: Helvetica (42), upright, normal
//// 132 times-medium-r-normal
int style_label_font=132;
sty->SetTitleFont(style_label_font,"");
sty->SetLabelFont(style_label_font,"x");
sty->SetTitleFont(style_label_font,"x");
sty->SetLabelFont(style_label_font,"y");
sty->SetTitleFont(style_label_font,"y");
sty->SetLabelFont(style_label_font,"z");
sty->SetTitleFont(style_label_font,"z");
sty->SetStatFont( style_label_font);
sty->SetTextFont(style_label_font); // sets the default font (for everything?)
sty->SetLabelSize(0.08,"x");
sty->SetTitleSize(0.08,"x");
sty->SetLabelSize(0.08,"y");
sty->SetTitleSize(0.08,"y");
sty->SetLabelSize(0.08,"z");
sty->SetTitleSize(0.08,"z");
sty->SetTitleSize(0.040,"");
sty->SetTitleAlign(23);
sty->SetTitleX(0.5);
sty->SetTitleBorderSize(0);
sty->SetTitleFillColor(0);
sty->SetTitleStyle(0);
sty->SetStatBorderSize(1);
//sty->SetOptStat(1111);
sty->SetOptStat(0);
sty->SetStatY(0.935);
sty->SetHistLineColor(1);
sty->SetLegendBorderSize(1);
sty->SetLegendFillColor(0);
sty->SetLegendFont(style_label_font);
sty->SetFuncWidth(2);
sty->SetFuncColor(2);
// -----------------------------------------
// Set margins for axes labels and titles
sty->SetPadTopMargin(0.1);
sty->SetPadBottomMargin(0.15);
sty->SetPadLeftMargin(0.15);
sty->SetPadRightMargin(0.1);
// -----------------------------------------
// Set the offset of the title's from the axes' numbers
sty->SetTitleOffset(1.00,"x");
sty->SetTitleOffset(0.80,"yz");
TGaxis::SetMaxDigits(4); // restrict the number of digits in labels
sty->SetStripDecimals(true); // Stip 0 decimals, ie, 1.0 -> 1
// Set the size of the default canvas
sty->SetCanvasDefH(800);
sty->SetCanvasDefW(900);
////sty->SetCanvasDefX(10);
////sty->SetCanvasDefY(10);
sty->SetPadTickX(1);
sty->SetPadTickY(1);
sty->SetTickLength(0.02,"xyz");
////sty->SetPadGridX(1);
////sty->SetPadGridY(1);
//sty->SetPadGridX(0);
//sty->SetPadGridY(0);
//// Axes Numbers are called "Labels"
//sty->SetLabelFont(style_label_font,"xyz");
//sty->SetLabelSize(0.001,"x");
//sty->SetLabelSize(0.001,"y");
//sty->SetLabelSize(0.001,"z");
//sty->SetLabelOffset(0.005,"y");
//sty->SetLabelOffset(0.009,"xz");
//sty->SetTitleSize(0.09,"xyz"); // axis titles
//sty->SetTitleOffset(1.005,"xyz");
//sty->SetLabelColor(1,"xyz");
////sty->SetStatFont(style_label_font);
//sty->SetTitleFont(style_label_font,"xyz"); // axis titles
//// Histogram's Main Title
////sty->SetTitleFont(style_label_font,"h"); // histogram title
//sty->SetTitleSize(0.04,"h"); // histogram title
////sty->SetTitleH(0.1);
////sty->SetTitleX(0.12); // spot where histogram title goes
////sty->SetTitleY(0.99); // spot where histogram title goes
////sty->SetTitleW(0.78); // width computed so that title is centered
/// Marker Style
sty->SetEndErrorSize(3);
sty->SetErrorX(0.0);
///// Set Line Widths
//sty->SetFrameLineWidth(1);
//sty->SetHistLineWidth(2);
///// Show functions in blue(4)
//sty->SetFuncColor(1);
//sty->SetFuncStyle(10);
//sty->SetFuncWidth(1);
///// Set all fill styles to be empty and line styles to be solid
//sty->SetFrameFillStyle(0);
//sty->SetHistFillStyle(1001);
//sty->SetFrameLineStyle(0);
//sty->SetHistLineStyle(0);
//sty->SetTitleStyle(0);
//sty->SetFuncStyle(1);
///// Log axes
//sty->SetOptLogx(0);
//sty->SetOptLogy(0);
//sty->SetOptLogz(0);
///// Set Data/Stat/... and other options
//sty->SetStatColor(0);
//sty->SetStatTextColor(1);
/* // sty->SetFitFormat("6.4e");*/
//sty->SetOptDate(0);
//sty->SetDateX(0.01);
//sty->SetDateY(0.01);
//sty->SetOptFile(0);
//sty->SetOptFit(0);
///*sty->SetOptStat(1110);// no histogram title*/
//sty->SetOptStat(0);// no stats
////sty->SetOptStat(10);// no histogram title
///*sty->SetStatFormat("6.4e");*/
///*sty->SetStatStyle(0); // hollow*/
///*sty->SetStatStyle(1001); // filled*/
//sty->SetStatStyle(0); // hollow
//sty->SetStatBorderSize(0);
//sty->SetStatW(0.20);
//sty->SetStatH(0.125);
////sty->SetStatX(0.90);
////sty->SetStatY(0.90);
//sty->SetStatX(1.0-sty->GetPadRightMargin()-0.01);
//sty->SetStatY(1.0-sty->GetPadTopMargin()-0.01);
//sty->SetOptTitle(1);
///// Set tick marks and turn off grids
////sty->SetNdivisions(1005,"xyz");
////sty->SetNdivisions(510,"xyz");
///// no supressed zeroes!
//sty->SetHistMinimumZero(kTRUE);
///// Set paper size for life in the US
//sty->SetPaperSize(TStyle::kUSLetter);
//// or europe
////sty->SetPaperSize(TStyle::kA4);
///// Uncommenting this leads to weird font behavior (especially for small text)....
////sty->SetCanvasPreferGL(kTRUE);
///// Force this style on all histograms
gROOT->ForceStyle();
//return sty;
}