TGraphAsymmErrors


class description - source file - inheritance tree

class TGraphAsymmErrors : public TGraph


    public:
TGraphAsymmErrors TGraphAsymmErrors() TGraphAsymmErrors TGraphAsymmErrors(Int_t n) TGraphAsymmErrors TGraphAsymmErrors(Int_t n, const Float_t* x, const Float_t* y, const Float_t* exl = 0, const Float_t* exh = 0, const Float_t* eyl = 0, const Float_t* eyh = 0) TGraphAsymmErrors TGraphAsymmErrors(Int_t n, const Double_t* x, const Double_t* y, const Double_t* exl = 0, const Double_t* exh = 0, const Double_t* eyl = 0, const Double_t* eyh = 0) TGraphAsymmErrors TGraphAsymmErrors(const TGraphAsymmErrors&) virtual void ~TGraphAsymmErrors() virtual void Apply(TF1* f) static TClass* Class() virtual void ComputeRange(Double_t& xmin, Double_t& ymin, Double_t& xmax, Double_t& ymax) virtual Double_t GetErrorX(Int_t bin) const virtual Double_t GetErrorY(Int_t bin) const Double_t* GetEXhigh() const Double_t* GetEXlow() const Double_t* GetEYhigh() const Double_t* GetEYlow() const virtual Int_t InsertPoint() virtual TClass* IsA() const virtual void Paint(Option_t* chopt) virtual void Print(Option_t* chopt) const virtual Int_t RemovePoint() virtual Int_t RemovePoint(Int_t ipoint) virtual void SavePrimitive(ofstream& out, Option_t* option) virtual void SetPoint(Int_t i, Double_t x, Double_t y) virtual void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh) virtual void SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
Double_t* fEXlow [fNpoints] array of X low errors Double_t* fEXhigh [fNpoints] array of X high errors Double_t* fEYlow [fNpoints] array of Y low errors Double_t* fEYhigh [fNpoints] array of Y high errors

Class Description

   A TGraphAsymmErrors is a TGraph with assymetric error bars.
   The various format options to draw a TGraphAsymmErrors are explained in
     TGraphAsymmErrors::Paint.

  The picture below has been generated by the following macro:
------------------------------------------------------------------------
{
   gROOT->Reset();
   c1 = new TCanvas("c1","A Simple Graph with error bars",200,10,700,500);

   c1->SetFillColor(42);
   c1->SetGrid();
   c1->GetFrame()->SetFillColor(21);
   c1->GetFrame()->SetBorderSize(12);

   Int_t n = 10;
   Double_t x[n]  = {-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
   Double_t y[n]  = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
   Double_t exl[n] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};
   Double_t eyl[n] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
   Double_t exh[n] = {.02,.08,.05,.05,.03,.03,.04,.05,.06,.03};
   Double_t eyh[n] = {.6,.5,.4,.3,.2,.2,.3,.4,.5,.6};
   gr = new TGraphAsymmErrors(n,x,y,exl,exh,eyl,eyh);
   gr->SetTitle("TGraphAsymmErrors Example");
   gr->SetMarkerColor(4);
   gr->SetMarkerStyle(21);
   gr->Draw("ALP");

   c1->Update();
}

/*

*/



TGraphAsymmErrors(): TGraph()
*-*-*-*-*-*-*-*-*-*-*TGraphAsymmErrors default constructor*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =====================================

TGraphAsymmErrors(Int_t n) : TGraph(n)
*-*-*-*-*-*-*-*-*-*-*TGraphAsymmErrors normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

  the arrays are preset to zero

TGraphAsymmErrors(Int_t n, const Float_t *x, const Float_t *y, const Float_t *exl, const Float_t *exh, const Float_t *eyl, const Float_t *eyh) : TGraph(n,x,y)
*-*-*-*-*-*-*-*-*-*-*TGraphAsymmErrors normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

  if exl,h or eyl,h are null, the corresponding arrays are preset to zero

TGraphAsymmErrors(Int_t n, const Double_t *x, const Double_t *y, const Double_t *exl, const Double_t *exh, const Double_t *eyl, const Double_t *eyh) : TGraph(n,x,y)
*-*-*-*-*-*-*-*-*-*-*TGraphAsymmErrors normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ====================================

  if exl,h or eyl,h are null, the corresponding arrays are preset to zero

~TGraphAsymmErrors()
*-*-*-*-*-*-*-*-*-*-*TGraphAsymmErrors default destructor*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                  ===============================

void Apply(TF1 *f)
 apply a function to all data points
 y = f(x,y)

 Errors are calculated as eyh = f(x,y+eyh)-f(x,y) and
 eyl = f(x,y)-f(x,y-eyl)

 Special treatment has to be applied for the functions where the
 role of "up" and "down" is reversed.
 function suggested/implemented by Miroslav Helbich <helbich@mail.desy.de>

void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax)

Double_t GetErrorX(Int_t i) const
    This function is called by GraphFitChisquare.
    It returns the quadratic error along X at point i.

Double_t GetErrorY(Int_t i) const
    This function is called by GraphFitChisquare.
    It returns the quadratic error along Y at point i.

Int_t InsertPoint()
 Insert a new point at the mouse position

void Paint(Option_t *option)
 Paint this TGraphAsymmErrors with its current attributes

 by default horizonthal and vertical small lines are drawn at
 the end of the error bars. if option "z" or "Z" is specified,
 these lines are not drawn.

 if option contains ">" an arrow is drawn at the end of the error bars
 if option contains "|>" a full arrow is drawn at the end of the error bars
 the size of the arrow is set to 2/3 of the marker size.

 By default, error bars are drawn. If option "X" is specified,
 the errors are not drawn (TGraph::Paint equivalent).

 if option "[]" is specified only the end vertical/horizonthal lines
 of the error bars are drawn. This option is interesting to superimpose
 systematic errors on top of a graph with statistical errors.

void Print(Option_t *) const
*-*-*-*-*-*-*-*-*-*-*Print graph and errors values*-*-*-*-*-*-*-*-*-*-*-*
*-*                  =============================


Int_t RemovePoint()
 Delete point close to the mouse position

Int_t RemovePoint(Int_t ipnt)
 Delete point number ipnt

void SavePrimitive(ofstream &out, Option_t *option)
 Save primitive as a C++ statement(s) on output stream out

void SetPoint(Int_t i, Double_t x, Double_t y)
*-*-*-*-*-*-*-*-*-*-*Set x and y values for point number i*-*-*-*-*-*-*-*-*
*-*                  =====================================

void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
*-*-*-*-*-*-*Set ex and ey values for point pointed by the mouse*-*-*-*
*-*          ===================================================

void SetPointError(Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
*-*-*-*-*-*-*-*-*-*-*Set ex and ey values for point number i*-*-*-*-*-*-*-*
*-*                  =======================================

void Streamer(TBuffer &b)
 Stream an object of class TGraphAsymmErrors.



Inline Functions


                Double_t* GetEXlow() const
                Double_t* GetEXhigh() const
                Double_t* GetEYlow() const
                Double_t* GetEYhigh() const
                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void StreamerNVirtual(TBuffer& b)
        TGraphAsymmErrors TGraphAsymmErrors(const TGraphAsymmErrors&)


Author: Rene Brun 03/03/99
Last update: root/graf:$Name: $:$Id: TGraphAsymmErrors.cxx,v 1.22 2002/08/09 20:45:43 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.