1 #ifndef Core_Plotting_Style_h
2 #define Core_Plotting_Style_h
26 void ModTDRStyle(
int width,
int height,
double t,
double b,
double l,
double r);
44 gStyle->SetCanvasBorderMode(0);
45 gStyle->SetCanvasColor(kWhite);
46 gStyle->SetCanvasDefH(600);
47 gStyle->SetCanvasDefW(600);
48 gStyle->SetCanvasDefX(0);
49 gStyle->SetCanvasDefY(0);
52 gStyle->SetPadBorderMode(0);
54 gStyle->SetPadColor(kWhite);
55 gStyle->SetPadGridX(
false);
56 gStyle->SetPadGridY(
false);
57 gStyle->SetGridColor(0);
58 gStyle->SetGridStyle(3);
59 gStyle->SetGridWidth(1);
62 gStyle->SetFrameBorderMode(0);
63 gStyle->SetFrameBorderSize(1);
64 gStyle->SetFrameFillColor(0);
65 gStyle->SetFrameFillStyle(0);
66 gStyle->SetFrameLineColor(1);
67 gStyle->SetFrameLineStyle(1);
68 gStyle->SetFrameLineWidth(1);
73 gStyle->SetHistLineColor(1);
74 gStyle->SetHistLineStyle(0);
75 gStyle->SetHistLineWidth(1);
79 gStyle->SetEndErrorSize(2);
83 gStyle->SetMarkerStyle(20);
87 gStyle->SetFitFormat(
"5.4g");
88 gStyle->SetFuncColor(2);
89 gStyle->SetFuncStyle(1);
90 gStyle->SetFuncWidth(1);
93 gStyle->SetOptDate(0);
98 gStyle->SetOptFile(0);
99 gStyle->SetOptStat(0);
100 gStyle->SetStatColor(kWhite);
101 gStyle->SetStatFont(42);
102 gStyle->SetStatFontSize(0.025);
103 gStyle->SetStatTextColor(1);
104 gStyle->SetStatFormat(
"6.4g");
105 gStyle->SetStatBorderSize(1);
106 gStyle->SetStatH(0.1);
107 gStyle->SetStatW(0.15);
113 gStyle->SetPadTopMargin(0.05);
114 gStyle->SetPadBottomMargin(0.13);
115 gStyle->SetPadLeftMargin(0.16);
116 gStyle->SetPadRightMargin(0.02);
119 gStyle->SetOptTitle(0);
120 gStyle->SetTitleFont(42);
121 gStyle->SetTitleColor(1);
122 gStyle->SetTitleTextColor(1);
123 gStyle->SetTitleFillColor(10);
124 gStyle->SetTitleFontSize(0.05);
133 gStyle->SetTitleColor(1,
"XYZ");
134 gStyle->SetTitleFont(42,
"XYZ");
135 gStyle->SetTitleSize(0.06,
"XYZ");
139 gStyle->SetTitleXOffset(0.9);
140 gStyle->SetTitleYOffset(1.25);
145 gStyle->SetLabelColor(1,
"XYZ");
146 gStyle->SetLabelFont(42,
"XYZ");
147 gStyle->SetLabelOffset(0.007,
"XYZ");
148 gStyle->SetLabelSize(0.05,
"XYZ");
152 gStyle->SetAxisColor(1,
"XYZ");
153 gStyle->SetStripDecimals(kTRUE);
154 gStyle->SetTickLength(0.03,
"XYZ");
155 gStyle->SetNdivisions(510,
"XYZ");
156 gStyle->SetPadTickX(1);
157 gStyle->SetPadTickY(1);
160 gStyle->SetOptLogx(0);
161 gStyle->SetOptLogy(0);
162 gStyle->SetOptLogz(0);
165 gStyle->SetPaperSize(20., 20.);
178 gStyle->SetHatchesLineWidth(5);
179 gStyle->SetHatchesSpacing(0.05);
182 void ModTDRStyle(
int width,
int height,
double t,
double b,
double l,
187 gStyle->SetCanvasDefW(width);
188 gStyle->SetCanvasDefH(height);
194 double def_w =
static_cast<double>(gStyle->GetCanvasDefW());
195 double def_h =
static_cast<double>(gStyle->GetCanvasDefH());
197 double scale_h = (def_h > def_w) ? def_w / def_h : 1.;
198 double scale_w = (def_w > def_h) ? def_h / def_w : 1.;
200 double def_min = def_h < def_w ? def_h : def_w;
202 gStyle->SetPadTopMargin(t * scale_h);
203 gStyle->SetPadBottomMargin(b * scale_h);
204 gStyle->SetPadLeftMargin(l * scale_w);
205 gStyle->SetPadRightMargin(r * scale_w);
210 gStyle->SetNdivisions(506,
"XYZ");
213 gStyle->SetMarkerColor(kBlack);
214 gStyle->SetMarkerSize(1.0);
217 gStyle->SetLabelOffset(0.007,
"YZ");
221 gStyle->SetLabelOffset(0.005 * (3. - 2. / scale_h),
"X");
228 double title_size = 0.05;
229 double title_px = title_size * def_min;
230 double label_size = 0.04;
231 gStyle->SetTitleSize(title_size,
"XYZ");
232 gStyle->SetLabelSize(label_size,
"XYZ");
234 gStyle->SetTitleXOffset(0.5 * scale_h *
235 (1.2 * (def_h * b * scale_h - 0.6 * title_px)) /
237 gStyle->SetTitleYOffset(0.5 * scale_w *
238 (1.2 * (def_w * l * scale_w - 0.6 * title_px)) /
242 gStyle->SetPadTickX(0);
243 gStyle->SetPadTickY(0);
244 gStyle->SetTickLength(0.02,
"XYZ");
246 gStyle->SetLegendBorderSize(0);
247 gStyle->SetLegendFont(42);
248 gStyle->SetLegendFillColor(0);
249 gStyle->SetFillColor(0);
257 gStyle->SetPadGridX(grid_on);
258 gStyle->SetPadGridY(grid_on);
void TdrGrid(bool grid_on)
Modify the global style to enable/disable the drawing of axis gridlines.
void SetTDRStyle()
Sets the semi-official CMS plotting global style.
void ModTDRStyle(int width, int height, double t, double b, double l, double r)
Sets an improved plotting style, using the CMS default as a base.