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