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