Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces
bent.py File Reference

Namespaces

 bent
 

Detailed Description

Bent error bars.

Inspired from work of Olivier Couet.

pict1_bent.py.png
1 
2 import ROOT
3 
4 c1 = ROOT.TCanvas()
5 n = 10
6 x = ROOT.std.vector('double')()
7 for i in [-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95]: x.push_back(i)
8 y = ROOT.std.vector('double')()
9 for i in [1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1]: y.push_back(i)
10 exl = ROOT.std.vector('double')()
11 for i in [.05,.1,.07,.07,.04,.05,.06,.07,.08,.05]: exl.push_back(i)
12 eyl = ROOT.std.vector('double')()
13 for i in [.8,.7,.6,.5,.4,.4,.5,.6,.7,.8]: eyl.push_back(i)
14 exh = ROOT.std.vector('double')()
15 for i in [.02,.08,.05,.05,.03,.03,.04,.05,.06,.03]: exh.push_back(i)
16 eyh = ROOT.std.vector('double')()
17 for i in [.6,.5,.4,.3,.2,.2,.3,.4,.5,.6]: eyh.push_back(i)
18 exld = ROOT.std.vector('double')()
19 for i in [.0,.0,.0,.0,.0,.0,.0,.0,.0,.0]: exld.push_back(i)
20 eyld = ROOT.std.vector('double')()
21 for i in [.0,.0,.05,.0,.0,.0,.0,.0,.0,.0]: eyld.push_back(i)
22 exhd = ROOT.std.vector('double')()
23 for i in [.0,.0,.0,.0,.0,.0,.0,.0,.0,.0]: exhd.push_back(i)
24 eyhd = ROOT.std.vector('double')()
25 for i in [.0,.0,.0,.0,.0,.0,.0,.0,.05,.0]: eyhd.push_back(i)
26 
27 gr = ROOT.TGraphBentErrors(
28  n,x.data(),y.data(),exl.data(),exh.data(),eyl.data(),eyh.data(),exld.data(),exhd.data(),eyld.data(),eyhd.data())
29 
30 gr.SetTitle("TGraphBentErrors Example")
31 gr.SetMarkerColor(4)
32 gr.SetMarkerStyle(21)
33 gr.Draw("ALP")
Author
Alberto Ferro

Definition in file bent.py.