Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
gr009_bent_err.py
2## \ingroup tutorial_graphs
3## \notebook -js
4## Graph with bent error bars. Inspired from work of Olivier Couet.
5##
6## See the [TGraphBentErrors documentation](https://root.cern/doc/master/classTGraphBentErrors.html)
7##
8## exl / exh: low and high (left/right) errors in x; similar for y
9## e*d: delta, in axis units, to be added/subtracted (if >0 or <0) in x or y from
10## the data point's position to use as end point of the corresponding error
11##
12## \macro_image
13## \macro_code
14##
15## \author Alberto Ferro
16
17import ROOT
18
19c1 = ROOT.TCanvas()
20n = 10
21x = ROOT.std.vector('double')()
22for 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)
23y = ROOT.std.vector('double')()
24for i in [1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1]: y.push_back(i)
25exl = ROOT.std.vector('double')()
26for i in [.05,.1,.07,.07,.04,.05,.06,.07,.08,.05]: exl.push_back(i)
27eyl = ROOT.std.vector('double')()
28for i in [.8,.7,.6,.5,.4,.4,.5,.6,.7,.8]: eyl.push_back(i)
29exh = ROOT.std.vector('double')()
30for i in [.02,.08,.05,.05,.03,.03,.04,.05,.06,.03]: exh.push_back(i)
31eyh = ROOT.std.vector('double')()
32for i in [.6,.5,.4,.3,.2,.2,.3,.4,.5,.6]: eyh.push_back(i)
33exld = ROOT.std.vector('double')()
34for i in [.0,.0,.0,.0,.0,.0,.0,.0,.0,.0]: exld.push_back(i)
35eyld = ROOT.std.vector('double')()
36for i in [.0,.0,.05,.0,.0,.0,.0,.0,.0,.0]: eyld.push_back(i)
37exhd = ROOT.std.vector('double')()
38for i in [.0,.0,.0,.0,.0,.0,.0,.0,.0,.0]: exhd.push_back(i)
39eyhd = ROOT.std.vector('double')()
40for i in [.0,.0,.0,.0,.0,.0,.0,.0,.05,.0]: eyhd.push_back(i)
41
44
45gr.SetTitle("TGraphBentErrors Example")
48gr.Draw("ALP")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.