Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:57

0001 #____________________________________________________________
0002 #
0003 #  cuy
0004 #
0005 # A very simple way to make plots with ROOT via an XML file
0006 #
0007 # Francisco Yumiceva
0008 # yumiceva@fnal.gov
0009 #
0010 # Fermilab, 2008
0011 #
0012 #____________________________________________________________
0013 
0014 import ROOT
0015 
0016 class Style:
0017 
0018     def SetStyle(self):
0019 
0020         ROOT.gStyle.SetFrameBorderMode(0)
0021         ROOT.gStyle.SetCanvasBorderMode(0)
0022         ROOT.gStyle.SetPadBorderMode(0)
0023 
0024         ROOT.gStyle.SetFrameFillColor(0)
0025         ROOT.gStyle.SetPadColor(0)
0026         ROOT.gStyle.SetCanvasColor(0)
0027         ROOT.gStyle.SetTitleColor(1)
0028         ROOT.gStyle.SetStatColor(0)
0029 
0030         # set the paper & margin sizes
0031         ROOT.gStyle.SetPaperSize(20,26)
0032         ROOT.gStyle.SetPadTopMargin(0.06)
0033         ROOT.gStyle.SetPadRightMargin(0.04)
0034         ROOT.gStyle.SetPadBottomMargin(0.14)
0035         ROOT.gStyle.SetPadLeftMargin(0.16)
0036         ROOT.gStyle.SetPadTickX(1)
0037         ROOT.gStyle.SetPadTickY(1)
0038 
0039         ROOT.gStyle.SetTextFont(42) #132
0040         ROOT.gStyle.SetTextSize(0.09)
0041         ROOT.gStyle.SetLabelFont(42,"xyz")
0042         ROOT.gStyle.SetTitleFont(42,"xyz")
0043         ROOT.gStyle.SetLabelSize(0.045,"xyz") #0.035
0044         ROOT.gStyle.SetTitleSize(0.045,"xyz")
0045         ROOT.gStyle.SetTitleOffset(1.5,"y")
0046 
0047         # use bold lines and markers
0048         ROOT.gStyle.SetMarkerStyle(8)
0049         ROOT.gStyle.SetHistLineWidth(2)
0050         ROOT.gStyle.SetLineWidth(1)
0051     #ROOT.gStyle.SetLineStyleString(2,"[12 12]") // postscript dashes
0052 
0053         # do not display any of the standard histogram decorations
0054         ROOT.gStyle.SetOptTitle(1)
0055         ROOT.gStyle.SetOptStat(0) #("m")
0056         ROOT.gStyle.SetOptFit(0)
0057 
0058     #ROOT.gStyle.SetPalette(1,0)
0059         ROOT.gStyle.cd()
0060         ROOT.gROOT.ForceStyle()