Skip to content
Snippets Groups Projects
Commit 042a4881 authored by Arseny Rybnikov's avatar Arseny Rybnikov
Browse files

add drawGraph func

parent 000c35eb
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,12 @@ The `greenlablib` module is a python module intends to simplify ROOT based routi
>>> pl.drawBinContent(D[0],D[1]) # SetBinContent reimplementation
```
#### TGraph drawGraph(npoints,xarr,yarr,name='g',title='graph')
```
>>> pl.drawGraph(D[-1],D[0],D[1]) # TGraph reimplementation
```
### Math functions:
## float getMuErr(stat,mu):
## float getMuErrNoise(stat,mu,dcr=0,gate=1):
#### float getMuErr(stat,mu):
#### float getMuErrNoise(stat,mu,dcr=0,gate=1):
......@@ -89,3 +89,19 @@ def drawBinContent(bin_arr,val_arr,name='h',title='histo',nbins=100,bin_first=0,
h.SetLineWidth(2)
h.Draw("")
return h
def drawGraph(npoints,xarr,yarr,name='g',title='graph'):
'''
Implements the TGraph ROOT method
'''
xarr = cd(xarr)
yarr = cd(yarr)
g = TGraph(npoints,xarr,yarr)
g.SetNameTitle(name,title)
g.GetYaxis().SetMaxDigits(3);
g.SetMarkerStyle(20);
g.SetMarkerSize(0.6);
g.SetMarkerColor(4);
g.Draw("AP")
return g
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment