CMS 3D CMS Logo

Functions
NiceStyle.cc File Reference
#include <TStyle.h>

Go to the source code of this file.

Functions

void setNiceStyle ()
 

Function Documentation

void setNiceStyle ( )

Definition at line 3 of file NiceStyle.cc.

Referenced by main().

3  {
4  TStyle *MyStyle = new TStyle("MyStyle", "My style for nicer plots");
5 
6  Float_t xoff = MyStyle->GetLabelOffset("X"), yoff = MyStyle->GetLabelOffset("Y"), zoff = MyStyle->GetLabelOffset("Z");
7 
8  MyStyle->SetCanvasBorderMode(0);
9  MyStyle->SetPadBorderMode(0);
10  MyStyle->SetPadColor(0);
11  MyStyle->SetCanvasColor(0);
12  MyStyle->SetTitleColor(0);
13  MyStyle->SetStatColor(0);
14  MyStyle->SetTitleBorderSize(0);
15  MyStyle->SetTitleFillColor(0);
16  MyStyle->SetTitleH(0.07);
17  MyStyle->SetTitleW(1.00);
18  MyStyle->SetTitleFont(132);
19 
20  MyStyle->SetLabelOffset(1.5 * xoff, "X");
21  MyStyle->SetLabelOffset(1.5 * yoff, "Y");
22  MyStyle->SetLabelOffset(1.5 * zoff, "Z");
23 
24  MyStyle->SetTitleOffset(0.9, "X");
25  MyStyle->SetTitleOffset(0.9, "Y");
26  MyStyle->SetTitleOffset(0.9, "Z");
27 
28  MyStyle->SetTitleSize(0.045, "X");
29  MyStyle->SetTitleSize(0.045, "Y");
30  MyStyle->SetTitleSize(0.045, "Z");
31 
32  MyStyle->SetLabelFont(132, "X");
33  MyStyle->SetLabelFont(132, "Y");
34  MyStyle->SetLabelFont(132, "Z");
35 
36  MyStyle->SetPalette(1);
37 
38  MyStyle->cd();
39 }