Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGraph.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Rene Brun, Olivier Couet 12/12/94
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGraph
13#define ROOT_TGraph
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TGraph //
19// //
20// Graph graphics class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TNamed.h"
25#include "TAttLine.h"
26#include "TAttFill.h"
27#include "TAttMarker.h"
28#include "TVectorFfwd.h"
29#include "TVectorDfwd.h"
30#include "TFitResultPtr.h"
31
32class TBrowser;
33class TAxis;
34class TH1;
35class TH1F;
36class TCollection;
37class TF1;
38class TSpline;
39class TList;
40
41class TGraph : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
42
43protected:
44
45 Int_t fMaxSize; ///<!Current dimension of arrays fX and fY
46 Int_t fNpoints; ///< Number of points <= fMaxSize
47 Double_t *fX; ///<[fNpoints] array of X points
48 Double_t *fY; ///<[fNpoints] array of Y points
49 TList *fFunctions; ///< Pointer to list of functions (fits and user)
50 TH1F *fHistogram; ///< Pointer to histogram used for drawing axis
51 Double_t fMinimum; ///< Minimum value for plotting along y
52 Double_t fMaximum; ///< Maximum value for plotting along y
53 TString fOption; ///< Options used for drawing the graph
54
55 static void SwapValues(Double_t* arr, Int_t pos1, Int_t pos2);
56 virtual void SwapPoints(Int_t pos1, Int_t pos2);
57 virtual void UpdateArrays(const std::vector<Int_t> &sorting_indices, Int_t numSortedPoints, Int_t low);
58
59 virtual Double_t **Allocate(Int_t newsize);
60 Double_t **AllocateArrays(Int_t Narrays, Int_t arraySize);
61 virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin);
62 virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin);
65 virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor = kTRUE);
67 virtual Bool_t DoMerge(const TGraph * g);
68
69 TString SaveArray(std::ostream &out, const char *suffix, Int_t frameNumber, Double_t *arr);
70 void SaveHistogramAndFunctions(std::ostream &out, const char *varname, Int_t &frameNumber, Option_t *option);
71
72public:
73 // TGraph status bits
75 kNoStats = BIT(9), ///< Don't draw stats box
76 kClipFrame = BIT(10), ///< Clip to the frame boundary
77 kResetHisto = BIT(17), ///< fHistogram must be reset in GetHistogram
78 kNotEditable = BIT(18), ///< Bit set if graph is non editable
79 kIsSortedX = BIT(19), ///< Graph is sorted in X points
80 kIsHighlight = BIT(20) ///< Bit set if graph is highlight
81 };
82
83 TGraph();
84 TGraph(Int_t n);
85 TGraph(Int_t n, const Int_t *x, const Int_t *y);
86 TGraph(Int_t n, const Float_t *x, const Float_t *y);
87 TGraph(Int_t n, const Double_t *x, const Double_t *y);
88 TGraph(Int_t n, const Double_t *y, Double_t start=0., Double_t step=1.);
89 TGraph(const TGraph &gr);
90 TGraph& operator=(const TGraph&);
91 TGraph(const TVectorF &vx, const TVectorF &vy);
92 TGraph(const TVectorD &vx, const TVectorD &vy);
93 TGraph(const TH1 *h);
94 TGraph(const TF1 *f, Option_t *option="");
95 TGraph(const char *filename, const char *format="%lg %lg", Option_t *option="");
96 ~TGraph() override;
97
98 virtual void AddPoint(Double_t x, Double_t y) { SetPoint(fNpoints, x, y); } ///< Append a new point to the graph.
99 virtual void Add(TF1 *f, Double_t c1=1);
100 virtual void Apply(TF1 *f);
101 void Browse(TBrowser *b) override;
102 virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const;
103 static Bool_t CompareArg(const TGraph* gr, Int_t left, Int_t right);
104 static Bool_t CompareX(const TGraph* gr, Int_t left, Int_t right);
105 static Bool_t CompareY(const TGraph* gr, Int_t left, Int_t right);
106 static Bool_t CompareRadius(const TGraph* gr, Int_t left, Int_t right);
107 virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
108 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
109 void Draw(Option_t *chopt="") override;
110 virtual void DrawGraph(Int_t n, const Int_t *x, const Int_t *y, Option_t *option="");
111 virtual void DrawGraph(Int_t n, const Float_t *x, const Float_t *y, Option_t *option="");
112 virtual void DrawGraph(Int_t n, const Double_t *x=nullptr, const Double_t *y=nullptr, Option_t *option="");
113 virtual void DrawPanel(); // *MENU*
114 virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const;
115 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
116 virtual void Expand(Int_t newsize);
117 virtual void Expand(Int_t newsize, Int_t step);
118 TObject *FindObject(const char *name) const override;
119 TObject *FindObject(const TObject *obj) const override;
120 virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0); // *MENU*
121 virtual TFitResultPtr Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0);
122 virtual void FitPanel(); // *MENU*
123 Bool_t GetEditable() const;
124 TF1 *GetFunction(const char *name) const;
125 virtual TH1F *GetHistogram() const;
127 virtual Double_t GetCorrelationFactor() const;
128 virtual Double_t GetCovariance() const;
129 virtual Double_t GetMean(Int_t axis=1) const;
130 virtual Double_t GetRMS(Int_t axis=1) const;
131 Int_t GetMaxSize() const {return fMaxSize;}
132 Int_t GetN() const {return fNpoints;}
133 virtual Double_t GetErrorX(Int_t bin) const;
134 virtual Double_t GetErrorY(Int_t bin) const;
135 virtual Double_t GetErrorXhigh(Int_t bin) const;
136 virtual Double_t GetErrorXlow(Int_t bin) const;
137 virtual Double_t GetErrorYhigh(Int_t bin) const;
138 virtual Double_t GetErrorYlow(Int_t bin) const;
139 Double_t *GetX() const {return fX;}
140 Double_t *GetY() const {return fY;}
141 virtual Double_t *GetEX() const {return nullptr;}
142 virtual Double_t *GetEY() const {return nullptr;}
143 virtual Double_t *GetEXhigh() const {return nullptr;}
144 virtual Double_t *GetEXlow() const {return nullptr;}
145 virtual Double_t *GetEYhigh() const {return nullptr;}
146 virtual Double_t *GetEYlow() const {return nullptr;}
147 virtual Double_t *GetEXlowd() const {return nullptr;}
148 virtual Double_t *GetEXhighd() const {return nullptr;}
149 virtual Double_t *GetEYlowd() const {return nullptr;}
150 virtual Double_t *GetEYhighd() const {return nullptr;}
151 Double_t GetMaximum() const {return fMaximum;}
152 Double_t GetMinimum() const {return fMinimum;}
153 TAxis *GetXaxis() const ;
154 TAxis *GetYaxis() const ;
155 char *GetObjectInfo(Int_t px, Int_t py) const override;
156 virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const;
157 virtual Double_t GetPointX(Int_t i) const;
158 virtual Double_t GetPointY(Int_t i) const;
159
160 virtual void InitExpo(Double_t xmin=0, Double_t xmax=0);
161 virtual void InitGaus(Double_t xmin=0, Double_t xmax=0);
162 virtual void InitPolynom(Double_t xmin=0, Double_t xmax=0);
163 virtual Int_t InsertPoint(); // *MENU*
164 virtual void InsertPointBefore(Int_t ipoint, Double_t x, Double_t y);
165 virtual Double_t Integral(Int_t first=0, Int_t last=-1) const;
166 virtual Bool_t IsEditable() const {return !TestBit(kNotEditable);}
167 virtual Bool_t IsHighlight() const { return TestBit(kIsHighlight); }
168 virtual Int_t IsInside(Double_t x, Double_t y) const;
169 virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin=0, Double_t xmax=0);
170 virtual void LeastSquareLinearFit(Int_t n, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin=0, Double_t xmax=0);
171 virtual Int_t Merge(TCollection* list);
172 virtual void MovePoints(Double_t dx, Double_t dy, Bool_t logx = kFALSE, Bool_t logy = kFALSE);
173 void Paint(Option_t *chopt="") override;
174 void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt);
175 void PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt);
176 virtual void PaintStats(TF1 *fit);
177 void Print(Option_t *chopt="") const override;
178 void RecursiveRemove(TObject *obj) override;
179 virtual Int_t RemovePoint(); // *MENU*
180 virtual Int_t RemovePoint(Int_t ipoint);
181 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
182 void SaveAs(const char *filename = "graph", Option_t *option = "") const override; // *MENU*
183 virtual void Scale(Double_t c1=1., Option_t *option="y"); // *MENU*
184 virtual void SetEditable(Bool_t editable=kTRUE); // *TOGGLE* *GETTER=GetEditable
185 virtual void SetHighlight(Bool_t set = kTRUE); // *TOGGLE* *GETTER=IsHighlight
186 virtual void SetHistogram(TH1F *h) {fHistogram = h;}
187 virtual void SetMaximum(Double_t maximum=-1111); // *MENU*
188 virtual void SetMinimum(Double_t minimum=-1111); // *MENU*
189 virtual void Set(Int_t n);
190 virtual void SetOption(Option_t *option = " ") { fOption = option; }
191 virtual void SetPoint(Int_t i, Double_t x, Double_t y);
192 virtual void SetPointX(Int_t i, Double_t x);
193 virtual void SetPointY(Int_t i, Double_t y);
194 void SetName(const char *name="") override; // *MENU*
195 void SetNameTitle(const char *name="", const char *title="") override;
196 virtual void SetStats(Bool_t stats=kTRUE); // *MENU*
197 void SetTitle(const char *title="") override; // *MENU*
198 virtual void Sort(Bool_t (*greater)(const TGraph*, Int_t, Int_t)=&TGraph::CompareX,
199 Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111);
200 void UseCurrentStyle() override;
201 void Zero(Int_t &k,Double_t AZ,Double_t BZ,Double_t E2,Double_t &X,Double_t &Y,Int_t maxiterations);
202
203 ClassDefOverride(TGraph, 5) // Graph graphics class
204};
205
206#endif
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
#define X(type, name)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
char name[80]
Definition TGX11.cxx:110
float xmin
float ymin
float xmax
float ymax
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
Marker Attributes class.
Definition TAttMarker.h:19
Class to manage histogram axis.
Definition TAxis.h:32
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Collection abstract base class.
Definition TCollection.h:65
1-Dim function class
Definition TF1.h:233
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
virtual Double_t GetPointX(Int_t i) const
Get x value for point i.
Definition TGraph.cxx:1546
virtual void AddPoint(Double_t x, Double_t y)
Append a new point to the graph.
Definition TGraph.h:98
virtual Double_t Integral(Int_t first=0, Int_t last=-1) const
Integrate the TGraph data within a given (index) range.
Definition TGraph.cxx:1810
Int_t fNpoints
Number of points <= fMaxSize.
Definition TGraph.h:46
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise.
Definition TGraph.cxx:1843
virtual void LeastSquareFit(Int_t m, Double_t *a, Double_t xmin=0, Double_t xmax=0)
Least squares polynomial fitting without weights.
Definition TGraph.cxx:1858
virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const
Return the chisquare of this graph with respect to f1.
Definition TGraph.cxx:679
void UseCurrentStyle() override
Set current style settings in this graph This function is called when either TCanvas::UseCurrentStyle...
Definition TGraph.cxx:2628
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition TGraph.cxx:2347
Double_t * GetY() const
Definition TGraph.h:140
virtual Int_t Merge(TCollection *list)
Adds all graphs from the collection to this graph.
Definition TGraph.cxx:2663
Int_t fMaxSize
!Current dimension of arrays fX and fY
Definition TGraph.h:45
void SaveHistogramAndFunctions(std::ostream &out, const char *varname, Int_t &frameNumber, Option_t *option)
Save histogram and list of functions of TGraph as C++ statement Used in all TGraph-derived classes.
Definition TGraph.cxx:2204
TString fOption
Options used for drawing the graph.
Definition TGraph.h:53
~TGraph() override
Graph default destructor.
Definition TGraph.cxx:568
Double_t ** ShrinkAndCopy(Int_t size, Int_t iend)
if size*2 <= fMaxSize allocate new arrays of size points, copy points [0,oend).
Definition TGraph.cxx:2458
virtual Double_t GetRMS(Int_t axis=1) const
Return RMS of X (axis=1) or Y (axis=2)
Definition TGraph.cxx:1341
virtual Double_t * GetEXhighd() const
Definition TGraph.h:148
virtual Bool_t IsEditable() const
Definition TGraph.h:166
TH1F * fHistogram
Pointer to histogram used for drawing axis.
Definition TGraph.h:50
void Paint(Option_t *chopt="") override
Draw this graph with its current attributes.
Definition TGraph.cxx:1979
EStatusBits
Definition TGraph.h:74
@ kNotEditable
Bit set if graph is non editable.
Definition TGraph.h:78
@ kIsHighlight
Bit set if graph is highlight.
Definition TGraph.h:80
@ kIsSortedX
Graph is sorted in X points.
Definition TGraph.h:79
@ kClipFrame
Clip to the frame boundary.
Definition TGraph.h:76
@ kResetHisto
fHistogram must be reset in GetHistogram
Definition TGraph.h:77
@ kNoStats
Don't draw stats box.
Definition TGraph.h:75
virtual Double_t GetErrorXlow(Int_t bin) const
It always returns a negative value.
Definition TGraph.cxx:1389
virtual void MovePoints(Double_t dx, Double_t dy, Bool_t logx=kFALSE, Bool_t logy=kFALSE)
Move all graph points on specified values dx,dy If log argument specified, calculation done in logari...
Definition TGraph.cxx:2696
virtual Double_t GetErrorYlow(Int_t bin) const
It always returns a negative value.
Definition TGraph.cxx:1407
virtual void UpdateArrays(const std::vector< Int_t > &sorting_indices, Int_t numSortedPoints, Int_t low)
Update the fX and fY arrays with the sorted values.
Definition TGraph.cxx:2597
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin !...
Definition TGraph.cxx:764
Double_t GetMinimum() const
Definition TGraph.h:152
void Print(Option_t *chopt="") const override
Print graph values.
Definition TGraph.cxx:2015
virtual Double_t * GetEYlow() const
Definition TGraph.h:146
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
Definition TGraph.cxx:2329
virtual Double_t * GetEX() const
Definition TGraph.h:141
static Bool_t CompareY(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fY[left] > fY[right]. Can be used by Sort.
Definition TGraph.cxx:715
static Bool_t CompareRadius(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s distance to origin is bigger than that of point number "right".
Definition TGraph.cxx:724
virtual Double_t GetErrorYhigh(Int_t bin) const
It always returns a negative value.
Definition TGraph.cxx:1398
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if fX[left] > fX[right]. Can be used by Sort.
Definition TGraph.cxx:707
Double_t GetMaximum() const
Definition TGraph.h:151
Int_t GetN() const
Definition TGraph.h:132
TF1 * GetFunction(const char *name) const
Return pointer to function with name.
Definition TGraph.cxx:1418
virtual Double_t * GetEXlowd() const
Definition TGraph.h:147
virtual void LeastSquareLinearFit(Int_t n, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin=0, Double_t xmax=0)
Least square linear fit without weights.
Definition TGraph.cxx:1933
Double_t * fY
[fNpoints] array of Y points
Definition TGraph.h:48
Bool_t CtorAllocate()
In constructors set fNpoints than call this method.
Definition TGraph.cxx:807
TString SaveArray(std::ostream &out, const char *suffix, Int_t frameNumber, Double_t *arr)
Save array as C++ code Returns name of created array.
Definition TGraph.cxx:2177
virtual void DrawGraph(Int_t n, const Int_t *x, const Int_t *y, Option_t *option="")
Draw this graph with new attributes.
Definition TGraph.cxx:891
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Fit this graph with function with name fname.
Definition TGraph.cxx:1256
virtual void Sort(Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
Sorts the points of this TGraph using in-place quicksort (see e.g.
Definition TGraph.cxx:2491
static Bool_t CompareArg(const TGraph *gr, Int_t left, Int_t right)
Return kTRUE if point number "left"'s argument (angle with respect to positive x-axis) is bigger than...
Definition TGraph.cxx:696
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
Definition TGraph.cxx:733
char * GetObjectInfo(Int_t px, Int_t py) const override
Implementation to get information on point of graph at cursor position Adapted from class TH1.
Definition TGraph.cxx:1587
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
Definition TGraph.cxx:600
virtual void Scale(Double_t c1=1., Option_t *option="y")
Multiply the values of a TGraph by a constant c1.
Definition TGraph.cxx:2264
TList * fFunctions
Pointer to list of functions (fits and user)
Definition TGraph.h:49
virtual Double_t GetCovariance() const
Return covariance of vectors x,y.
Definition TGraph.cxx:1310
virtual Double_t * GetEYlowd() const
Definition TGraph.h:149
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
Definition TGraph.cxx:2616
void Zero(Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
Find zero of a continuous function.
Definition TGraph.cxx:2722
virtual Double_t ** Allocate(Int_t newsize)
Allocate internal data structures for newsize points.
Definition TGraph.cxx:592
virtual void FitPanel()
Display a GUI panel with all graph fit options.
Definition TGraph.cxx:1276
void Browse(TBrowser *b) override
Browse.
Definition TGraph.cxx:653
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
Definition TGraph.cxx:2681
virtual void InsertPointBefore(Int_t ipoint, Double_t x, Double_t y)
Insert a new point with coordinates (x,y) before the point number ipoint.
Definition TGraph.cxx:1751
TList * GetListOfFunctions() const
Definition TGraph.h:126
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TGraph.cxx:1058
Double_t * GetX() const
Definition TGraph.h:139
void SaveAs(const char *filename="graph", Option_t *option="") const override
Save the graph as .csv, .tsv or .txt.
Definition TGraph.cxx:2095
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
Interpolate points in this graph at x using a TSpline.
Definition TGraph.cxx:955
Int_t GetMaxSize() const
Definition TGraph.h:131
virtual void InitExpo(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for an exponential.
Definition TGraph.cxx:1660
virtual Int_t RemovePoint()
Delete point close to the mouse position Returns index of removed point (or -1 if nothing was changed...
Definition TGraph.cxx:2039
virtual void InitGaus(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a gaussian.
Definition TGraph.cxx:1622
virtual Bool_t IsHighlight() const
Definition TGraph.h:167
virtual void Add(TF1 *f, Double_t c1=1)
Performs the operation: y = y + c1*f(x,y) Errors are not recalculated.
Definition TGraph.cxx:624
virtual void Apply(TF1 *f)
Apply function f to all the data points f may be a 1-D function TF1 or 2-d function TF2 The Y values ...
Definition TGraph.cxx:640
void SetName(const char *name="") override
Set graph name.
Definition TGraph.cxx:2386
virtual void SetHighlight(Bool_t set=kTRUE)
Set highlight (enable/disable) mode for the graph by default highlight mode is disable.
Definition TGraph.cxx:2316
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
Definition TGraph.cxx:2588
virtual Double_t * GetEYhighd() const
Definition TGraph.h:150
virtual void SetOption(Option_t *option=" ")
Definition TGraph.h:190
TAxis * GetXaxis() const
Get x axis of the graph.
Definition TGraph.cxx:1568
Bool_t GetEditable() const
Return kTRUE if kNotEditable bit is not set, kFALSE otherwise.
Definition TGraph.cxx:2297
virtual Double_t * GetEXhigh() const
Definition TGraph.h:143
virtual Double_t GetCorrelationFactor() const
Return graph correlation factor.
Definition TGraph.cxx:1298
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end) Should be redefined in descendant classes.
Definition TGraph.cxx:1104
virtual Double_t * GetEYhigh() const
Definition TGraph.h:145
Double_t ** ExpandAndCopy(Int_t size, Int_t iend)
if size > fMaxSize allocate new arrays of 2*size points and copy iend first points.
Definition TGraph.cxx:1091
virtual void Expand(Int_t newsize)
If array sizes <= newsize, expand storage to 2*newsize.
Definition TGraph.cxx:1067
virtual Double_t GetMean(Int_t axis=1) const
Return mean value of X (axis=1) or Y (axis=2)
Definition TGraph.cxx:1326
Double_t * fX
[fNpoints] array of X points
Definition TGraph.h:47
virtual void PaintStats(TF1 *fit)
Draw the stats.
Definition TGraph.cxx:2006
TAxis * GetYaxis() const
Get y axis of the graph.
Definition TGraph.cxx:1577
TObject * FindObject(const char *name) const override
Search object named name in the list of functions.
Definition TGraph.cxx:1113
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TGraph.cxx:2436
virtual TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
Definition TGraph.cxx:1430
virtual Double_t GetErrorY(Int_t bin) const
It always returns a negative value. Real implementation in TGraphErrors.
Definition TGraph.cxx:1371
virtual Double_t * GetEY() const
Definition TGraph.h:142
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TGraph.cxx:2147
virtual Double_t GetPointY(Int_t i) const
Get y value for point i.
Definition TGraph.cxx:1557
virtual void SetHistogram(TH1F *h)
Definition TGraph.h:186
Double_t fMinimum
Minimum value for plotting along y.
Definition TGraph.h:51
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
Definition TGraph.cxx:1988
void SetTitle(const char *title="") override
Change (i.e.
Definition TGraph.cxx:2402
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
Definition TGraph.cxx:1701
virtual Double_t * GetEXlow() const
Definition TGraph.h:144
void RecursiveRemove(TObject *obj) override
Recursively remove object from the list of functions.
Definition TGraph.cxx:2025
virtual void SetPointY(Int_t i, Double_t y)
Set y value for point i.
Definition TGraph.cxx:2379
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
Definition TGraph.cxx:881
virtual void DrawPanel()
Display a panel with all graph drawing options.
Definition TGraph.cxx:934
void PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a histogram.
Definition TGraph.cxx:1997
void SetNameTitle(const char *name="", const char *title="") override
Set graph name and title.
Definition TGraph.cxx:2422
virtual void SetPointX(Int_t i, Double_t x)
Set x value for point i.
Definition TGraph.cxx:2371
virtual void Set(Int_t n)
Set number of points in the graph Existing coordinates are preserved New coordinates above fNpoints a...
Definition TGraph.cxx:2282
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
Definition TGraph.cxx:1535
virtual void SetEditable(Bool_t editable=kTRUE)
if editable=kFALSE, the graph cannot be modified with the mouse by default a TGraph is editable
Definition TGraph.cxx:2306
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
Definition TGraph.cxx:2338
TGraph()
Graph default constructor.
Definition TGraph.cxx:110
virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin !...
Definition TGraph.cxx:781
Double_t fMaximum
Maximum value for plotting along y.
Definition TGraph.h:52
virtual Double_t GetErrorXhigh(Int_t bin) const
It always returns a negative value.
Definition TGraph.cxx:1380
TGraph & operator=(const TGraph &)
Equal operator for this graph.
Definition TGraph.cxx:234
virtual void InitPolynom(Double_t xmin=0, Double_t xmax=0)
Compute Initial values of parameters for a polynom.
Definition TGraph.cxx:1681
virtual Double_t GetErrorX(Int_t bin) const
It always returns a negative value. Real implementation in TGraphErrors.
Definition TGraph.cxx:1363
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:623
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
Base class for spline implementation containing the Draw/Paint methods.
Definition TSpline.h:31
Basic string class.
Definition TString.h:139
TVectorT.
Definition TVectorT.h:29
Double_t y[n]
Definition legend1.C:17
return c1
Definition legend1.C:41
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TGraphErrors * gr
Definition legend1.C:25
TF1 * f1
Definition legend1.C:11
th1 Draw()
TMarker m
Definition textangle.C:8