CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
style Namespace Reference

Functions

def identification
 creates the identification text in the top left corner More...
 
def setgstyle
 set gstyle by https://github.com/mschrode/AwesomePlots/blob/master/Style.cc More...
 
def setstatsize
 statistics size More...
 

Function Documentation

def style.identification (   config)

creates the identification text in the top left corner

Definition at line 16 of file style.py.

16 
17 def identification(config):
18  text = ROOT.TPaveText(0.0, 0.95, 1.0, 1.0, "blNDC")
19  text.AddText(config.message)
20  text.SetBorderSize(0)
21  text.SetTextAlign(12)
22  text.SetTextSizePixels(10)
23  text.SetTextFont(82)
24  text.SetFillColor(0)
25  return text
def identification
creates the identification text in the top left corner
Definition: style.py:16
def style.setgstyle ( )

set gstyle by https://github.com/mschrode/AwesomePlots/blob/master/Style.cc

Definition at line 50 of file style.py.

50 
51 def setgstyle():
52  # Zero horizontal error bars
53  ROOT.gStyle.SetErrorX(0)
54 
55  # For the canvas
56  ROOT.gStyle.SetCanvasBorderMode(0)
57  ROOT.gStyle.SetCanvasColor(0)
58  ROOT.gStyle.SetCanvasDefH(800) # Height of canvas
59  ROOT.gStyle.SetCanvasDefW(800) # Width of canvas
60  ROOT.gStyle.SetCanvasDefX(0) # Position on screen
61  ROOT.gStyle.SetCanvasDefY(0)
62 
63  # For the frame
64  ROOT.gStyle.SetFrameBorderMode(0)
65  ROOT.gStyle.SetFrameBorderSize(1)
66  ROOT.gStyle.SetFrameFillColor(1)
67  ROOT.gStyle.SetFrameFillStyle(0)
68  ROOT.gStyle.SetFrameLineColor(1)
69  ROOT.gStyle.SetFrameLineStyle(0)
70  ROOT.gStyle.SetFrameLineWidth(1)
71 
72  # For the Pad
73  ROOT.gStyle.SetPadBorderMode(0)
74  ROOT.gStyle.SetPadColor(0)
75  ROOT.gStyle.SetPadGridX(False)
76  ROOT.gStyle.SetPadGridY(False)
77  ROOT.gStyle.SetGridColor(0)
78  ROOT.gStyle.SetGridStyle(3)
79  ROOT.gStyle.SetGridWidth(1)
80 
81  # Margins
82  ROOT.gStyle.SetPadTopMargin(0.08)
83  ROOT.gStyle.SetPadBottomMargin(0.19)
84  ROOT.gStyle.SetPadLeftMargin(0.17)
85  #ROOT.gStyle.SetPadRightMargin(0.07)
86 
87  # For the histo:
88  ROOT.gStyle.SetHistLineColor(1)
89  ROOT.gStyle.SetHistLineStyle(0)
90  ROOT.gStyle.SetHistLineWidth(2)
91  ROOT.gStyle.SetMarkerSize(1.4)
92  ROOT.gStyle.SetEndErrorSize(4)
93 
94  # For the statistics box:
95  ROOT.gStyle.SetOptStat(0)
96 
97  # For the axis
98  ROOT.gStyle.SetAxisColor(1, "XYZ")
99  ROOT.gStyle.SetTickLength(0.03, "XYZ")
100  ROOT.gStyle.SetNdivisions(510, "XYZ")
101  ROOT.gStyle.SetPadTickX(1)
102  ROOT.gStyle.SetPadTickY(1)
103  ROOT.gStyle.SetStripDecimals(False)
104 
105  # For the axis labels and titles
106  ROOT.gStyle.SetTitleColor(1, "XYZ")
107  ROOT.gStyle.SetLabelColor(1, "XYZ")
108  ROOT.gStyle.SetLabelFont(42, "XYZ")
109  ROOT.gStyle.SetLabelOffset(0.007, "XYZ")
110  ROOT.gStyle.SetLabelSize(0.045, "XYZ")
111  ROOT.gStyle.SetTitleFont(42, "XYZ")
112  ROOT.gStyle.SetTitleSize(0.06, "XYZ")
113 
114  # For the legend
115  ROOT.gStyle.SetLegendBorderSize(0)
def setgstyle
set gstyle by https://github.com/mschrode/AwesomePlots/blob/master/Style.cc
Definition: style.py:50
def style.setstatsize (   canvas,
  plot,
  config 
)

statistics size

Definition at line 31 of file style.py.

31 
32 def setstatsize(canvas, plot, config):
33  # statistics size
34  ROOT.gStyle.SetStatW(0.3)
35  ROOT.gStyle.SetStatH(0.3)
36  plot.Draw()
37  canvas.Update()
38 
39  # set the size of the statistics box
40  stat = plot.FindObject("stats")
41  stat.SetX1NDC(1 - config.statboxsize)
42  stat.SetY1NDC(1 - config.statboxsize)
43 
def setstatsize
statistics size
Definition: style.py:31