ROOT  6.06/09
Reference Guide
TPaveStats.cxx
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 15/03/99
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 #include <string.h>
13 #include <stdlib.h>
14 #include <stdio.h>
15 
16 #include "Riostream.h"
17 #include "TROOT.h"
18 #include "TPaveStats.h"
19 #include "TPaveLabel.h"
20 #include "TVirtualPad.h"
21 #include "TStyle.h"
22 #include "TClass.h"
23 #include "TLatex.h"
24 
26 
27 /** \class TPaveStats
28 \ingroup BasicGraphics
29 
30 The histogram statistics painter class.
31 
32 To draw histogram statistics and fit parameters.
33 
34 - [Statistics Display](#PS01)
35 - [Fit Statistics](#PS02)
36 - [Statistics box editing](#PS03)
37 
38 ## <a name="PS01"></a> Statistics Display
39 
40 The type of information shown in the histogram statistics box can be selected
41 with:
42 ~~~ {.cpp}
43  gStyle->SetOptStat(mode);
44 ~~~
45 
46 The "`mode`" has up to nine digits that can be set to on (1 or 2), off (0).
47 ~~~ {.cpp}
48  mode = ksiourmen (default = 000001111)
49  k = 1; kurtosis printed
50  k = 2; kurtosis and kurtosis error printed
51  s = 1; skewness printed
52  s = 2; skewness and skewness error printed
53  i = 1; integral of bins printed
54  o = 1; number of overflows printed
55  u = 1; number of underflows printed
56  r = 1; rms printed
57  r = 2; rms and rms error printed
58  m = 1; mean value printed
59  m = 2; mean and mean error values printed
60  e = 1; number of entries printed
61  n = 1; name of histogram is printed
62 ~~~
63 
64 For example:
65 ~~~ {.cpp}
66  gStyle->SetOptStat(11);
67 ~~~
68 displays only the name of histogram and the number of entries, whereas:
69 ~~~ {.cpp}
70  gStyle->SetOptStat(1101);
71 ~~~
72 displays the name of histogram, mean value and RMS.
73 
74 <b>WARNING 1:</b> never do:
75 ~~~ {.cpp}
76  gStyle->SetOptStat(0001111);
77 ~~~
78 but instead do:
79 ~~~ {.cpp}
80  gStyle->SetOptStat(1111);
81 ~~~
82 because `0001111` will be taken as an octal number!
83 
84 <b>WARNING 2:</b> for backward compatibility with older versions
85 ~~~ {.cpp}
86  gStyle->SetOptStat(1);
87 ~~~
88 is taken as:
89 ~~~ {.cpp}
90  gStyle->SetOptStat(1111)
91 ~~~
92 To print only the name of the histogram do:
93 ~~~ {.cpp}
94  gStyle->SetOptStat(1000000001);
95 ~~~
96 
97 <b>NOTE</b> that in case of 2D histograms, when selecting only underflow
98 (10000) or overflow (100000), the statistics box will show all combinations
99 of underflow/overflows and not just one single number.
100 
101 The parameter mode can be any combination of the letters `kKsSiourRmMen`
102 ~~~ {.cpp}
103  k : kurtosis printed
104  K : kurtosis and kurtosis error printed
105  s : skewness printed
106  S : skewness and skewness error printed
107  i : integral of bins printed
108  o : number of overflows printed
109  u : number of underflows printed
110  r : rms printed
111  R : rms and rms error printed
112  m : mean value printed
113  M : mean value mean error values printed
114  e : number of entries printed
115  n : name of histogram is printed
116 ~~~
117 
118 For example, to print only name of histogram and number of entries do:
119 ~~~ {.cpp}
120  gStyle->SetOptStat("ne");
121 ~~~
122 
123 To print only the name of the histogram do:
124 ~~~ {.cpp}
125  gStyle->SetOptStat("n");
126 ~~~
127 
128 The default value is:
129 ~~~ {.cpp}
130  gStyle->SetOptStat("nemr");
131 ~~~
132 
133 When a histogram is painted, a `TPaveStats` object is created and added
134 to the list of functions of the histogram. If a `TPaveStats` object
135 already exists in the histogram list of functions, the existing object is just
136 updated with the current histogram parameters.
137 
138 Once a histogram is painted, the statistics box can be accessed using
139 `h->FindObject("stats")`. In the command line it is enough to do:
140 ~~~ {.cpp}
141  Root > h->Draw()
142  Root > TPaveStats *st = (TPaveStats*)h->FindObject("stats")
143 ~~~
144 
145 because after `h->Draw()` the histogram is automatically painted. But
146 in a script file the painting should be forced using `gPad->Update()`
147 in order to make sure the statistics box is created:
148 ~~~ {.cpp}
149  h->Draw();
150  gPad->Update();
151  TPaveStats *st = (TPaveStats*)h->FindObject("stats");
152 ~~~
153 
154 Without `gPad->Update()` the line `h->FindObject("stats")`
155 returns a null pointer.
156 
157 When a histogram is drawn with the option "`SAME`", the statistics box
158 is not drawn. To force the statistics box drawing with the option
159 "`SAME`", the option "`SAMES`" must be used.
160 If the new statistics box hides the previous statistics box, one can change
161 its position with these lines ("`h`" being the pointer to the histogram):
162 ~~~ {.cpp}
163  Root > TPaveStats *st = (TPaveStats*)h->FindObject("stats")
164  Root > st->SetX1NDC(newx1); //new x start position
165  Root > st->SetX2NDC(newx2); //new x end position
166 ~~~
167 
168 To change the type of information for an histogram with an existing
169 `TPaveStats` one should do:
170 ~~~ {.cpp}
171  st->SetOptStat(mode);
172 ~~~
173 Where "`mode`" has the same meaning than when calling
174 `gStyle->SetOptStat(mode)` (see above).
175 
176 One can delete the statistics box for a histogram `TH1* h` with:
177 ~~~ {.cpp}
178  h->SetStats(0)
179 ~~~
180 
181 and activate it again with:
182 ~~~ {.cpp}
183  h->SetStats(1).
184 ~~~
185 
186 ## <a name="PS02"></a> Fit Statistics
187 
188 The type of information about fit parameters printed in the histogram statistics
189 box can be selected via the parameter mode. The parameter mode can be
190 `= pcev` (default `= 0111`)
191 ~~~ {.cpp}
192  p = 1; print Probability
193  c = 1; print Chisquare/Number of degrees of freedom
194  e = 1; print errors (if e=1, v must be 1)
195  v = 1; print name/values of parameters
196 ~~~
197 Example:
198 ~~~ {.cpp}
199  gStyle->SetOptFit(1011);
200 ~~~
201 print fit probability, parameter names/values and errors.
202 
203  1. When `"v" = 1` is specified, only the non-fixed parameters are
204  shown.
205  2. When `"v" = 2` all parameters are shown.
206 
207 Note: `gStyle->SetOptFit(1)` means "default value", so it is equivalent
208 to `gStyle->SetOptFit(111)`
209 
210 ## <a name="PS03"></a> Statistics box editing
211 
212 The following example show how to remove and add a line in a statistics box.
213 
214 Begin_Macro(source)
215 ../../../tutorials/hist/statsEditing.C
216 End_Macro
217 */
218 
219 
220 const UInt_t kTakeStyle = BIT(17); //see TStyle::SetOptFit/Stat
221 
222 ////////////////////////////////////////////////////////////////////////////////
223 /// TPaveStats default constructor.
224 
226 {
227  fParent = 0;
228  fOptFit = gStyle->GetOptFit();
229  fOptStat = gStyle->GetOptStat();
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// TPaveStats normal constructor.
234 
236  :TPaveText(x1,y1,x2,y2,option)
237 {
238  fParent = 0;
239  fOptFit = gStyle->GetOptFit();
240  fOptStat = gStyle->GetOptStat();
241  SetFitFormat(gStyle->GetFitFormat());
242  SetStatFormat(gStyle->GetStatFormat());
243 }
244 
245 ////////////////////////////////////////////////////////////////////////////////
246 /// TPaveStats default destructor.
247 
249 {
251 }
252 
253 ////////////////////////////////////////////////////////////////////////////////
254 /// Return the fit option.
255 
257 {
258  if (TestBit(kTakeStyle)) return gStyle->GetOptFit();
259  return fOptFit;
260 }
261 
262 ////////////////////////////////////////////////////////////////////////////////
263 /// Return the stat option.
264 
266 {
267  if (TestBit(kTakeStyle)) return gStyle->GetOptStat();
268  return fOptStat;
269 }
270 
271 ////////////////////////////////////////////////////////////////////////////////
272 /// Save This TPaveStats options in current style.
273 
275 {
276  gStyle->SetOptFit(fOptFit);
277  gStyle->SetOptStat(fOptStat);
280 }
281 
282 ////////////////////////////////////////////////////////////////////////////////
283 /// Change (i.e. set) the format for printing fit parameters in statistics box.
284 
285 void TPaveStats::SetFitFormat(const char *form)
286 {
287  fFitFormat = form;
288 }
289 
290 ////////////////////////////////////////////////////////////////////////////////
291 /// Set the fit option.
292 
294 {
295  fOptFit = fit;
297 }
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Set the stat option.
301 
302 void TPaveStats::SetOptStat(Int_t stat)
303 {
304  fOptStat = stat;
306 }
307 
308 ////////////////////////////////////////////////////////////////////////////////
309 /// Change (i.e. set) the format for printing statistics.
310 
311 void TPaveStats::SetStatFormat(const char *form)
312 {
313  fStatFormat = form;
314 }
315 
316 ////////////////////////////////////////////////////////////////////////////////
317 /// Paint the pave stat.
318 
319 void TPaveStats::Paint(Option_t *option)
320 {
323 
324  if (!fLines) return;
325  TString typolabel;
326  Double_t y2ref = TMath::Max(fY1,fY2);
327  Double_t x1ref = TMath::Min(fX1,fX2);
328  Double_t x2ref = TMath::Max(fX1,fX2);
329  Double_t dx = TMath::Abs(fX2 - fX1);
330  Double_t dy = TMath::Abs(fY2 - fY1);
331  Double_t titlesize=0;
332  Double_t textsize = GetTextSize();
333  Int_t nlines = GetSize();
334  if (nlines == 0) nlines = 5;
335  Int_t print_name = fOptStat%10;
336 
337  // Evaluate text size as a function of the number of lines
338  Double_t y1 = gPad->GetY1();
339  Double_t y2 = gPad->GetY2();
340  Float_t margin = fMargin*dx;
341  Double_t yspace = dy/Double_t(nlines);
342  Double_t textsave = textsize;
343  TObject *line;
344  TLatex *latex, *latex_tok;
345  TIter next(fLines);
346  Double_t longest = 0, titlelength = 0;
347  Double_t w, wtok[2];
348  char *st, *sl=0;
349  if (textsize == 0) {
350  textsize = 0.92*yspace/(y2 - y1);
351  titlesize = textsize;
352  wtok[0] = 0; wtok[1] = 0;
353  while ((line = (TObject*) next())) {
354  if (line->IsA() == TLatex::Class()) {
355  latex = (TLatex*)line;
356  Int_t nchs = strlen(latex->GetTitle());
357  sl = new char[nchs+1];
358  strlcpy(sl, latex->GetTitle(),nchs+1);
359  if (strpbrk(sl, "=") !=0 && print_name == 0) {
360  st = strtok(sl, "=");
361  Int_t itok = 0;
362  while ( st !=0 ) {
363  latex_tok = new TLatex(0.,0.,st);
364  Style_t tfont = latex->GetTextFont();
365  if (tfont == 0) tfont = GetTextFont();
366  latex_tok->SetTextFont(tfont);
367  latex_tok->SetTextSize(textsize);
368  w = latex_tok->GetXsize();
369  if (w > wtok[itok]) wtok[itok] = w;
370  st = strtok(0, "=");
371  ++itok;
372  delete latex_tok;
373  }
374  } else if (strpbrk(sl, "|") !=0) {
375  } else {
376  print_name = 0;
377  Style_t tfont = latex->GetTextFont();
378  if (tfont == 0) latex->SetTextFont(GetTextFont());
379  latex->SetTextSize(titlesize);
380  titlelength = latex->GetXsize()+2.*margin;
381  if (titlelength > 0.98*dx) titlesize *= 0.98*dx/titlelength;
382  latex->SetTextFont(tfont);
383  }
384  delete [] sl; sl = 0;
385  }
386  }
387  longest = wtok[0]+wtok[1]+2.*margin;
388  if (longest > 0.98*dx) textsize *= 0.98*dx/longest;
389  SetTextSize(textsize);
390  } else {
391  titlesize = textsize;
392  }
393  Double_t ytext = y2ref + 0.5*yspace;
394  Double_t xtext = 0;
395  print_name = fOptStat%10;
396 
397  // Iterate over all lines
398  // Copy pavetext attributes to line attributes if line attributes not set
399  next.Reset();
400  while ((line = (TObject*) next())) {
401  if (line->IsA() == TLatex::Class()) {
402  latex = (TLatex*)line;
403  ytext -= yspace;
404  Double_t xl = latex->GetX();
405  Double_t yl = latex->GetY();
406  Short_t talign = latex->GetTextAlign();
407  Color_t tcolor = latex->GetTextColor();
408  Style_t tfont = latex->GetTextFont();
409  Size_t tsize = latex->GetTextSize();
410  if (tcolor == 0) latex->SetTextColor(GetTextColor());
411  if (tfont == 0) latex->SetTextFont(GetTextFont());
412  if (tsize == 0) latex->SetTextSize(GetTextSize());
413 
414  Int_t nchs = strlen(latex->GetTitle());
415  sl = new char[nchs+1];
416  strlcpy(sl, latex->GetTitle(),nchs+1);
417  // Draw all the histogram stats except the 2D under/overflow
418  if (strpbrk(sl, "=") !=0 && print_name == 0) {
419  st = strtok(sl, "=");
420  Int_t halign = 12;
421  while ( st !=0 ) {
422  typolabel = st;
423  latex->SetTextAlign(halign);
424  if (halign == 12) xtext = x1ref + margin;
425  if (halign == 32) {
426  xtext = x2ref - margin;
427  typolabel = typolabel.Strip();
428  typolabel.ReplaceAll("-","#minus");
429  }
430  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
431  latex->GetTextSize(),
432  typolabel.Data());
433  st = strtok(0, "=");
434  halign = 32;
435  }
436  // Draw the 2D under/overflow
437  } else if (strpbrk(sl, "|") !=0) {
438  Double_t yline1 = ytext+yspace/2.;
439  Double_t yline2 = ytext-yspace/2.;
440  Double_t xline1 = dx/3+x1ref;
441  Double_t xline2 = 2*dx/3+x1ref;
442  gPad->PaintLine(x1ref,yline1,x2ref,yline1);
443  gPad->PaintLine(xline1,yline1,xline1,yline2);
444  gPad->PaintLine(xline2,yline1,xline2,yline2);
445  st = strtok(sl, "|");
446  Int_t theIndex = 0;
447  while ( st !=0 ) {
448  latex->SetTextAlign(22);
449  if (theIndex == 0) xtext = 0.5*(x1ref+xline1);
450  if (theIndex == 1) xtext = 0.5*(x1ref+x2ref);
451  if (theIndex == 2) xtext = 0.5*(xline2+x2ref);
452  typolabel = st;
453  typolabel.ReplaceAll("-", "#minus");
454  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
455  latex->GetTextSize(),
456  typolabel.Data());
457  theIndex++;
458  st = strtok(0, "|");
459  }
460  // Draw the histogram identifier
461  } else {
462  print_name = 0;
463  latex->SetTextAlign(22);
464  xtext = 0.5*(x1ref+x2ref);
465  latex->PaintLatex(xtext,ytext,latex->GetTextAngle(),
466  titlesize,
467  sl);
468  gPad->PaintLine(x1ref,y2ref-yspace,x2ref,y2ref-yspace);
469  }
470  delete [] sl;
471 
472  latex->SetTextAlign(talign);
473  latex->SetTextColor(tcolor);
474  latex->SetTextFont(tfont);
475  latex->SetTextSize(tsize);
476  latex->SetX(xl); //paintlatex modifies fX and fY
477  latex->SetY(yl);
478  }
479  }
480  SetTextSize(textsave);
481 
482  // if a label create & paint a pavetext title
483  if (fLabel.Length() > 0) {
484  Double_t x1,x2;
485  dy = gPad->GetY2() - gPad->GetY1();
486  x1 = x1ref + 0.25*dx;
487  x2 = x2ref - 0.25*dx;
488  y1 = y2ref - 0.02*dy;
489  y2 = y2ref + 0.02*dy;
490  TPaveLabel *title = new TPaveLabel(x1,y1,x2,y2,fLabel.Data(),GetDrawOption());
491  title->SetFillColor(GetFillColor());
492  title->SetTextColor(GetTextColor());
493  title->SetTextFont(GetTextFont());
494  title->Paint();
495  delete title;
496  }
497 }
498 
499 ////////////////////////////////////////////////////////////////////////////////
500 /// Save primitive as a C++ statement(s) on output stream out.
501 
502 void TPaveStats::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
503 {
504  char quote = '"';
505  out<<" "<<std::endl;
506  if (gROOT->ClassSaved(TPaveStats::Class())) {
507  out<<" ";
508  } else {
509  out<<" "<<ClassName()<<" *";
510  }
511  if (fOption.Contains("NDC")) {
512  out<<"ptstats = new "<<ClassName()<<"("<<fX1NDC<<","<<fY1NDC<<","<<fX2NDC<<","<<fY2NDC
513  <<","<<quote<<fOption<<quote<<");"<<std::endl;
514  } else {
515  out<<"ptstats = new "<<ClassName()<<"("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
516  <<","<<quote<<fOption<<quote<<");"<<std::endl;
517  }
518  if (strcmp(GetName(),"TPave")) {
519  out<<" ptstats->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
520  }
521  if (fBorderSize != 4) {
522  out<<" ptstats->SetBorderSize("<<fBorderSize<<");"<<std::endl;
523  }
524  SaveFillAttributes(out,"ptstats",19,1001);
525  SaveLineAttributes(out,"ptstats",1,1,1);
526  SaveTextAttributes(out,"ptstats",22,0,1,62,0);
527  SaveLines(out,"ptstats");
528  out<<" ptstats->SetOptStat("<<GetOptStat()<<");"<<std::endl;
529  out<<" ptstats->SetOptFit("<<GetOptFit()<<");"<<std::endl;
530  out<<" ptstats->Draw();"<<std::endl;
531 }
532 
533 ////////////////////////////////////////////////////////////////////////////////
534 /// Stream an object of class TPaveStats.
535 
536 void TPaveStats::Streamer(TBuffer &R__b)
537 {
538  if (R__b.IsReading()) {
539  UInt_t R__s, R__c;
540  Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
541  if (R__v > 2) {
542  R__b.ReadClassBuffer(TPaveStats::Class(), this, R__v, R__s, R__c);
543  return;
544  }
545  //====process old versions before automatic schema evolution
546  TPaveText::Streamer(R__b);
547  R__b >> fOptFit;
548  R__b >> fOptStat;
549  if (R__v > 1 || R__b.GetVersionOwner() == 22304) {
550  fFitFormat.Streamer(R__b);
551  fStatFormat.Streamer(R__b);
552  } else {
553  SetFitFormat();
554  SetStatFormat();
555  }
556  R__b.CheckByteCount(R__s, R__c, TPaveStats::IsA());
557  //====end of old versions
558 
559  } else {
560  R__b.WriteClassBuffer(TPaveStats::Class(),this);
561  }
562 }
563 
564 ////////////////////////////////////////////////////////////////////////////////
565 /// Replace current attributes by current style.
566 
568 {
569  if (gStyle->IsReading()) {
584  } else {
600  }
601 }
Int_t fOptFit
Definition: TPaveStats.h:31
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
virtual Style_t GetFillStyle() const
Definition: TAttFill.h:44
void SetOptFit(Int_t fit=1)
Set the fit option.
Definition: TPaveStats.cxx:294
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Float_t GetTextAngle() const
Definition: TAttText.h:47
virtual Font_t GetTextFont() const
Definition: TAttText.h:49
short Style_t
Definition: RtypesCore.h:76
void SetStatColor(Color_t color=19)
Definition: TStyle.h:384
Bool_t IsReading() const
Definition: TBuffer.h:81
short Version_t
Definition: RtypesCore.h:61
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual const char * GetFitFormat() const
Definition: TPaveStats.h:45
Ssiz_t Length() const
Definition: TString.h:390
TLine * line
float Float_t
Definition: RtypesCore.h:53
void SetStatH(Float_t h=0.1)
Definition: TStyle.h:394
float Size_t
Definition: RtypesCore.h:83
Float_t fMargin
Definition: TPaveText.h:40
const char Option_t
Definition: RtypesCore.h:62
virtual void SetX2NDC(Double_t x2)
Definition: TPave.h:88
void SetStatStyle(Style_t style=1001)
Definition: TStyle.h:386
virtual void SetX(Double_t x)
Definition: TText.h:91
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:635
Int_t fOptStat
Definition: TPaveStats.h:32
R__EXTERN TStyle * gStyle
Definition: TStyle.h:423
#define BIT(n)
Definition: Rtypes.h:120
Int_t GetBorderSize() const
Definition: TPave.h:63
Double_t fY2
Definition: TBox.h:53
virtual void SaveStyle()
Save This TPaveStats options in current style.
Definition: TPaveStats.cxx:275
TObject * fParent
Definition: TPaveStats.h:35
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
virtual Float_t GetTextSize() const
Definition: TAttText.h:50
Double_t GetX1NDC() const
Definition: TPave.h:68
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
#define gROOT
Definition: TROOT.h:340
Double_t GetY() const
Definition: TText.h:76
void SetStatX(Float_t x=0)
Definition: TStyle.h:391
void SetStatBorderSize(Width_t size=2)
Definition: TStyle.h:387
Basic string class.
Definition: TString.h:137
Double_t GetY1NDC() const
Definition: TPave.h:70
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:170
int Int_t
Definition: RtypesCore.h:41
Int_t GetOptStat() const
Definition: TStyle.h:253
virtual void SetFillStyle(Style_t fstyle)
Definition: TAttFill.h:52
The histogram statistics painter class.
Definition: TPaveStats.h:28
void SetStatY(Float_t y=0)
Definition: TStyle.h:392
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPaveStats.cxx:503
TPaveStats()
TPaveStats default constructor.
Definition: TPaveStats.cxx:226
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
TString fStatFormat
Definition: TPaveStats.h:34
void Reset()
Definition: TCollection.h:161
Style_t GetStatFont() const
Definition: TStyle.h:268
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
Definition: TObject.cxx:616
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition: TPave.cxx:121
Double_t fY1
Definition: TBox.h:51
const UInt_t kTakeStyle
Definition: TStyle.cxx:28
const char * Data() const
Definition: TString.h:349
virtual void SetTextFont(Font_t tfont=62)
Definition: TAttText.h:59
static const double x2[5]
virtual Short_t GetTextAlign() const
Definition: TAttText.h:46
Double_t fX1NDC
Definition: TPave.h:34
void Class()
Definition: Class.C:29
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:399
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttLine.cxx:257
virtual Int_t GetVersionOwner() const =0
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
Definition: TPaveStats.cxx:312
Width_t GetStatBorderSize() const
Definition: TStyle.h:267
To draw Mathematical Formula.
Definition: TLatex.h:33
virtual Color_t GetTextColor() const
Definition: TAttText.h:48
TList * fLines
Definition: TPaveText.h:41
virtual ~TPaveStats()
TPaveStats default destructor.
Definition: TPaveStats.cxx:249
TString fLabel
Definition: TPaveText.h:38
Color_t GetStatColor() const
Definition: TStyle.h:265
Double_t GetY2NDC() const
Definition: TPave.h:71
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Definition: TLatex.cxx:2025
char * out
Definition: TBase64.cxx:29
Int_t GetOptFit() const
Definition: TStyle.h:252
short Color_t
Definition: RtypesCore.h:79
virtual void SetTextAlign(Short_t align=11)
Definition: TAttText.h:55
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:32
Bool_t IsReading() const
Definition: TStyle.h:296
Float_t GetStatY() const
Definition: TStyle.h:273
Double_t GetXsize()
Return size of the formula along X in pad coordinates.
Definition: TLatex.cxx:2481
virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
Save text attributes as C++ statement(s) on output stream out.
Definition: TAttText.cxx:344
virtual void SetFillColor(Color_t fcolor)
Definition: TAttFill.h:50
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:187
Double_t fX2
Definition: TBox.h:52
virtual Color_t GetFillColor() const
Definition: TAttFill.h:43
virtual void SetX1NDC(Double_t x1)
Definition: TPave.h:87
TClass * IsA() const
void SetOptFit(Int_t fit=1)
The type of information about fit parameters printed in the histogram statistics box can be selected ...
Definition: TStyle.cxx:1204
void SetStatTextColor(Color_t color=1)
Definition: TStyle.h:385
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition: TAttFill.cxx:229
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
Double_t fX1
tool tip associated with box
Definition: TBox.h:50
Float_t GetStatW() const
Definition: TStyle.h:274
short Short_t
Definition: RtypesCore.h:35
void SetStatW(Float_t w=0.19)
Definition: TStyle.h:393
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1069
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Definition: TPaveStats.cxx:286
Option_t * GetName() const
Returns name of object.
Definition: TPave.h:65
Int_t fBorderSize
Definition: TPave.h:38
virtual const char * GetStatFormat() const
Definition: TPaveStats.h:46
virtual void SetY2NDC(Double_t y2)
Definition: TPave.h:90
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Double_t fY2NDC
Definition: TPave.h:37
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:35
#define ClassImp(name)
Definition: Rtypes.h:279
double Double_t
Definition: RtypesCore.h:55
Float_t GetStatFontSize() const
Definition: TStyle.h:269
Style_t GetStatStyle() const
Definition: TStyle.h:270
Double_t GetX2NDC() const
Definition: TPave.h:69
Double_t fX2NDC
Definition: TPave.h:36
virtual void UseCurrentStyle()
Replace current attributes by current style.
Definition: TPaveStats.cxx:568
Mother of all ROOT objects.
Definition: TObject.h:58
Float_t GetStatX() const
Definition: TStyle.h:272
void SetStatFontSize(Float_t size=0)
Definition: TStyle.h:389
const char * GetFitFormat() const
Definition: TStyle.h:209
Int_t GetOptStat() const
Return the stat option.
Definition: TPaveStats.cxx:266
virtual Int_t GetSize() const
return number of text lines (ignoring TLine, etc)
Definition: TPaveText.cxx:345
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:202
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition: TStyle.cxx:1252
#define gPad
Definition: TVirtualPad.h:288
virtual void SetTextColor(Color_t tcolor=1)
Definition: TAttText.h:57
virtual void SetY(Double_t y)
Definition: TText.h:92
virtual void Paint(Option_t *option="")
Paint the pave stat.
Definition: TPaveStats.cxx:320
Double_t fY1NDC
Definition: TPave.h:35
void SetStatFormat(const char *format="6.4g")
Definition: TStyle.h:390
void ResetBit(UInt_t f)
Definition: TObject.h:172
Color_t GetStatTextColor() const
Definition: TStyle.h:266
virtual void PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition: TPave.cxx:294
virtual void SetTextSize(Float_t tsize=1)
Definition: TAttText.h:60
void SetFitFormat(const char *format="5.4g")
Definition: TStyle.h:301
TString fOption
Definition: TPave.h:42
TString fFitFormat
Definition: TPaveStats.h:33
Float_t GetStatH() const
Definition: TStyle.h:275
Int_t GetOptFit() const
Return the fit option.
Definition: TPaveStats.cxx:257
virtual void Paint(Option_t *option="")
Paint this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:99
Double_t GetX() const
Definition: TText.h:68
virtual void SetBorderSize(Int_t bordersize=4)
Definition: TPave.h:82
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
const char * GetStatFormat() const
Definition: TStyle.h:271
virtual void SaveLines(std::ostream &out, const char *name)
Save lines of this pavetext as C++ statements on output stream out.
Definition: TPaveText.cxx:658
void SetOptStat(Int_t stat=1)
Set the stat option.
Definition: TPaveStats.cxx:303
virtual void SetY1NDC(Double_t y1)
Definition: TPave.h:89