3 from ROOT
import TCanvas,TH1F,gROOT,TFile,gStyle,gDirectory,TDatime,TLegend
10 print 'unable to import GUI backend, switch to batch only mode'
18 Tk.Frame.__init__(self,master=root)
19 ROOT.gStyle.SetOptStat(0)
20 ROOT.gROOT.SetBatch(ROOT.kFALSE)
22 self.__canvas.SetHighLightColor(2);
23 self.__canvas.Range(-125.6732,-0.1364721,1123.878,1.178117)
24 self.__canvas.SetFillColor(0)
25 self.__canvas.SetBorderMode(0)
26 self.__canvas.SetBorderSize(2)
27 self.__canvas.SetGridx()
28 self.__canvas.SetGridy()
29 self.__canvas.SetFrameFillColor(19)
30 self.__canvas.SetFrameBorderMode(0)
31 self.__canvas.SetFrameBorderMode(0)
35 button=Tk.Button(master=root,text=
'Quit',command=sys.exit)
36 button.pack(side=Tk.BOTTOM)
40 ROOT.gStyle.SetOptStat(0)
41 ROOT.gROOT.SetBatch(ROOT.kTRUE)
43 self.__canvas.SetHighLightColor(2);
44 self.__canvas.Range(-125.6732,-0.1364721,1123.878,1.178117)
45 self.__canvas.SetFillColor(0)
46 self.__canvas.SetBorderMode(0)
47 self.__canvas.SetBorderSize(2)
48 self.__canvas.SetGridx()
49 self.__canvas.SetGridy()
50 self.__canvas.SetFrameFillColor(19)
51 self.__canvas.SetFrameBorderMode(0)
52 self.__canvas.SetFrameBorderMode(0)
56 self.__canvas.Modified()
58 self.__canvas.SetSelected(rootobj)
60 if __name__==
'__main__':
62 da = TDatime(2010,3,30,13,10,00)
63 h1f = TH1F(
"Luminposity",
"",1000,0.,1000)
64 h1f.GetXaxis().SetNdivisions(-503)
65 h1f.GetXaxis().SetTimeDisplay(1)
66 h1f.GetXaxis().SetTimeFormat(
"%d\/%m %H:%M")
67 h1f.GetXaxis().SetTimeOffset(da.Convert())
68 h1f.GetXaxis().SetLabelFont(32);
69 h1f.GetXaxis().SetLabelSize(0.03);
70 h1f.GetXaxis().SetTitleFont(32);
71 h1f.GetXaxis().SetTitle(
"Date");
73 h1f.GetYaxis().SetLabelFont(32);
74 h1f.GetYaxis().SetLabelSize(0.03);
75 h1f.GetYaxis().SetTitleFont(32);
76 h1f.GetYaxis().SetTitle(
"L (#mub^{-1})");
78 for i
in range(0,1000):
80 h1f.SetBinContent(i,20.2+i)