All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
savegraph.py
Go to the documentation of this file.
1 import ROOT
2 import util
3 import argparse
4 from array import array
5 
6 def main(args):
7  f = ROOT.TFile(args.input)
8  graph = f.Get(args.graph)
9  canvas = ROOT.TCanvas("canvas", "Canvas", 250,100,700,500)
10  util.style(args, graph)
11  graph.Draw("AC")
12  util.resize_graph(args, graph)
13  graph.Draw("AC")
14 
15  line = ROOT.TGraph(2, array('d', [0., 1.]), array('d', [1., 0.]))
16  line.SetLineColor(ROOT.kRed)
17  line.Draw("SAME")
18 
19  canvas.Update()
20 
21  util.wait(args)
22  util.write(args, canvas)
23 
24 if __name__ == "__main__":
25  parser = argparse.ArgumentParser()
26  parser = util.with_io_args(parser)
27  parser = util.with_histostyle_args(parser)
28  parser = util.with_graphsize_args(parser)
29  parser.add_argument("-g", "--graph", required=True)
30  main(parser.parse_args())
31 
def main
Definition: savegraph.py:6
def style
Definition: util.py:237
def write
Definition: util.py:23
def with_histostyle_args
Definition: util.py:220
def wait
Definition: util.py:19
def with_graphsize_args
Definition: util.py:89
def resize_graph
Definition: util.py:112
def with_io_args
Definition: util.py:84