18 dirName = str(ROOT.gROOT.GetTutorialDir())
20 dirName= dirName.replace(
"/./",
"/")
21 inputFileName =
"%s/SWAN2017.dat" %dirName
25 g.SetTitle(
"SWAN Users during July 2017;Time;Number of Sessions")
30 lines =
open(inputFileName,
"r").readlines() 32 for i, line
in enumerate(lines):
33 d, h, value = line.split()
34 g.SetPoint(i, ROOT.TDatime(
"%s %s" %(d,h)).Convert(), float(value))
37 c = ROOT.TCanvas(
"c",
"c", 950, 500)
39 c.SetRightMargin(0.04)
42 g.SetLineColor(ROOT.kBlue)
44 g.GetYaxis().CenterTitle()
48 xaxis.SetTimeDisplay(1)
50 xaxis.SetTimeFormat(
"%a %d")
51 xaxis.SetTimeOffset(0)
52 xaxis.SetNdivisions(-219)
53 xaxis.SetLimits(ROOT.TDatime(2017, 7, 3, 0, 0, 0).Convert(), ROOT.TDatime(2017, 7, 22, 0, 0, 0).Convert())
54 xaxis.SetLabelSize(0.025)