-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot
More file actions
executable file
·33 lines (25 loc) · 806 Bytes
/
plot
File metadata and controls
executable file
·33 lines (25 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
import ROOT
try:
from rootpy.plotting.style import set_style
set_style('ATLAS', shape='rect')
except:
print 'you should try rootpy, it is nice'
if __name__ == '__main__':
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-a', '--autograph', default=False, action='store_true')
args = parser.parse_args()
ROOT.gROOT.SetBatch(True)
canv = ROOT.TCanvas()
h1 = ROOT.TH1F("h1", "h1", 100, -5, 5)
h1.FillRandom('gaus', 10000)
h1.GetXaxis().SetTitle('X')
h1.GetYaxis().SetTitle('Number of events')
h1.Draw()
if args.autograph:
from img import awesome_plot
awesome_plot(canv)
canv.SaveAs('awesome_plot.png')
else:
canv.SaveAs('lame_plot.png')