CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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"),
7  yoff = MyStyle->GetLabelOffset("Y"),
8  zoff = MyStyle->GetLabelOffset("Z");
9 
10  MyStyle->SetCanvasBorderMode ( 0 );
11  MyStyle->SetPadBorderMode ( 0 );
12  MyStyle->SetPadColor ( 0 );
13  MyStyle->SetCanvasColor ( 0 );
14  MyStyle->SetTitleColor ( 0 );
15  MyStyle->SetStatColor ( 0 );
16  MyStyle->SetTitleBorderSize ( 0 );
17  MyStyle->SetTitleFillColor ( 0 );
18  MyStyle->SetTitleH ( 0.07 );
19  MyStyle->SetTitleW ( 1.00 );
20  MyStyle->SetTitleFont ( 132 );
21 
22  MyStyle->SetLabelOffset (1.5*xoff, "X");
23  MyStyle->SetLabelOffset (1.5*yoff, "Y");
24  MyStyle->SetLabelOffset (1.5*zoff, "Z");
25 
26  MyStyle->SetTitleOffset (0.9, "X");
27  MyStyle->SetTitleOffset (0.9, "Y");
28  MyStyle->SetTitleOffset (0.9, "Z");
29 
30  MyStyle->SetTitleSize (0.045, "X");
31  MyStyle->SetTitleSize (0.045, "Y");
32  MyStyle->SetTitleSize (0.045, "Z");
33 
34  MyStyle->SetLabelFont (132, "X");
35  MyStyle->SetLabelFont (132, "Y");
36  MyStyle->SetLabelFont (132, "Z");
37 
38  MyStyle->SetPalette(1);
39 
40  MyStyle->cd();
41 }