ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bent.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphs
3 /// Bent error bars
4 ///
5 /// \macro_image
6 /// \macro_code
7 ///
8 /// \author Olivier Couet
9 
10 void bent() {
11  const Int_t n = 10;
12  Double_t x[n] = {-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
13  Double_t y[n] = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
14  Double_t exl[n] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};
15  Double_t eyl[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
16  Double_t exh[n] = {.02,.08,.05,.05,.03,.03,.04,.05,.06,.03};
17  Double_t eyh[n] = {.6,.5,.4,.3,.2,.2,.3,.4,.5,.6};
18  Double_t exld[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.0,.0};
19  Double_t eyld[n] = {.0,.0,.05,.0,.0,.0,.0,.0,.0,.0};
20  Double_t exhd[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.0,.0};
21  Double_t eyhd[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.05,.0};
23  n,x,y,exl,exh,eyl,eyh,exld,exhd,eyld,eyhd);
24  gr->SetTitle("TGraphBentErrors Example");
25  gr->SetMarkerColor(4);
26  gr->SetMarkerStyle(21);
27  gr->Draw("ALP");
28 }
int Int_t
Definition: RtypesCore.h:41
virtual void SetTitle(const char *title="")
Set graph title.
Definition: TGraph.cxx:2153
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
Definition: TGraph.cxx:740
virtual void SetMarkerColor(Color_t mcolor=1)
Definition: TAttMarker.h:51
A TGraphBentErrors is a TGraph with bent, assymetric error bars.
virtual void SetMarkerStyle(Style_t mstyle=1)
Definition: TAttMarker.h:53
double Double_t
Definition: RtypesCore.h:55
const Int_t n
Definition: legend1.C:16