Logo ROOT  
Reference Guide
TStyle.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun 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#include <string.h>
13#include <stdio.h>
14#include <ctype.h>
15#include <cmath>
16
17#include "Riostream.h"
18#include "TApplication.h"
19#include "TColor.h"
20#include "TROOT.h"
21#include "TStyle.h"
22#include "TSystem.h"
23#include "TVirtualPad.h"
24#include "TVirtualMutex.h"
25#include "TEnv.h"
26
28const UInt_t kTakeStyle = BIT(17);
29
31
32/** \class TStyle
33\ingroup Base
34 \ingroup GraphicsAtt
35
36TStyle objects may be created to define special styles.
37By default ROOT creates a default style that can be accessed via
38the gStyle pointer.
39
40This class includes functions to set some of the following object attributes.
41 - Canvas
42 - Pad
43 - Histogram axis
44 - Lines
45 - Fill areas
46 - Text
47 - Markers
48 - Functions
49 - Histogram Statistics and Titles
50
51All objects that can be drawn in a pad inherit from one or more attribute classes
52like TAttLine, TAttFill, TAttText, TAttMarker. When the objects are created, their
53default attributes are taken from the current style. The current style is an object
54of the class[TStyle](https://root.cern.ch/doc/master/classTStyle.html) and can be
55referenced via the global variable `gStyle` (in TStyle.h).
56
57ROOT provides two styles called "Default" and "Plain". The "Default"
58style is created simply by:
59
60~~~ .cpp
61auto default = new TStyle("Default","Default Style");
62~~~
63
64The "**Plain**" style can be used if you are working on a monochrome display or
65if you want to get a "conventional" Postscript output. These are the instructions
66in the ROOT constructor to create the "Plain*" style.
67
68```
69auto plain = new TStyle("Plain","Plain Style (no colors/fill areas)");
70
71 plain->SetCanvasBorderMode(0);
72 plain->SetPadBorderMode(0);
73 plain->SetPadColor(0);
74 plain->SetCanvasColor(0);
75 plain->SetTitleColor(0);
76 plain->SetStatColor(0);
77```
78
79You can set the current style with:
80
81```
82gROOT->SetStyle(style_name);
83```
84
85You can get a pointer to an existing style with:
86
87```
88auto style = gROOT->GetStyle(style_name);
89```
90
91You can create additional styles with:
92
93```
94 TStyle *st1 = new TStyle("st1","my style");
95 st1->Set....
96 st1->cd(); this becomes now the current style gStyle
97```
98
99In your [rootlogon.C](https://root.cern.ch/doc/master/classexamples/startsession.log.html)
100file, you can redefine the default parameters via statements like:
101
102```
103 gStyle->SetStatX(0.7);
104 gStyle->SetStatW(0.2);
105 gStyle->SetLabelOffset(1.2);
106 gStyle->SetLabelFont(72);
107```
108
109Note that when an object is created, its attributes are taken from the current
110style. For example, you may have created an histogram in a previous session,
111saved it in a file. Meanwhile, if you have changed the style, the histogram will
112be drawn with the old attributes. You can force the current style attributes to
113be set when you read an object from a file by calling:
114
115```
116gROOT->ForceStyle();
117```
118
119before reading the objects from the file.
120
121Let's assume you have a canvas or pad with your histogram or any other object,
122you can force these objects to get the attributes of the current style via:
123
124```
125canvas->UseCurrentStyle();
126```
127
128The description of the style functions should be clear from the name of the
129TStyle Setters or Getters. Some functions have an extended description, in particular:
130
131 - TStyle:SetLabelFont.
132 - TStyle:SetLineStyleString, to set the format of dashed lines.
133 - TStyle:SetOptStat.
134 - TStyle:SetPalette to change the colors palette.
135 - TStyle:SetTitleOffset.
136
137*/
138
139////////////////////////////////////////////////////////////////////////////////
140/// Default constructor.
141
143{
144 Reset();
145}
146
147////////////////////////////////////////////////////////////////////////////////
148/// Create a new TStyle.
149/// The following names are reserved to create special styles
150/// - `Classic`: the default style set in TStyle::Reset
151/// - `Plain`: a black&white oriented style
152/// - `Bold`
153/// - `Video`
154/// - `Pub`
155/// - `Modern`
156/// - `ATLAS`: style used by the ATLAS experiment
157/// (see the definition of these styles below).
158///
159/// Note a side-effect of calling gStyle->SetFillColor(0). This is nearly
160/// equivalent of selecting the "Plain" style.
161///
162/// Many graphics attributes may be set via the TStyle, see in particular
163/// - TStyle::SetNdivisions
164/// - TStyle::SetAxisColor
165/// - TStyle::SetHeaderPS
166/// - TStyle::SetTitlePS
167/// - TStyle::SetLabelColor
168/// - TStyle::SetLabelFont
169/// - TStyle::SetLabelOffset
170/// - TStyle::SetLabelSize
171/// - TStyle::SetOptDate
172/// - TStyle::SetLineStyleString
173/// - TStyle::SetOptFit
174/// - TStyle::SetOptStat
175/// - TStyle::SetPaperSize
176/// - TStyle::SetTickLength
177/// - TStyle::SetTitleOffset
178/// - TStyle::SetTitleSize
179/// - TStyle::SetPalette
180/// - TStyle::SetTimeOffset
181/// - TStyle::SetStripDecimals
182///
183/// The current style is pointed by gStyle.
184///
185/// When calling myStyle->cd(), gStyle is set to myStyle.
186///
187/// One can also use gROOT to change the current style, e.g.
188///
189/// gROOT->SetStyle("Plain") will change the current style gStyle to the
190/// "Plain" style
191///
192/// See also TROOT::ForceStyle and TROOT::UseCurrentStyle
193
194TStyle::TStyle(const char *name, const char *title)
195{
196 TString style_name = name;
197
198 SetNameTitle(style_name, title);
199
200 // If another style was already created with the same name, it is overwrite.
201 delete gROOT->GetStyle(style_name);
202
203 Reset();
204
205 {
207 gROOT->GetListOfStyles()->Add(this);
208 }
209
210 if (strcmp(style_name,"Modern") == 0) {
211 // Modern style
217 SetPadColor(0);
218 SetStatColor(0);
219 SetTitleFont(42,"");
220 SetLabelFont(42,"x");
221 SetTitleFont(42,"x");
222 SetLabelFont(42,"y");
223 SetTitleFont(42,"y");
224 SetLabelFont(42,"z");
225 SetTitleFont(42,"z");
226 SetStatFont(42);
227 SetLabelSize(0.035,"x");
228 SetTitleSize(0.035,"x");
229 SetLabelSize(0.035,"y");
230 SetTitleSize(0.035,"y");
231 SetLabelSize(0.035,"z");
232 SetTitleSize(0.035,"z");
233 SetTitleSize(0.050,"");
234 SetTitleAlign(23);
235 SetTitleX(0.5);
238 SetTitleStyle(0);
239 SetTitleOffset(0.,"Y");
241 SetOptStat(1111);
242 SetStatY(0.935);
246 SetLegendFont(42);
248 SetFuncWidth(2);
249 SetFuncColor(2);
250 }
251 if (strcmp(style_name,"Plain") == 0) {
252 // May be a standard style to be initialised
257 SetPadColor(0);
261 SetStatColor(0);
264 return;
265 }
266 if (strcmp(style_name,"Bold") == 0) {
267 // Authors: Art Poskanzer and Jim Thomas, LBNL, Oct. 2000
268 SetPalette(1,0);
269 SetCanvasColor(10);
273 SetPadColor(10);
274 SetPadTickX(1);
275 SetPadTickY(1);
276 SetPadBottomMargin(0.15);
277 SetPadLeftMargin(0.15);
280 SetFuncWidth(3);
282 SetLineWidth(3);
283 SetLabelSize(0.05,"xyz");
284 SetLabelOffset(0.01,"y");
285 SetLabelColor(kBlue,"xy");
286 SetTitleSize(0.06,"xyz");
287 SetTitleOffset(1.3,"Y");
290 SetStatColor(10);
291 return;
292 }
293 if (strcmp(style_name,"Video") == 0) {
294 // Author: Art Poskanzer, LBNL, Oct. 1999
295 SetPalette(1,0);
296 SetCanvasColor(10);
300 SetPadColor(10);
301 SetPadTickX(1);
302 SetPadTickY(1);
304 SetPadLeftMargin(0.2);
307 SetLabelSize(0.06,"xyz");
308 SetLabelColor(kBlue,"xyz");
309 SetTitleSize(0.08,"xyz");
312 SetStatColor(10);
313 SetFuncWidth(8);
315 SetLineWidth(3);
316 return;
317 }
318 if (strcmp(style_name,"Pub") == 0) {
319 // Authors: Art Poskanzer and Jim Thomas, LBNL, Oct. 2000
320 SetOptTitle(0);
321 SetOptStat(0);
322 SetPalette(8,0);
323 SetCanvasColor(10);
327 SetPadColor(10);
328 SetPadTickX(1);
329 SetPadTickY(1);
330 SetPadBottomMargin(0.15);
331 SetPadLeftMargin(0.15);
334 SetFuncWidth(3);
336 SetLineWidth(3);
337 SetLabelSize(0.05,"xyz");
338 SetLabelOffset(0.01,"y");
339 SetLabelColor(kBlack,"xyz");
340 SetTitleSize(0.06,"xyz");
341 SetTitleOffset(1.3,"y");
344 return;
345 }
346 if (strcmp(style_name,"ATLAS") == 0) {
347 // Author: M.Sutton - Atlas Collaboration 2010
353 SetPadColor(0);
354 SetStatColor(0);
355 SetPaperSize(20,26);
356 SetPadTopMargin(0.05);
357 SetPadRightMargin(0.05);
358 SetPadBottomMargin(0.16);
359 SetPadLeftMargin(0.16);
360 SetTitleXOffset(1.4);
361 SetTitleYOffset(1.4);
362 Int_t font = 42;
363 Double_t tsize=0.05;
364 SetTextFont(font);
365 SetTextSize(tsize);
366 SetLabelFont(font,"x");
367 SetTitleFont(font,"x");
368 SetLabelFont(font,"y");
369 SetTitleFont(font,"y");
370 SetLabelFont(font,"z");
371 SetTitleFont(font,"z");
372 SetLabelSize(tsize,"x");
373 SetTitleSize(tsize,"x");
374 SetLabelSize(tsize,"y");
375 SetTitleSize(tsize,"y");
376 SetLabelSize(tsize,"z");
377 SetTitleSize(tsize,"z");
378 SetMarkerStyle(20);
379 SetMarkerSize(1.2);
381 SetLineStyleString(2,"[12 12]");
382 SetErrorX(0.0001); // get rid of X error bars (as recommended in ATLAS figure guidelines)
383 SetEndErrorSize(0.); // get rid of error bar caps
384 SetOptTitle(0);
385 SetOptStat(0);
386 SetOptFit(0);
387 SetPadTickX(1);
388 SetPadTickY(1);
389 }
390}
391
392////////////////////////////////////////////////////////////////////////////////
393/// Destructor.
394
396{
398 gROOT->GetListOfStyles()->Remove(this);
399 if (gStyle == this) gStyle = (TStyle*)gROOT->GetListOfStyles()->Last();
400}
401
402////////////////////////////////////////////////////////////////////////////////
403/// Copy constructor and assignment operator.
404
406{
407 style.Copy(*this);
408}
409
411{
412 style.Copy(*this);
413 return *this;
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Browse the style object.
418
420{
421 cd();
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// Create some standard styles.
426
428{
429 TColor *col = new TColor(); // force the initialisation of fgPalette
430 new TStyle("Plain", "Plain Style (no colors/fill areas)");
431 new TStyle("Bold", "Bold Style");;
432 new TStyle("Video", "Style for video presentation histograms");
433 new TStyle("Pub", "Style for Publications");
434 new TStyle("Classic","Classic Style");
435 new TStyle("Default","Equivalent to Classic");
436 new TStyle("Modern", "Modern Style");
437 new TStyle("ATLAS", "ATLAS Style");
438 delete col;
439}
440
441////////////////////////////////////////////////////////////////////////////////
442/// Change current style.
443
445{
446 gStyle = this;
447}
448
449////////////////////////////////////////////////////////////////////////////////
450/// Copy this style.
451
452void TStyle::Copy(TObject &obj) const
453{
454 TAttLine::Copy(((TStyle&)obj));
455 TAttFill::Copy(((TStyle&)obj));
456 TAttMarker::Copy(((TStyle&)obj));
457 TAttText::Copy(((TStyle&)obj));
458 fXaxis.Copy(((TStyle&)obj).fXaxis);
459 fYaxis.Copy(((TStyle&)obj).fYaxis);
460 fZaxis.Copy(((TStyle&)obj).fZaxis);
461 fAttDate.Copy(((TStyle&)obj).fAttDate);
462 ((TStyle&)obj).fIsReading = fIsReading;
463 ((TStyle&)obj).fScreenFactor = fScreenFactor;
464 ((TStyle&)obj).fCanvasPreferGL = fCanvasPreferGL;
465 ((TStyle&)obj).fCanvasColor = fCanvasColor;
466 ((TStyle&)obj).fCanvasBorderSize = fCanvasBorderSize;
467 ((TStyle&)obj).fCanvasBorderMode = fCanvasBorderMode;
468 ((TStyle&)obj).fCanvasDefH = fCanvasDefH;
469 ((TStyle&)obj).fCanvasDefW = fCanvasDefW;
470 ((TStyle&)obj).fCanvasDefX = fCanvasDefX;
471 ((TStyle&)obj).fCanvasDefY = fCanvasDefY;
472 ((TStyle&)obj).fPadColor = fPadColor;
473 ((TStyle&)obj).fPadBorderSize = fPadBorderSize;
474 ((TStyle&)obj).fPadBorderMode = fPadBorderMode;
475 ((TStyle&)obj).fPadBottomMargin = fPadBottomMargin;
476 ((TStyle&)obj).fPadTopMargin = fPadTopMargin;
477 ((TStyle&)obj).fPadLeftMargin = fPadLeftMargin;
478 ((TStyle&)obj).fPadRightMargin = fPadRightMargin;
479 ((TStyle&)obj).fPadGridX = fPadGridX;
480 ((TStyle&)obj).fPadGridY = fPadGridY;
481 ((TStyle&)obj).fPadTickX = fPadTickX;
482 ((TStyle&)obj).fPadTickY = fPadTickY;
483 ((TStyle&)obj).fPaperSizeX = fPaperSizeX;
484 ((TStyle&)obj).fPaperSizeY = fPaperSizeY;
485 ((TStyle&)obj).fFuncColor = fFuncColor;
486 ((TStyle&)obj).fFuncStyle = fFuncStyle;
487 ((TStyle&)obj).fFuncWidth = fFuncWidth;
488 ((TStyle&)obj).fGridColor = fGridColor;
489 ((TStyle&)obj).fGridStyle = fGridStyle;
490 ((TStyle&)obj).fGridWidth = fGridWidth;
491 ((TStyle&)obj).fHatchesSpacing = fHatchesSpacing;
492 ((TStyle&)obj).fHatchesLineWidth = fHatchesLineWidth;
493 ((TStyle&)obj).fFrameFillColor = fFrameFillColor;
494 ((TStyle&)obj).fFrameFillStyle = fFrameFillStyle;
495 ((TStyle&)obj).fFrameLineColor = fFrameLineColor;
496 ((TStyle&)obj).fFrameLineStyle = fFrameLineStyle;
497 ((TStyle&)obj).fFrameLineWidth = fFrameLineWidth;
498 ((TStyle&)obj).fFrameBorderSize = fFrameBorderSize;
499 ((TStyle&)obj).fFrameBorderMode = fFrameBorderMode;
500 ((TStyle&)obj).fHistFillColor = fHistFillColor;
501 ((TStyle&)obj).fHistFillStyle = fHistFillStyle;
502 ((TStyle&)obj).fHistLineColor = fHistLineColor;
503 ((TStyle&)obj).fHistLineStyle = fHistLineStyle;
504 ((TStyle&)obj).fHistLineWidth = fHistLineWidth;
505 ((TStyle&)obj).fHistMinimumZero = fHistMinimumZero;
506 ((TStyle&)obj).fHistTopMargin = fHistTopMargin;
507 ((TStyle&)obj).fBarWidth = fBarWidth;
508 ((TStyle&)obj).fBarOffset = fBarOffset;
509 ((TStyle&)obj).fDrawBorder = fDrawBorder;
510 ((TStyle&)obj).fOptLogx = fOptLogx;
511 ((TStyle&)obj).fOptLogy = fOptLogy;
512 ((TStyle&)obj).fOptLogz = fOptLogz;
513 ((TStyle&)obj).fOptDate = fOptDate;
514 ((TStyle&)obj).fOptFit = fOptFit;
515 ((TStyle&)obj).fOptStat = fOptStat;
516 ((TStyle&)obj).fOptTitle = fOptTitle;
517 ((TStyle&)obj).fEndErrorSize = fEndErrorSize;
518 ((TStyle&)obj).fErrorX = fErrorX;
519 ((TStyle&)obj).fStatColor = fStatColor;
520 ((TStyle&)obj).fStatTextColor = fStatTextColor;
521 ((TStyle&)obj).fStatBorderSize = fStatBorderSize;
522 ((TStyle&)obj).fStatFont = fStatFont;
523 ((TStyle&)obj).fStatFontSize = fStatFontSize;
524 ((TStyle&)obj).fStatStyle = fStatStyle;
525 ((TStyle&)obj).fStatFormat = fStatFormat;
526 ((TStyle&)obj).fStatW = fStatW;
527 ((TStyle&)obj).fStatH = fStatH ;
528 ((TStyle&)obj).fStatX = fStatX;
529 ((TStyle&)obj).fStatY = fStatY;
530 ((TStyle&)obj).fTitleAlign = fTitleAlign;
531 ((TStyle&)obj).fTitleColor = fTitleColor;
532 ((TStyle&)obj).fTitleTextColor = fTitleTextColor;
533 ((TStyle&)obj).fTitleFont = fTitleFont;
534 ((TStyle&)obj).fTitleFontSize = fTitleFontSize;
535 ((TStyle&)obj).fTitleStyle = fTitleStyle;
536 ((TStyle&)obj).fTitleBorderSize = fTitleBorderSize;
537 ((TStyle&)obj).fTitleW = fTitleW;
538 ((TStyle&)obj).fTitleH = fTitleH;
539 ((TStyle&)obj).fTitleX = fTitleX;
540 ((TStyle&)obj).fTitleY = fTitleY;
541 ((TStyle&)obj).fDateX = fDateX;
542 ((TStyle&)obj).fDateY = fDateY;
543 ((TStyle&)obj).fFitFormat = fFitFormat;
544 ((TStyle&)obj).fPaintTextFormat = fPaintTextFormat;
545 ((TStyle&)obj).fShowEventStatus = fShowEventStatus;
546 ((TStyle&)obj).fShowEditor = fShowEditor;
547 ((TStyle&)obj).fShowToolBar = fShowToolBar;
548 ((TStyle&)obj).fLegoInnerR = fLegoInnerR;
549 ((TStyle&)obj).fStripDecimals = fStripDecimals;
550 ((TStyle&)obj).fNumberContours = fNumberContours;
551 ((TStyle&)obj).fLegendBorderSize = fLegendBorderSize;
552 ((TStyle&)obj).fLegendFillColor = fLegendFillColor;
553 ((TStyle&)obj).fLegendFont = fLegendFont;
554 ((TStyle&)obj).fLegendTextSize = fLegendTextSize;
555
556 Int_t i;
557 for (i=0;i<30;i++) {
558 ((TStyle&)obj).fLineStyle[i] = fLineStyle[i];
559 }
560 ((TStyle&)obj).fHeaderPS = fHeaderPS;
561 ((TStyle&)obj).fTitlePS = fTitlePS;
562 ((TStyle&)obj).fLineScalePS = fLineScalePS;
563 ((TStyle&)obj).fJoinLinePS = fJoinLinePS;
564 ((TStyle&)obj).fColorModelPS = fColorModelPS;
565 ((TStyle&)obj).fTimeOffset = fTimeOffset;
566 ((TStyle&)obj).fImageScaling = fImageScaling;
567}
568
569////////////////////////////////////////////////////////////////////////////////
570/// Function used by the TStyle manager when drawing a canvas showing the
571/// current style.
572
574{
575 gPad->SetSelected(this);
576 return 0;
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Reset.
581
583{
589 SetFillStyle(1001);
590 SetFillColor(19);
591 fXaxis.ResetAttAxis("X");
592 fYaxis.ResetAttAxis("Y");
593 fZaxis.ResetAttAxis("Z");
594 if (gEnv) fCanvasPreferGL = gEnv->GetValue("OpenGL.CanvasPreferGL",0);
595 else fCanvasPreferGL = kFALSE;
596 fCanvasColor = 19;
599 fCanvasDefH = 500;
600 fCanvasDefW = 700;
601 fCanvasDefX = 10;
602 fCanvasDefY = 10;
606 fPadBottomMargin= 0.1;
607 fPadTopMargin = 0.1;
608 fPadLeftMargin = 0.1;
609 fPadRightMargin = 0.1;
612 fPadTickX = 0;
613 fPadTickY = 0;
614 fFuncColor = 1;
615 fFuncStyle = 1;
616 fFuncWidth = 3;
617 fGridColor = 0;
618 fGridStyle = 3;
619 fGridWidth = 1;
620 fHatchesSpacing = 1;
622 fHistLineColor = 1;
623 fHistFillColor = 0;
624 fHistFillStyle = 1001;
625 fHistLineStyle = 1;
626 fHistLineWidth = 1;
628 fHistTopMargin = 0.05;
629 fFrameLineColor = 1;
630 fFrameFillColor = 0;
631 fFrameFillStyle = 1001;
632 fFrameLineStyle = 1;
633 fFrameLineWidth = 1;
636 fBarWidth = 1;
637 fBarOffset = 0;
638 fDrawBorder = 0;
639 fOptLogx = 0;
640 fOptLogy = 0;
641 fOptLogz = 0;
642 fOptDate = 0;
643 fOptFile = 0;
644 fOptFit = 0;
645 fOptStat = 1;
646 fOptTitle = 1;
647 fEndErrorSize = 2;
648 fErrorX = 0.5;
649 fScreenFactor = 1;
651 fStatTextColor = 1;
652 fStatBorderSize = 2;
653 fStatFont = 62;
654 fStatFontSize = 0;
655 fStatStyle = 1001;
656 fStatW = 0.20;
657 fStatH = 0.16;
658 fStatX = 0.98;
659 fStatY = 0.995;
661 SetFitFormat();
663 fTitleAlign = 13;
665 fTitleTextColor = 1;
666 fTitleFont = 62;
667 fTitleFontSize = 0;
668 fTitleStyle = 1001;
670 fTitleW = 0;
671 fTitleH = 0;
672 fTitleX = 0.01;
673 fTitleY = 0.995;
675 fShowEditor = 0;
676 fShowToolBar = 0;
677 fLegoInnerR = 0.5;
678 fHeaderPS = "";
679 fTitlePS = "";
681 fNumberContours = 20;
683 fLegendFont = 62;
684 fLegendTextSize = 0.,
686 fImageScaling = 1.;
687
688 SetDateX();
689 SetDateY();
690 fAttDate.SetTextSize(0.025);
695 SetLineStyleString(1," ");
696 SetLineStyleString(2,"12 12");
697 SetLineStyleString(3,"4 8");
698 SetLineStyleString(4,"12 16 4 16");
699 SetLineStyleString(5,"20 12 4 12");
700 SetLineStyleString(6,"20 12 4 12 4 12 4 12");
701 SetLineStyleString(7,"20 20");
702 SetLineStyleString(8,"20 12 4 12 4 12");
703 SetLineStyleString(9,"80 20");
704 SetLineStyleString(10,"80 40 4 40");
705 for (Int_t i=11;i<30;i++) SetLineStyleString(i," ");
706
707 SetPaperSize();
708
709 SetPalette();
710
711 fTimeOffset = 788918400; // UTC time at 01/01/95
712
713 TString style_name = opt;
714
715 if (strcmp(style_name,"Modern") == 0) {
716 // Modern style
722 SetPadColor(0);
723 SetStatColor(0);
724 SetTitleFont(42,"");
725 SetLabelFont(42,"x");
726 SetTitleFont(42,"x");
727 SetLabelFont(42,"y");
728 SetTitleFont(42,"y");
729 SetLabelFont(42,"z");
730 SetTitleFont(42,"z");
731 SetStatFont(42);
732 SetLabelSize(0.035,"x");
733 SetTitleSize(0.035,"x");
734 SetLabelSize(0.035,"y");
735 SetTitleSize(0.035,"y");
736 SetLabelSize(0.035,"z");
737 SetTitleSize(0.035,"z");
738 SetTitleSize(0.050,"");
739 SetTitleAlign(23);
740 SetTitleX(0.5);
743 SetTitleStyle(0);
744 SetTitleOffset(0.,"Y");
746 SetOptStat(1111);
747 SetStatY(0.935);
751 SetLegendFont(42);
753 SetFuncWidth(2);
754 SetFuncColor(2);
755 }
756 if (strcmp(style_name,"Plain") == 0) {
760 SetPadColor(0);
764 SetStatColor(0);
767 return;
768 }
769 if (strcmp(style_name,"Bold") == 0) {
770 SetPalette(1,0);
771 SetCanvasColor(10);
775 SetPadColor(10);
776 SetPadTickX(1);
777 SetPadTickY(1);
778 SetPadBottomMargin(0.15);
779 SetPadLeftMargin(0.15);
782 SetFuncWidth(3);
784 SetLineWidth(3);
785 SetLabelSize(0.05,"xyz");
786 SetLabelOffset(0.01,"y");
787 SetLabelColor(kBlue,"xy");
788 SetTitleSize(0.06,"xyz");
789 SetTitleOffset(1.3,"Y");
792 SetStatColor(10);
793 return;
794 }
795 if (strcmp(style_name,"Video") == 0) {
796 SetPalette(1,0);
797 SetCanvasColor(10);
801 SetPadColor(10);
802 SetPadTickX(1);
803 SetPadTickY(1);
805 SetPadLeftMargin(0.2);
808 SetLabelSize(0.06,"xyz");
809 SetLabelColor(kBlue,"xyz");
810 SetTitleSize(0.08,"xyz");
813 SetStatColor(10);
814 SetFuncWidth(8);
816 SetLineWidth(3);
817 return;
818 }
819 if (strcmp(style_name,"Pub") == 0) {
820 SetOptTitle(0);
821 SetOptStat(0);
822 SetPalette(8,0);
823 SetCanvasColor(10);
827 SetPadColor(10);
828 SetPadTickX(1);
829 SetPadTickY(1);
830 SetPadBottomMargin(0.15);
831 SetPadLeftMargin(0.15);
834 SetFuncWidth(3);
836 SetLineWidth(3);
837 SetLabelSize(0.05,"xyz");
838 SetLabelOffset(0.01,"y");
839 SetLabelColor(kBlack,"xyz");
840 SetTitleSize(0.06,"xyz");
841 SetTitleOffset(1.3,"y");
844 return;
845 }
846 if (strcmp(style_name,"ATLAS") == 0) {
852 SetPadColor(0);
853 SetStatColor(0);
854 SetPaperSize(20,26);
855 SetPadTopMargin(0.05);
856 SetPadRightMargin(0.05);
857 SetPadBottomMargin(0.16);
858 SetPadLeftMargin(0.16);
859 SetTitleXOffset(1.4);
860 SetTitleYOffset(1.4);
861 Int_t font = 42;
862 Double_t tsize=0.05;
863 SetTextFont(font);
864 SetTextSize(tsize);
865 SetLabelFont(font,"x");
866 SetTitleFont(font,"x");
867 SetLabelFont(font,"y");
868 SetTitleFont(font,"y");
869 SetLabelFont(font,"z");
870 SetTitleFont(font,"z");
871 SetLabelSize(tsize,"x");
872 SetTitleSize(tsize,"x");
873 SetLabelSize(tsize,"y");
874 SetTitleSize(tsize,"y");
875 SetLabelSize(tsize,"z");
876 SetTitleSize(tsize,"z");
877 SetMarkerStyle(20);
878 SetMarkerSize(1.2);
880 SetLineStyleString(2,"[12 12]");
881 SetErrorX(0.0001);
882 SetEndErrorSize(0.);
883 SetOptTitle(0);
884 SetOptStat(0);
885 SetOptFit(0);
886 SetPadTickX(1);
887 SetPadTickY(1);
888 return;
889 }
890}
891
892////////////////////////////////////////////////////////////////////////////////
893/// Return number of divisions.
894
896{
897 Int_t ax = AxisChoice(axis);
898 if (ax == 1) return fXaxis.GetNdivisions();
899 if (ax == 2) return fYaxis.GetNdivisions();
900 if (ax == 3) return fZaxis.GetNdivisions();
901 return 0;
902}
903
904////////////////////////////////////////////////////////////////////////////////
905/// Return the axis color number in the axis.
906
908{
909 Int_t ax = AxisChoice(axis);
910 if (ax == 1) return fXaxis.GetAxisColor();
911 if (ax == 2) return fYaxis.GetAxisColor();
912 if (ax == 3) return fZaxis.GetAxisColor();
913 return 0;
914}
915
916////////////////////////////////////////////////////////////////////////////////
917/// Return color number i in current palette.
918
920{
921 return TColor::GetColorPalette(i);
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// Return the label color number in the axis.
926
928{
929 Int_t ax = AxisChoice(axis);
930 if (ax == 1) return fXaxis.GetLabelColor();
931 if (ax == 2) return fYaxis.GetLabelColor();
932 if (ax == 3) return fZaxis.GetLabelColor();
933 return 0;
934}
935
936////////////////////////////////////////////////////////////////////////////////
937/// Return label font.
938
940{
941 Int_t ax = AxisChoice(axis);
942 if (ax == 1) return fXaxis.GetLabelFont();
943 if (ax == 2) return fYaxis.GetLabelFont();
944 if (ax == 3) return fZaxis.GetLabelFont();
945 return 0;
946}
947
948////////////////////////////////////////////////////////////////////////////////
949/// Return label offset.
950
952{
953 Int_t ax = AxisChoice(axis);
954 if (ax == 1) return fXaxis.GetLabelOffset();
955 if (ax == 2) return fYaxis.GetLabelOffset();
956 if (ax == 3) return fZaxis.GetLabelOffset();
957 return 0;
958}
959
960////////////////////////////////////////////////////////////////////////////////
961/// Return label size.
962
964{
965 Int_t ax = AxisChoice(axis);
966 if (ax == 1) return fXaxis.GetLabelSize();
967 if (ax == 2) return fYaxis.GetLabelSize();
968 if (ax == 3) return fZaxis.GetLabelSize();
969 return 0;
970}
971
972////////////////////////////////////////////////////////////////////////////////
973/// Return line style string (used by PostScript).
974/// See SetLineStyleString for more explanations
975
977{
978 if (i < 1 || i > 29) return fLineStyle[0].Data();
979 return fLineStyle[i].Data();
980}
981
982////////////////////////////////////////////////////////////////////////////////
983/// Return number of colors in the color palette.
984
986{
988}
989
990
991////////////////////////////////////////////////////////////////////////////////
992/// Set paper size for PostScript output.
993
994void TStyle::GetPaperSize(Float_t &xsize, Float_t &ysize) const
995{
996 xsize = fPaperSizeX;
997 ysize = fPaperSizeY;
998}
999
1000////////////////////////////////////////////////////////////////////////////////
1001/// Return tick length.
1002
1004{
1005 Int_t ax = AxisChoice(axis);
1006 if (ax == 1) return fXaxis.GetTickLength();
1007 if (ax == 2) return fYaxis.GetTickLength();
1008 if (ax == 3) return fZaxis.GetTickLength();
1009 return 0;
1010}
1011
1012////////////////////////////////////////////////////////////////////////////////
1013/// Return title color.
1014
1016{
1017 Int_t ax = AxisChoice(axis);
1018 if (ax == 1) return fXaxis.GetTitleColor();
1019 if (ax == 2) return fYaxis.GetTitleColor();
1020 if (ax == 3) return fZaxis.GetTitleColor();
1021 return fTitleTextColor;
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Return title font.
1026
1028{
1029 Int_t ax = AxisChoice(axis);
1030 if (ax == 1) return fXaxis.GetTitleFont();
1031 if (ax == 2) return fYaxis.GetTitleFont();
1032 if (ax == 3) return fZaxis.GetTitleFont();
1033 return fTitleFont;
1034}
1035
1036////////////////////////////////////////////////////////////////////////////////
1037/// Return title offset.
1038
1040{
1041 Int_t ax = AxisChoice(axis);
1042 if (ax == 1) return fXaxis.GetTitleOffset();
1043 if (ax == 2) return fYaxis.GetTitleOffset();
1044 if (ax == 3) return fZaxis.GetTitleOffset();
1045 return 0;
1046}
1047
1048////////////////////////////////////////////////////////////////////////////////
1049/// Return title size.
1050
1052{
1053 Int_t ax = AxisChoice(axis);
1054 if (ax == 1) return fXaxis.GetTitleSize();
1055 if (ax == 2) return fYaxis.GetTitleSize();
1056 if (ax == 3) return fZaxis.GetTitleSize();
1057 return fTitleFontSize;
1058}
1059
1060////////////////////////////////////////////////////////////////////////////////
1061/// Show the options from the current style
1062
1064{
1065 gROOT->ProcessLine(Form("TStyleManager::PaintStyle((TStyle*)0x%lx,\"%s\")",
1066 (ULong_t)this,option));
1067}
1068
1069////////////////////////////////////////////////////////////////////////////////
1070/// Define the color model used by TPostScript and TPDF (RGB or CMYK).
1071/// CMY and CMYK models are subtractive color models unlike RGB which is
1072/// additive. They are mainly used for printing purposes. CMY means Cyan Magenta
1073/// Yellow. To convert RGB to CMY it is enough to do: C=1-R, M=1-G and Y=1-B.
1074/// CMYK has one more component K (black). The conversion from RGB to CMYK is:
1075/// ~~~ {.cpp}
1076/// Double_t Black = TMath::Min(TMath::Min(1-Red,1-Green),1-Blue);
1077/// Double_t Cyan = (1-Red-Black)/(1-Black);
1078/// Double_t Magenta = (1-Green-Black)/(1-Black);
1079/// Double_t Yellow = (1-Blue-Black)/(1-Black);
1080/// ~~~
1081/// CMYK adds the black component which allows better quality for black
1082/// printing. PostScript and PDF support the CMYK model.
1083///
1084/// - c = 0 means TPostScript and TPDF will use RGB color model (default)
1085/// - c = 1 means TPostScript and TPDF will use CMYK color model
1086
1088{
1089 fColorModelPS = c;
1090}
1091
1092////////////////////////////////////////////////////////////////////////////////
1093/// If the argument zero=kTRUE the minimum value for the Y axis of 1-d histograms
1094/// is set to 0.
1095///
1096/// If the minimum bin content is greater than 0 and TH1::SetMinimum
1097/// has not been called.
1098/// Otherwise the minimum is based on the minimum bin content.
1099
1101{
1102 fHistMinimumZero = zero;
1103}
1104
1105////////////////////////////////////////////////////////////////////////////////
1106/// Set the number of divisions to draw an axis.
1107/// ndiv : Number of divisions.
1108/// ~~~ {.cpp}
1109/// n = N1 + 100*N2 + 10000*N3
1110/// N1=number of primary divisions.
1111/// N2=number of secondary divisions.
1112/// N3=number of 3rd divisions.
1113/// e.g.:
1114/// nndi=0 --> no tick marks.
1115/// nndi=2 --> 2 divisions, one tick mark in the middle
1116/// of the axis.
1117/// ~~~
1118/// axis specifies which axis ("x","y","z"), default = "x"
1119/// if axis="xyz" set all 3 axes
1120
1122{
1123 TString opt = axis;
1124 opt.ToLower();
1125 if (opt.Contains("x")) fXaxis.SetNdivisions(n);
1126 if (opt.Contains("y")) fYaxis.SetNdivisions(n);
1127 if (opt.Contains("z")) fZaxis.SetNdivisions(n);
1128}
1129
1130////////////////////////////////////////////////////////////////////////////////
1131/// Set color to draw the axis line and tick marks.
1132/// axis specifies which axis ("x","y","z"), default = "x"
1133/// if axis="xyz" set all 3 axes
1134
1136{
1137 TString opt = axis;
1138 opt.ToLower();
1139
1140 if (opt.Contains("x")) fXaxis.SetAxisColor(color);
1141 if (opt.Contains("y")) fYaxis.SetAxisColor(color);
1142 if (opt.Contains("z")) fZaxis.SetAxisColor(color);
1143}
1144
1145////////////////////////////////////////////////////////////////////////////////
1146/// Set the size (in pixels) of the small lines drawn at the
1147/// end of the error bars (TH1 or TGraphErrors).
1148///
1149/// The default value is 2 pixels.
1150/// Set np=0 to remove these lines
1151
1153{
1154 if (np >= 0) fEndErrorSize = np;
1155 else fEndErrorSize = 0;
1156}
1157
1158////////////////////////////////////////////////////////////////////////////////
1159/// Define a string to be inserted in the Postscript header.
1160///
1161/// The string in header will be added to the Postscript file
1162/// immediately following the %%Page line
1163/// For example, this string may contain special Postscript instructions like
1164/// ~~~ {.cpp}
1165/// 200 200 translate
1166/// ~~~
1167/// the following header string will print the string "my annotation" at the
1168/// bottom left corner of the page (outside the user area)
1169/// ~~~ {.cpp}
1170/// "gsave 100 -100 t 0 r 0 0 m /Helvetica-Bold findfont 56 sf 0 0 m ( my annotation ) show gr"
1171/// ~~~
1172/// This information is used in TPostScript::Initialize
1173
1174void TStyle::SetHeaderPS(const char *header)
1175{
1176 fHeaderPS = header;
1177}
1178
1179////////////////////////////////////////////////////////////////////////////////
1180/// Sets the `fIsReading` member to reading (default=kTRUE).
1181///
1182/// `fIsReading` (used via `gStyle->IsReading()`) can be used in
1183/// the functions `myclass::UseCurrentStyle` to read from the current style
1184/// or write to the current style
1185
1187{
1188 fIsReading = reading;
1189}
1190
1191////////////////////////////////////////////////////////////////////////////////
1192/// Define a string to be used in the %%Title of the Postscript files.
1193/// If this string is not defined, ROOT will use the canvas title.
1194
1195void TStyle::SetTitlePS(const char *pstitle)
1196{
1197 fTitlePS = pstitle;
1198}
1199
1200////////////////////////////////////////////////////////////////////////////////
1201/// Set axis labels color.
1202/// axis specifies which axis ("x","y","z"), default = "x"
1203/// if axis="xyz" set all 3 axes
1204
1206{
1207 TString opt = axis;
1208 opt.ToLower();
1209
1210 if (opt.Contains("x")) fXaxis.SetLabelColor(color);
1211 if (opt.Contains("y")) fYaxis.SetLabelColor(color);
1212 if (opt.Contains("z")) fZaxis.SetLabelColor(color);
1213}
1214
1215////////////////////////////////////////////////////////////////////////////////
1216/// Set font number used to draw axis labels.
1217/// - font : Text font code = 10*fontnumber + precision
1218/// - Font numbers must be between 1 and 14
1219/// - precision = 1 fast hardware fonts (steps in the size)
1220/// - precision = 2 scalable and rotatable hardware fonts
1221/// The default font number is 62.
1222/// axis specifies which axis ("x","y","z"), default = "x"
1223/// if axis="xyz" set all 3 axes
1224
1226{
1227 TString opt = axis;
1228 opt.ToLower();
1229
1230 if (opt.Contains("x")) fXaxis.SetLabelFont(font);
1231 if (opt.Contains("y")) fYaxis.SetLabelFont(font);
1232 if (opt.Contains("z")) fZaxis.SetLabelFont(font);
1233}
1234
1235////////////////////////////////////////////////////////////////////////////////
1236/// Set offset between axis and axis labels.
1237/// The offset is expressed as a percent of the pad height.
1238/// axis specifies which axis ("x","y","z"), default = "x"
1239/// if axis="xyz" set all 3 axes
1240
1242{
1243 TString opt = axis;
1244 opt.ToLower();
1245
1246 if (opt.Contains("x")) fXaxis.SetLabelOffset(offset);
1247 if (opt.Contains("y")) fYaxis.SetLabelOffset(offset);
1248 if (opt.Contains("z")) fZaxis.SetLabelOffset(offset);
1249}
1250
1251////////////////////////////////////////////////////////////////////////////////
1252/// Set size of axis labels. The size is expressed as a percent of the pad height.
1253/// axis specifies which axis ("x","y","z"), default = "x"
1254/// if axis="xyz" set all 3 axes
1255
1257{
1258 TString opt = axis;
1259 opt.ToLower();
1260
1261 if (opt.Contains("x")) fXaxis.SetLabelSize(size);
1262 if (opt.Contains("y")) fYaxis.SetLabelSize(size);
1263 if (opt.Contains("z")) fZaxis.SetLabelSize(size);
1264}
1265
1266////////////////////////////////////////////////////////////////////////////////
1267/// Set line style string using the PostScript convention.
1268/// A line is a suite of segments, each segment is described by the number of
1269/// pixels. The initial and alternating elements (second, fourth, and so on)
1270/// are the dashes, and the others spaces between dashes.
1271///
1272/// Default fixed line styles are pre-defined as:
1273/// ~~~ {.cpp}
1274/// linestyle 1 "[]" solid
1275/// linestyle 2 "[12 12]" dashed
1276/// linestyle 3 "[4 8]" dotted
1277/// linestyle 4 "[12 16 4 16]" dash-dotted
1278/// ~~~
1279/// For example the following lines define the line style 5 to 9.
1280/// ~~~ {.cpp}
1281/// gStyle->SetLineStyleString(5,"20 12 4 12");
1282/// gStyle->SetLineStyleString(6,"20 12 4 12 4 12 4 12");
1283/// gStyle->SetLineStyleString(7,"20 20");
1284/// gStyle->SetLineStyleString(8,"20 12 4 12 4 12");
1285/// gStyle->SetLineStyleString(9,"80 20");
1286/// ~~~
1287/// \image html base_linestyle.png
1288/// Note:
1289/// - Up to 30 different styles may be defined.
1290/// - The opening and closing brackets may be omitted
1291/// - It is recommended to use 4 as the smallest segment length and multiple of
1292/// 4 for other lengths.
1293/// - The line style 1 to 10 are predefined. 1 to 4 cannot be changed.
1294
1296{
1297
1298 char *l;
1299 Int_t nch = strlen(text);
1300 char *st = new char[nch+10];
1301 snprintf(st,nch+10," ");
1302 strlcat(st,text,nch+10);
1303 l = strstr(st,"["); if (l) l[0] = ' ';
1304 l = strstr(st,"]"); if (l) l[0] = ' ';
1305 if (i >= 1 && i <= 29) fLineStyle[i] = st;
1306 delete [] st;
1307}
1308
1309////////////////////////////////////////////////////////////////////////////////
1310/// Set the default number of contour levels when drawing 2-d plots.
1311
1313{
1314 if (number > 0 && number < 1000) {
1315 fNumberContours = number;
1316 return;
1317 }
1318
1319 Error("SetNumberContours","Illegal number of contours: %d, must be > 0 and < 1000",number);
1320}
1321
1322////////////////////////////////////////////////////////////////////////////////
1323/// If optdate is non null, the current date/time will be printed in the canvas.
1324/// The position of the date string can be controlled by:
1325/// optdate = 10*format + mode
1326/// - mode = 1 (default) date is printed in the bottom/left corner.
1327/// - mode = 2 date is printed in the bottom/right corner.
1328/// - mode = 3 date is printed in the top/right corner.
1329/// - format = 0 (default) date has the format like: "Wed Sep 25 17:10:35 2002"
1330/// - format = 1 date has the format like: "2002-09-25"
1331/// - format = 2 date has the format like: "2002-09-25 17:10:35"
1332///
1333/// examples:
1334/// - optdate = 1 date like "Wed Sep 25 17:10:35 2002" in the bottom/left corner.
1335/// - optdate = 13 date like "2002-09-25" in the top/right corner.
1336///
1337/// The date position can also be controlled by:
1338/// gStyle->SetDateX(x); x in NDC
1339/// gStyle->SetDateY(y); y in NDC
1340///
1341/// The date text attributes can be changed with:
1342/// ~~~ {.cpp}
1343/// gStyle->GetAttDate()->SetTextFont(font=62);
1344/// gStyle->GetAttDate()->SetTextSize(size=0.025);
1345/// gStyle->GetAttDate()->SetTextAngle(angle=0);
1346/// gStyle->GetAttDate()->SetTextAlign(align=11);
1347/// gStyle->GetAttDate()->SetTextColor(color=1);
1348/// ~~~
1349/// The current date attributes can be obtained via:
1350/// ~~~ {.cpp}
1351/// gStyle->GetAttDate()->GetTextxxxx();
1352/// ~~~
1353/// When the date option is active, a text object is created when the pad
1354/// paint its list of primitives. The text object is named "DATE".
1355/// The DATE attributes can also be edited interactively (position
1356/// and attributes) via the normal context menu.
1357
1359{
1360 fOptDate = optdate;
1361 Int_t mode = optdate%10;
1362 if (mode == 1) {
1363 SetDateX(0.01);
1364 SetDateY(0.01);
1366 }
1367 if (mode == 2) {
1368 SetDateX(0.99);
1369 SetDateY(0.01);
1371 }
1372 if (mode == 3) {
1373 SetDateX(0.99);
1374 SetDateY(0.99);
1376 }
1377}
1378
1379////////////////////////////////////////////////////////////////////////////////
1380/// The type of information about fit parameters printed in the histogram
1381/// statistics box can be selected via the parameter `mode`.
1382/// The parameter mode can be = `pcev`:
1383/// - p = 1; print Probability
1384/// - c = 1; print Chisquare/Number of degrees of freedom
1385/// - e = 1; print errors (if e=1, v must be 1)
1386/// - v = 1; print name/values of parameters
1387/// Example: `gStyle->SetOptFit(1011);`
1388/// print fit probability, parameter names/values and errors.
1389/// - When "v"=1 is specified, only the non-fixed parameters are shown.
1390/// - When "v"=2 all parameters are shown.
1391///
1392/// #### Notes:
1393/// - `gStyle->SetOptFit(1)` is a shortcut allowing to set the most common
1394/// case and is equivalent to `gStyle->SetOptFit(111)`
1395/// - At ROOT startup the option fit is set to `0`. So, to see the fit parameters
1396/// on all plot resulting from a fit, a call to `gStyle->SetOptFit()` with a
1397/// non null value should be done. One can put it in the `rootlogon.C` file to
1398/// always have it.
1399///
1400/// see also SetOptStat below.
1401
1403{
1404 fOptFit = mode;
1405 if (gPad) {
1406 TObject *obj;
1407 TIter next(gPad->GetListOfPrimitives());
1408 while ((obj = next())) {
1409 TObject *stats = obj->FindObject("stats");
1410 if (stats) stats->SetBit(kTakeStyle);
1411 }
1412 gPad->Modified(); gPad->Update();
1413 }
1414}
1415
1416////////////////////////////////////////////////////////////////////////////////
1417/// The type of information printed in the histogram statistics box
1418/// can be selected via the parameter mode.
1419/// The parameter mode can be = `ksiourmen`
1420/// - k = 1; kurtosis printed
1421/// - k = 2; kurtosis and kurtosis error printed
1422/// - s = 1; skewness printed
1423/// - s = 2; skewness and skewness error printed
1424/// - i = 1; integral of bins printed
1425/// - i = 2; integral of bins with option "width" printed
1426/// - o = 1; number of overflows printed
1427/// - u = 1; number of underflows printed
1428/// - r = 1; rms printed
1429/// - r = 2; rms and rms error printed
1430/// - m = 1; mean value printed
1431/// - m = 2; mean and mean error values printed
1432/// - e = 1; number of entries printed
1433/// - n = 1; name of histogram is printed
1434///
1435/// Example: `gStyle->SetOptStat(11);`
1436/// print only name of histogram and number of entries.
1437/// `gStyle->SetOptStat(1101);` displays the name of histogram, mean value and RMS.
1438///
1439/// #### Notes:
1440///
1441/// - never call `SetOptStat(000111);` but `SetOptStat(1111)`, 0001111 will
1442/// be taken as an octal number !!
1443/// - `SetOptStat(1)` is s shortcut allowing to set the most common case, and is
1444/// taken as `SetOptStat(1111)` (for backward compatibility with older versions.
1445/// If you want to print only the name of the histogram call `SetOptStat(1000000001)`.
1446/// - that in case of 2-D histograms, when selecting just underflow (10000)
1447/// or overflow (100000), the stats box will show all combinations
1448/// of underflow/overflows and not just one single number!
1449
1451{
1452 fOptStat = mode;
1453 if (gPad) {
1454 TObject *obj;
1455 TIter next(gPad->GetListOfPrimitives());
1456 while ((obj = next())) {
1457 TObject *stats = obj->FindObject("stats");
1458 if (stats) stats->SetBit(kTakeStyle);
1459 }
1460 gPad->Modified(); gPad->Update();
1461 }
1462}
1463
1464////////////////////////////////////////////////////////////////////////////////
1465/// The parameter mode can be any combination of kKsSiourRmMen
1466/// - k : kurtosis printed
1467/// - K : kurtosis and kurtosis error printed
1468/// - s : skewness printed
1469/// - S : skewness and skewness error printed
1470/// - i : integral of bins printed
1471/// - I : integral of bins with option "width" printed
1472/// - o : number of overflows printed
1473/// - u : number of underflows printed
1474/// - r : rms printed
1475/// - R : rms and rms error printed
1476/// - m : mean value printed
1477/// - M : mean value mean error values printed
1478/// - e : number of entries printed
1479/// - n : name of histogram is printed
1480///
1481/// Example: `gStyle->SetOptStat("ne");`
1482/// print only name of histogram and number of entries.
1483///
1484/// - `gStyle->SetOptStat("n")` print only the name of the histogram
1485/// - `gStyle->SetOptStat("nemr")` is the default
1486
1488{
1489 Int_t mode=0;
1490
1491 TString opt = stat;
1492
1493 if (opt.Contains("n")) mode+=1;
1494 if (opt.Contains("e")) mode+=10;
1495 if (opt.Contains("m")) mode+=100;
1496 if (opt.Contains("M")) mode+=200;
1497 if (opt.Contains("r")) mode+=1000;
1498 if (opt.Contains("R")) mode+=2000;
1499 if (opt.Contains("u")) mode+=10000;
1500 if (opt.Contains("o")) mode+=100000;
1501 if (opt.Contains("i")) mode+=1000000;
1502 if (opt.Contains("I")) mode+=2000000;
1503 if (opt.Contains("s")) mode+=10000000;
1504 if (opt.Contains("S")) mode+=20000000;
1505 if (opt.Contains("k")) mode+=100000000;
1506 if (opt.Contains("K")) mode+=200000000;
1507 if (mode == 1) mode = 1000000001;
1508
1509 SetOptStat(mode);
1510}
1511
1512////////////////////////////////////////////////////////////////////////////////
1513/// Set paper size for PostScript output.
1514
1516{
1517 switch (size) {
1518 case kA4:
1519 SetPaperSize(20, 26);
1520 break;
1521 case kUSLetter:
1522 SetPaperSize(20, 24);
1523 break;
1524 default:
1525 Error("SetPaperSize", "illegal paper size %d\n", (int)size);
1526 break;
1527 }
1528}
1529
1530////////////////////////////////////////////////////////////////////////////////
1531/// Set paper size for PostScript output.
1532/// The paper size is specified in centimeters. Default is 20x26.
1533/// See also TPad::Print
1534
1536{
1537 fPaperSizeX = xsize;
1538 fPaperSizeY = ysize;
1539}
1540
1541////////////////////////////////////////////////////////////////////////////////
1542/// Set the tick marks length for an axis.
1543/// axis specifies which axis ("x","y","z"), default = "x"
1544/// if axis="xyz" set all 3 axes
1545
1547{
1548 TString opt = axis;
1549 opt.ToLower();
1550
1551 if (opt.Contains("x")) fXaxis.SetTickLength(length);
1552 if (opt.Contains("y")) fYaxis.SetTickLength(length);
1553 if (opt.Contains("z")) fZaxis.SetTickLength(length);
1554}
1555
1556////////////////////////////////////////////////////////////////////////////////
1557/// - if axis =="x" set the X axis title color
1558/// - if axis =="y" set the Y axis title color
1559/// - if axis =="z" set the Z axis title color
1560///
1561/// any other value of axis will set the pad title color
1562///
1563/// if axis="xyz" set all 3 axes
1564
1566{
1567 TString opt = axis;
1568 opt.ToLower();
1569
1570 Bool_t set = kFALSE;
1571 if (opt.Contains("x")) {fXaxis.SetTitleColor(color); set = kTRUE;}
1572 if (opt.Contains("y")) {fYaxis.SetTitleColor(color); set = kTRUE;}
1573 if (opt.Contains("z")) {fZaxis.SetTitleColor(color); set = kTRUE;}
1574 if (!set) fTitleColor = color;
1575}
1576
1577////////////////////////////////////////////////////////////////////////////////
1578/// - if axis =="x" set the X axis title font
1579/// - if axis =="y" set the Y axis title font
1580/// - if axis =="z" set the Z axis title font
1581///
1582/// any other value of axis will set the pad title font
1583///
1584/// if axis="xyz" set all 3 axes
1585
1587{
1588 TString opt = axis;
1589 opt.ToLower();
1590
1591 Bool_t set = kFALSE;
1592 if (opt.Contains("x")) {fXaxis.SetTitleFont(font); set = kTRUE;}
1593 if (opt.Contains("y")) {fYaxis.SetTitleFont(font); set = kTRUE;}
1594 if (opt.Contains("z")) {fZaxis.SetTitleFont(font); set = kTRUE;}
1595 if (!set) fTitleFont = font;
1596}
1597
1598////////////////////////////////////////////////////////////////////////////////
1599/// Specify a parameter offset to control the distance between the axis
1600/// and the axis title.
1601///
1602/// - offset = 1 means : use the default distance
1603/// - offset = 1.2 means: the distance will be 1.2*(default distance)
1604/// - offset = 0.8 means: the distance will be 0.8*(default distance)
1605///
1606/// axis specifies which axis ("x","y","z"), default = "x"
1607/// if axis="xyz" set all 3 axes
1608
1610{
1611 TString opt = axis;
1612 opt.ToLower();
1613
1614 if (opt.Contains("x")) fXaxis.SetTitleOffset(offset);
1615 if (opt.Contains("y")) fYaxis.SetTitleOffset(offset);
1616 if (opt.Contains("z")) fZaxis.SetTitleOffset(offset);
1617}
1618
1619////////////////////////////////////////////////////////////////////////////////
1620/// - if axis =="x" set the X axis title size
1621/// - if axis =="y" set the Y axis title size
1622/// - if axis =="z" set the Z axis title size
1623///
1624/// any other value of axis will set the pad title size
1625///
1626/// if axis="xyz" set all 3 axes
1627
1629{
1630 TString opt = axis;
1631 opt.ToLower();
1632
1633 Bool_t set = kFALSE;
1634 if (opt.Contains("x")) {fXaxis.SetTitleSize(size); set = kTRUE;}
1635 if (opt.Contains("y")) {fYaxis.SetTitleSize(size); set = kTRUE;}
1636 if (opt.Contains("z")) {fZaxis.SetTitleSize(size); set = kTRUE;}
1637 if (!set) fTitleFontSize = size;
1638}
1639
1640////////////////////////////////////////////////////////////////////////////////
1641/// See TColor::SetPalette.
1642
1644{
1645 TColor::SetPalette(ncolors,colors,alpha);
1646}
1647
1648////////////////////////////////////////////////////////////////////////////////
1649/// Change the time offset for time plotting.
1650/// Times are expressed in seconds. The corresponding numbers usually have 9
1651/// digits (or more if one takes into account fractions of seconds).
1652/// Thus, since it is very inconvenient to plot very large numbers on a scale,
1653/// one has to set an offset time that will be added to the axis beginning,
1654/// in order to plot times correctly and conveniently. A convenient way to
1655/// set the time offset is to use TDatime::Convert().
1656///
1657/// By default the time offset is set to 788918400 which corresponds to
1658/// 01/01/1995. This allows to have valid dates until 2072. The standard
1659/// UNIX time offset in 1970 allows only valid dates until 2030.
1660
1662{
1663 fTimeOffset = toffset;
1664}
1665
1666////////////////////////////////////////////////////////////////////////////////
1667/// Set option to strip decimals when drawing axis labels.
1668/// By default, TGaxis::PaintAxis removes trailing 0s after a dot
1669/// in the axis labels. Ex: {0,0.5,1,1.5,2,2.5, etc}
1670/// If this function is called with strip=kFALSE, TGAxis::PaintAxis will
1671/// draw labels with the same number of digits after the dot
1672/// Ex: (0.0,0.5,1.0,1.5,2.0,2.5,etc}
1673
1675{
1676 fStripDecimals = strip;
1677}
1678
1679////////////////////////////////////////////////////////////////////////////////
1680/// Save the current style in a C++ macro file.
1681
1682void TStyle::SaveSource(const char *filename, Option_t *option)
1683{
1684 // Opens a file named filename or "Rootstyl.C"
1685 TString ff = strlen(filename) ? filename : "Rootstyl.C";
1686
1687 // Computes the main method name.
1688 const char *fname = gSystem->BaseName(ff);
1689 Int_t lenfname = strlen(fname);
1690 char *sname = new char[lenfname + 1];
1691 Int_t i = 0;
1692 while ((i < lenfname) && (fname[i] != '.')) {
1693 sname[i] = fname[i];
1694 i++;
1695 }
1696 if (i == lenfname) ff += ".C";
1697 sname[i] = 0;
1698
1699 // Tries to open the file.
1700 std::ofstream out;
1701 out.open(ff.Data(), std::ios::out);
1702 if (!out.good()) {
1703 delete [] sname;
1704 Error("SaveSource", "cannot open file: %s", ff.Data());
1705 return;
1706 }
1707
1708 // Writes macro header, date/time stamp as string, and the used Root version
1709 TDatime t;
1710 out <<"// Mainframe macro generated from application: " << gApplication->Argv(0) << std::endl;
1711 out <<"// By ROOT version " << gROOT->GetVersion() << " on " << t.AsSQLString() << std::endl;
1712 out << std::endl;
1713
1714 char quote = '"';
1715
1716 // Writes include.
1717 out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << std::endl << std::endl;
1718 out << "#ifndef ROOT_TStyle" << std::endl;
1719 out << "#include " << quote << "TStyle.h" << quote << std::endl;
1720 out << "#endif" << std::endl;
1721 out << std::endl << "#endif" << std::endl;
1722
1723 // Writes the macro entry point equal to the fname
1724 out << std::endl;
1725 out << "void " << sname << "()" << std::endl;
1726 out << "{" << std::endl;
1727 delete [] sname;
1728
1729 TStyle::SavePrimitive(out, option);
1730
1731 out << "}" << std::endl;
1732 out.close();
1733
1734 printf(" C++ macro file %s has been generated\n", gSystem->BaseName(ff));
1735}
1736
1737////////////////////////////////////////////////////////////////////////////////
1738/// Save a main frame widget as a C++ statement(s) on output stream out.
1739
1740void TStyle::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
1741{
1742 char quote = '"';
1743
1744 out << " // Add the saved style to the current ROOT session." << std::endl;
1745 out << std::endl;
1746 out<<" "<<"delete gROOT->GetStyle("<<quote<<GetName()<<quote<<");"<< std::endl;
1747 out << std::endl;
1748 out<<" "<<"TStyle *tmpStyle = new TStyle("
1749 << quote << GetName() << quote << ", "
1750 << quote << GetTitle() << quote << ");" << std::endl;
1751
1752 // fXAxis, fYAxis and fZAxis
1753 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("x") <<", \"x\");"<<std::endl;
1754 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("y") <<", \"y\");"<<std::endl;
1755 out<<" "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("z") <<", \"z\");"<<std::endl;
1756 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("x") <<", \"x\");"<<std::endl;
1757 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("y") <<", \"y\");"<<std::endl;
1758 out<<" "<<"tmpStyle->SetAxisColor(" <<GetAxisColor("z") <<", \"z\");"<<std::endl;
1759 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("x") <<", \"x\");"<<std::endl;
1760 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("y") <<", \"y\");"<<std::endl;
1761 out<<" "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("z") <<", \"z\");"<<std::endl;
1762 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("x") <<", \"x\");"<<std::endl;
1763 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("y") <<", \"y\");"<<std::endl;
1764 out<<" "<<"tmpStyle->SetLabelFont(" <<GetLabelFont("z") <<", \"z\");"<<std::endl;
1765 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("x")<<", \"x\");"<<std::endl;
1766 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("y")<<", \"y\");"<<std::endl;
1767 out<<" "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("z")<<", \"z\");"<<std::endl;
1768 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("x") <<", \"x\");"<<std::endl;
1769 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("y") <<", \"y\");"<<std::endl;
1770 out<<" "<<"tmpStyle->SetLabelSize(" <<GetLabelSize("z") <<", \"z\");"<<std::endl;
1771 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("x") <<", \"x\");"<<std::endl;
1772 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("y") <<", \"y\");"<<std::endl;
1773 out<<" "<<"tmpStyle->SetTickLength(" <<GetTickLength("z") <<", \"z\");"<<std::endl;
1774 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("x")<<", \"x\");"<<std::endl;
1775 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("y")<<", \"y\");"<<std::endl;
1776 out<<" "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("z")<<", \"z\");"<<std::endl;
1777 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("x") <<", \"x\");"<<std::endl;
1778 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("y") <<", \"y\");"<<std::endl;
1779 out<<" "<<"tmpStyle->SetTitleSize(" <<GetTitleSize("z") <<", \"z\");"<<std::endl;
1780 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("x") <<", \"x\");"<<std::endl;
1781 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("y") <<", \"y\");"<<std::endl;
1782 out<<" "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("z") <<", \"z\");"<<std::endl;
1783 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("x") <<", \"x\");"<<std::endl;
1784 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("y") <<", \"y\");"<<std::endl;
1785 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont("z") <<", \"z\");"<<std::endl;
1786
1787 out<<" "<<"tmpStyle->SetBarWidth(" <<GetBarWidth() <<");"<<std::endl;
1788 out<<" "<<"tmpStyle->SetBarOffset(" <<GetBarOffset() <<");"<<std::endl;
1789 out<<" "<<"tmpStyle->SetDrawBorder(" <<GetDrawBorder() <<");"<<std::endl;
1790 out<<" "<<"tmpStyle->SetOptLogx(" <<GetOptLogx() <<");"<<std::endl;
1791 out<<" "<<"tmpStyle->SetOptLogy(" <<GetOptLogy() <<");"<<std::endl;
1792 out<<" "<<"tmpStyle->SetOptLogz(" <<GetOptLogz() <<");"<<std::endl;
1793 out<<" "<<"tmpStyle->SetOptDate(" <<GetOptDate() <<");"<<std::endl;
1794 out<<" "<<"tmpStyle->SetOptStat(" <<GetOptStat() <<");"<<std::endl;
1795
1796 if (GetOptTitle()) out << " tmpStyle->SetOptTitle(kTRUE);" << std::endl;
1797 else out << " tmpStyle->SetOptTitle(kFALSE);" << std::endl;
1798 out<<" "<<"tmpStyle->SetOptFit(" <<GetOptFit() <<");"<<std::endl;
1799 out<<" "<<"tmpStyle->SetNumberContours(" <<GetNumberContours() <<");"<<std::endl;
1800
1801 // fAttDate
1802 out<<" "<<"tmpStyle->GetAttDate()->SetTextFont(" <<GetAttDate()->GetTextFont() <<");"<<std::endl;
1803 out<<" "<<"tmpStyle->GetAttDate()->SetTextSize(" <<GetAttDate()->GetTextSize() <<");"<<std::endl;
1804 out<<" "<<"tmpStyle->GetAttDate()->SetTextAngle("<<GetAttDate()->GetTextAngle()<<");"<<std::endl;
1805 out<<" "<<"tmpStyle->GetAttDate()->SetTextAlign("<<GetAttDate()->GetTextAlign()<<");"<<std::endl;
1806 out<<" "<<"tmpStyle->GetAttDate()->SetTextColor("<<GetAttDate()->GetTextColor()<<");"<<std::endl;
1807
1808 out<<" "<<"tmpStyle->SetDateX(" <<GetDateX() <<");"<<std::endl;
1809 out<<" "<<"tmpStyle->SetDateY(" <<GetDateY() <<");"<<std::endl;
1810 out<<" "<<"tmpStyle->SetEndErrorSize(" <<GetEndErrorSize() <<");"<<std::endl;
1811 out<<" "<<"tmpStyle->SetErrorX(" <<GetErrorX() <<");"<<std::endl;
1812 out<<" "<<"tmpStyle->SetFuncColor(" <<GetFuncColor() <<");"<<std::endl;
1813 out<<" "<<"tmpStyle->SetFuncStyle(" <<GetFuncStyle() <<");"<<std::endl;
1814 out<<" "<<"tmpStyle->SetFuncWidth(" <<GetFuncWidth() <<");"<<std::endl;
1815 out<<" "<<"tmpStyle->SetGridColor(" <<GetGridColor() <<");"<<std::endl;
1816 out<<" "<<"tmpStyle->SetGridStyle(" <<GetGridStyle() <<");"<<std::endl;
1817 out<<" "<<"tmpStyle->SetGridWidth(" <<GetGridWidth() <<");"<<std::endl;
1818 out<<" "<<"tmpStyle->SetLegendBorderSize("<<GetLegendBorderSize()<<");"<<std::endl;
1819 out<<" "<<"tmpStyle->SetLegendFillColor(" <<GetLegendFillColor() <<");"<<std::endl;
1820 out<<" "<<"tmpStyle->SetLegendFont(" <<GetLegendFont() <<");"<<std::endl;
1821 out<<" "<<"tmpStyle->SetLegendTextSize(" <<GetLegendTextSize() <<");"<<std::endl;
1822 out<<" "<<"tmpStyle->SetHatchesLineWidth("<<GetHatchesLineWidth()<<");"<<std::endl;
1823 out<<" "<<"tmpStyle->SetHatchesSpacing(" <<GetHatchesSpacing() <<");"<<std::endl;
1824 out<<" "<<"tmpStyle->SetFrameFillColor(" <<GetFrameFillColor() <<");"<<std::endl;
1825 out<<" "<<"tmpStyle->SetFrameLineColor(" <<GetFrameLineColor() <<");"<<std::endl;
1826 out<<" "<<"tmpStyle->SetFrameFillStyle(" <<GetFrameFillStyle() <<");"<<std::endl;
1827 out<<" "<<"tmpStyle->SetFrameLineStyle(" <<GetFrameLineStyle() <<");"<<std::endl;
1828 out<<" "<<"tmpStyle->SetFrameLineWidth(" <<GetFrameLineWidth() <<");"<<std::endl;
1829 out<<" "<<"tmpStyle->SetFrameBorderSize(" <<GetFrameBorderSize() <<");"<<std::endl;
1830 out<<" "<<"tmpStyle->SetFrameBorderMode(" <<GetFrameBorderMode() <<");"<<std::endl;
1831 out<<" "<<"tmpStyle->SetHistFillColor(" <<GetHistFillColor() <<");"<<std::endl;
1832 out<<" "<<"tmpStyle->SetHistLineColor(" <<GetHistLineColor() <<");"<<std::endl;
1833 out<<" "<<"tmpStyle->SetHistFillStyle(" <<GetHistFillStyle() <<");"<<std::endl;
1834 out<<" "<<"tmpStyle->SetHistLineStyle(" <<GetHistLineStyle() <<");"<<std::endl;
1835 out<<" "<<"tmpStyle->SetHistLineWidth(" <<GetHistLineWidth() <<");"<<std::endl;
1836 if (GetHistMinimumZero()) out<<" tmpStyle->SetHistMinimumZero(kTRUE);" <<std::endl;
1837 else out<<" tmpStyle->SetHistMinimumZero(kFALSE);"<<std::endl;
1838 if (GetCanvasPreferGL()) out<<" tmpStyle->SetCanvasPreferGL(kTRUE);" <<std::endl;
1839 else out<<" tmpStyle->SetCanvasPreferGL(kFALSE);"<<std::endl;
1840 out<<" "<<"tmpStyle->SetCanvasColor(" <<GetCanvasColor() <<");"<<std::endl;
1841 out<<" "<<"tmpStyle->SetCanvasBorderSize("<<GetCanvasBorderSize()<<");"<<std::endl;
1842 out<<" "<<"tmpStyle->SetCanvasBorderMode("<<GetCanvasBorderMode()<<");"<<std::endl;
1843 out<<" "<<"tmpStyle->SetCanvasDefH(" <<GetCanvasDefH() <<");"<<std::endl;
1844 out<<" "<<"tmpStyle->SetCanvasDefW(" <<GetCanvasDefW() <<");"<<std::endl;
1845 out<<" "<<"tmpStyle->SetCanvasDefX(" <<GetCanvasDefX() <<");"<<std::endl;
1846 out<<" "<<"tmpStyle->SetCanvasDefY(" <<GetCanvasDefY() <<");"<<std::endl;
1847 out<<" "<<"tmpStyle->SetPadColor(" <<GetPadColor() <<");"<<std::endl;
1848 out<<" "<<"tmpStyle->SetPadBorderSize(" <<GetPadBorderSize() <<");"<<std::endl;
1849 out<<" "<<"tmpStyle->SetPadBorderMode(" <<GetPadBorderMode() <<");"<<std::endl;
1850 out<<" "<<"tmpStyle->SetPadBottomMargin(" <<GetPadBottomMargin() <<");"<<std::endl;
1851 out<<" "<<"tmpStyle->SetPadTopMargin(" <<GetPadTopMargin() <<");"<<std::endl;
1852 out<<" "<<"tmpStyle->SetPadLeftMargin(" <<GetPadLeftMargin() <<");"<<std::endl;
1853 out<<" "<<"tmpStyle->SetPadRightMargin(" <<GetPadRightMargin() <<");"<<std::endl;
1854 if (GetPadGridX()) out<<" tmpStyle->SetPadGridX(kTRUE);" <<std::endl;
1855 else out<<" tmpStyle->SetPadGridX(kFALSE);"<<std::endl;
1856 if (GetPadGridY()) out<<" tmpStyle->SetPadGridY(kTRUE);" <<std::endl;
1857 else out<<" tmpStyle->SetPadGridY(kFALSE);"<<std::endl;
1858 out<<" "<<"tmpStyle->SetPadTickX(" <<GetPadTickX() <<");"<<std::endl;
1859 out<<" "<<"tmpStyle->SetPadTickY(" <<GetPadTickY() <<");"<<std::endl;
1860
1861 // fPaperSizeX, fPaperSizeY
1862 out<<" "<<"tmpStyle->SetPaperSize(" <<fPaperSizeX <<", "
1863 <<fPaperSizeY <<");"<<std::endl;
1864
1865 out<<" "<<"tmpStyle->SetScreenFactor(" <<GetScreenFactor() <<");"<<std::endl;
1866 out<<" "<<"tmpStyle->SetStatColor(" <<GetStatColor() <<");"<<std::endl;
1867 out<<" "<<"tmpStyle->SetStatTextColor(" <<GetStatTextColor() <<");"<<std::endl;
1868 out<<" "<<"tmpStyle->SetStatBorderSize(" <<GetStatBorderSize() <<");"<<std::endl;
1869 out<<" "<<"tmpStyle->SetStatFont(" <<GetStatFont() <<");"<<std::endl;
1870 out<<" "<<"tmpStyle->SetStatFontSize(" <<GetStatFontSize() <<");"<<std::endl;
1871 out<<" "<<"tmpStyle->SetStatStyle(" <<GetStatStyle() <<");"<<std::endl;
1872 out<<" "<<"tmpStyle->SetStatFormat(" <<quote << GetStatFormat()
1873 <<quote <<");"<<std::endl;
1874 out<<" "<<"tmpStyle->SetStatX(" <<GetStatX() <<");"<<std::endl;
1875 out<<" "<<"tmpStyle->SetStatY(" <<GetStatY() <<");"<<std::endl;
1876 out<<" "<<"tmpStyle->SetStatW(" <<GetStatW() <<");"<<std::endl;
1877 out<<" "<<"tmpStyle->SetStatH(" <<GetStatH() <<");"<<std::endl;
1878 if (GetStripDecimals()) out<<" tmpStyle->SetStripDecimals(kTRUE);" <<std::endl;
1879 else out<<" tmpStyle->SetStripDecimals(kFALSE);"<<std::endl;
1880 out<<" "<<"tmpStyle->SetTitleAlign(" <<GetTitleAlign() <<");"<<std::endl;
1881 out<<" "<<"tmpStyle->SetTitleFillColor(" <<GetTitleFillColor() <<");"<<std::endl;
1882 out<<" "<<"tmpStyle->SetTitleTextColor(" <<GetTitleTextColor() <<");"<<std::endl;
1883 out<<" "<<"tmpStyle->SetTitleBorderSize("<<GetTitleBorderSize()<<");"<<std::endl;
1884 out<<" "<<"tmpStyle->SetTitleFont(" <<GetTitleFont() <<");"<<std::endl;
1885 out<<" "<<"tmpStyle->SetTitleFontSize(" <<GetTitleFontSize() <<");"<<std::endl;
1886 out<<" "<<"tmpStyle->SetTitleStyle(" <<GetTitleStyle() <<");"<<std::endl;
1887 out<<" "<<"tmpStyle->SetTitleX(" <<GetTitleX() <<");"<<std::endl;
1888 out<<" "<<"tmpStyle->SetTitleY(" <<GetTitleY() <<");"<<std::endl;
1889 out<<" "<<"tmpStyle->SetTitleW(" <<GetTitleW() <<");"<<std::endl;
1890 out<<" "<<"tmpStyle->SetTitleH(" <<GetTitleH() <<");"<<std::endl;
1891 out<<" "<<"tmpStyle->SetLegoInnerR(" <<GetLegoInnerR() <<");"<<std::endl;
1892 out<<std::endl;
1893
1894 // fPalette
1895 out<<" "<<"Int_t fPaletteColor[" <<GetNumberOfColors() <<"] = {";
1896 for (Int_t ci=0; ci<GetNumberOfColors()-1; ++ci) {
1897 if (ci % 10 == 9)
1898 out<<std::endl<<" ";
1899 out<<GetColorPalette(ci)<<", ";
1900 }
1901 out<<GetColorPalette(GetNumberOfColors() - 1) <<"};"<<std::endl;
1902 out<<" "<<"tmpStyle->SetPalette(" << GetNumberOfColors()
1903 << ", fPaletteColor);" << std::endl;
1904 out<<std::endl;
1905
1906 // fLineStyle
1907 out<<" "<<"TString fLineStyleArrayTmp[30] = {";
1908 for (Int_t li=0; li<29; ++li) {
1909 if (li % 5 == 4)
1910 out<<std::endl<<" ";
1911 out<<quote << fLineStyle[li].Data() << quote << ", ";
1912 }
1913 out<<quote<<fLineStyle[29].Data()<<quote<<"};"<<std::endl;
1914 out<<" "<<"for (Int_t i=0; i<30; i++)"<<std::endl;
1915 out<<" "<<" tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);"<<std::endl;
1916 out<<std::endl;
1917
1918 out<<" "<<"tmpStyle->SetHeaderPS(" <<quote<<GetHeaderPS()
1919 <<quote <<");"<<std::endl;
1920 out<<" "<<"tmpStyle->SetTitlePS(" <<quote<<GetTitlePS()
1921 <<quote <<");"<<std::endl;
1922 out<<" "<<"tmpStyle->SetFitFormat(" <<quote<<GetFitFormat()
1923 <<quote <<");"<<std::endl;
1924 out<<" "<<"tmpStyle->SetPaintTextFormat("<<quote<<GetPaintTextFormat()
1925 <<quote <<");"<<std::endl;
1926 out<<" "<<"tmpStyle->SetLineScalePS(" <<GetLineScalePS() <<");"<<std::endl;
1927 out<<" "<<"tmpStyle->SetJoinLinePS(" <<GetJoinLinePS() <<");"<<std::endl;
1928 out<<" "<<"tmpStyle->SetColorModelPS(" <<GetColorModelPS() <<");"<<std::endl;
1929 out<<" "<<Form("tmpStyle->SetTimeOffset(%9.0f);", GetTimeOffset()) <<std::endl;
1930 out<<std::endl;
1931
1932 // Inheritance :
1933 // TAttLine :
1934 out <<" " <<"tmpStyle->SetLineColor(" <<GetLineColor() <<");" <<std::endl;
1935 out <<" " <<"tmpStyle->SetLineStyle(" <<GetLineStyle() <<");" <<std::endl;
1936 out <<" " <<"tmpStyle->SetLineWidth(" <<GetLineWidth() <<");" <<std::endl;
1937
1938 // TAttFill
1939 out <<" " <<"tmpStyle->SetFillColor(" <<GetFillColor() <<");" <<std::endl;
1940 out <<" " <<"tmpStyle->SetFillStyle(" <<GetFillStyle() <<");" <<std::endl;
1941
1942 // TAttMarker
1943 out <<" " <<"tmpStyle->SetMarkerColor(" <<GetMarkerColor() <<");" <<std::endl;
1944 out <<" " <<"tmpStyle->SetMarkerSize(" <<GetMarkerSize() <<");" <<std::endl;
1945 out <<" " <<"tmpStyle->SetMarkerStyle(" <<GetMarkerStyle() <<");" <<std::endl;
1946
1947 // TAttText
1948 out <<" " <<"tmpStyle->SetTextAlign(" <<GetTextAlign() <<");" <<std::endl;
1949 out <<" " <<"tmpStyle->SetTextAngle(" <<GetTextAngle() <<");" <<std::endl;
1950 out <<" " <<"tmpStyle->SetTextColor(" <<GetTextColor() <<");" <<std::endl;
1951 out <<" " <<"tmpStyle->SetTextFont(" <<GetTextFont() <<");" <<std::endl;
1952 out <<" " <<"tmpStyle->SetTextSize(" <<GetTextSize() <<");" <<std::endl;
1953}
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
short Color_t
Definition: RtypesCore.h:79
short Style_t
Definition: RtypesCore.h:76
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:83
#define ClassImp(name)
Definition: Rtypes.h:365
@ kRed
Definition: Rtypes.h:64
@ kBlack
Definition: Rtypes.h:63
@ kGreen
Definition: Rtypes.h:64
@ kBlue
Definition: Rtypes.h:64
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
char name[80]
Definition: TGX11.cxx:109
R__EXTERN TVirtualMutex * gROOTMutex
Definition: TROOT.h:59
#define gROOT
Definition: TROOT.h:415
char * Form(const char *fmt,...)
TStyle * gStyle
Definition: TStyle.cxx:27
const UInt_t kTakeStyle
Definition: TStyle.cxx:28
R__EXTERN TSystem * gSystem
Definition: TSystem.h:560
#define R__LOCKGUARD(mutex)
#define gPad
Definition: TVirtualPad.h:286
Color * colors
Definition: X3DBuffer.c:21
#define snprintf
Definition: civetweb.c:1540
char ** Argv() const
Definition: TApplication.h:137
virtual Color_t GetTitleColor() const
Definition: TAttAxis.h:46
virtual Color_t GetLabelColor() const
Definition: TAttAxis.h:38
virtual Int_t GetNdivisions() const
Definition: TAttAxis.h:36
virtual Color_t GetAxisColor() const
Definition: TAttAxis.h:37
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
Definition: TAttAxis.cxx:294
virtual Style_t GetTitleFont() const
Definition: TAttAxis.h:47
virtual Float_t GetLabelOffset() const
Definition: TAttAxis.h:40
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
Definition: TAttAxis.cxx:163
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition: TAttAxis.cxx:204
virtual Style_t GetLabelFont() const
Definition: TAttAxis.h:39
virtual void SetTitleFont(Style_t font=62)
Set the title font.
Definition: TAttAxis.cxx:322
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
Definition: TAttAxis.cxx:193
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
Definition: TAttAxis.cxx:183
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title.
Definition: TAttAxis.cxx:304
virtual void SetTitleColor(Color_t color=1)
Set color of axis title.
Definition: TAttAxis.cxx:313
virtual Float_t GetTitleSize() const
Definition: TAttAxis.h:44
virtual Float_t GetLabelSize() const
Definition: TAttAxis.h:41
virtual Float_t GetTickLength() const
Definition: TAttAxis.h:45
virtual void ResetAttAxis(Option_t *option="")
Reset axis attributes.
Definition: TAttAxis.cxx:79
virtual Float_t GetTitleOffset() const
Definition: TAttAxis.h:43
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
Definition: TAttAxis.cxx:280
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Definition: TAttAxis.cxx:229
void Copy(TAttAxis &attaxis) const
Copy of the object.
Definition: TAttAxis.cxx:61
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
Definition: TAttAxis.cxx:173
Fill Area Attributes class.
Definition: TAttFill.h:19
virtual Color_t GetFillColor() const
Return the fill area color.
Definition: TAttFill.h:30
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
Definition: TAttFill.cxx:202
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 ResetAttFill(Option_t *option="")
Reset this fill attributes to default values.
Definition: TAttFill.cxx:225
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition: TAttFill.h:39
Line Attributes class.
Definition: TAttLine.h:18
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
virtual Width_t GetLineWidth() const
Return the line width.
Definition: TAttLine.h:35
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void ResetAttLine(Option_t *option="")
Reset this line attributes to default values.
Definition: TAttLine.cxx:260
virtual Style_t GetLineStyle() const
Return the line style.
Definition: TAttLine.h:34
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Definition: TAttLine.cxx:172
Marker Attributes class.
Definition: TAttMarker.h:19
virtual Style_t GetMarkerStyle() const
Return the marker style.
Definition: TAttMarker.h:32
virtual Color_t GetMarkerColor() const
Return the marker color.
Definition: TAttMarker.h:31
virtual Size_t GetMarkerSize() const
Return the marker size.
Definition: TAttMarker.h:33
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
virtual void ResetAttMarker(Option_t *toption="")
Reset this marker attributes to the default values.
Definition: TAttMarker.cxx:235
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
Definition: TAttMarker.cxx:210
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
Text Attributes class.
Definition: TAttText.h:18
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:41
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 SetTextFont(Font_t tfont=62)
Set the text font.
Definition: TAttText.h:45
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:46
void Copy(TAttText &atttext) const
Copy this text attributes to a new TAttText.
Definition: TAttText.cxx:291
virtual void ResetAttText(Option_t *toption="")
Reset this text attributes to default values.
Definition: TAttText.cxx:332
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
The color creation and management class.
Definition: TColor.h:19
static void SetPalette(Int_t ncolors, Int_t *colors, Float_t alpha=1.)
Static function.
Definition: TColor.cxx:2404
static Int_t GetColorPalette(Int_t i)
Static function returning the color number i in current palette.
Definition: TColor.cxx:1390
static Int_t GetNumberOfColors()
Static function returning number of colors in the color palette.
Definition: TColor.cxx:1410
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:37
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
Definition: TDatime.cxx:151
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: TNamed.cxx:154
Mother of all ROOT objects.
Definition: TObject.h:37
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition: TObject.cxx:321
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual void Copy(TObject &object) const
Copy this to obj.
Definition: TObject.cxx:61
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
Basic string class.
Definition: TString.h:131
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
const char * Data() const
Definition: TString.h:364
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
TStyle objects may be created to define special styles.
Definition: TStyle.h:27
Double_t GetTimeOffset() const
Definition: TStyle.h:257
Int_t GetOptLogy() const
Definition: TStyle.h:236
Color_t GetGridColor() const
Definition: TStyle.h:210
Int_t fOptFile
True if option File is selected.
Definition: TStyle.h:43
Int_t GetOptStat() const
Definition: TStyle.h:233
Color_t GetLabelColor(Option_t *axis="X") const
Return the label color number in the axis.
Definition: TStyle.cxx:927
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Set color to draw the axis line and tick marks.
Definition: TStyle.cxx:1135
void SetPadBorderMode(Int_t mode=1)
Definition: TStyle.h:335
void SetOptTitle(Int_t tit=1)
Definition: TStyle.h:313
Color_t fGridColor
Grid line color (if 0 use axis line color)
Definition: TStyle.h:58
void SetPadTopMargin(Float_t margin=0.1)
Definition: TStyle.h:337
Color_t GetStatTextColor() const
Definition: TStyle.h:246
void SetLegendFont(Style_t font=62)
Definition: TStyle.h:331
void SetTitleX(Float_t x=0)
Definition: TStyle.h:391
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:1450
Int_t fCanvasDefW
Default canvas width.
Definition: TStyle.h:86
Int_t fHatchesLineWidth
Hatches line width for hatch styles > 3100.
Definition: TStyle.h:65
Float_t fScreenFactor
Multiplication factor for canvas size and position.
Definition: TStyle.h:102
void SaveSource(const char *filename, Option_t *option=0)
Save the current style in a C++ macro file.
Definition: TStyle.cxx:1682
Float_t fTitleFontSize
Font size in pixels for fonts with precision type 3.
Definition: TStyle.h:120
void SetDateX(Float_t x=0.01)
Definition: TStyle.h:316
Int_t fCanvasDefX
Default canvas top X position.
Definition: TStyle.h:87
void SetStatFormat(const char *format="6.4g")
Definition: TStyle.h:374
void SetPadBottomMargin(Float_t margin=0.1)
Definition: TStyle.h:336
Float_t GetTitleX() const
Definition: TStyle.h:268
void SetLegendFillColor(Color_t color=0)
Definition: TStyle.h:330
Float_t fPadRightMargin
Pad right margin.
Definition: TStyle.h:95
Float_t fPaperSizeX
PostScript paper size along X.
Definition: TStyle.h:100
void SetPaintTextFormat(const char *format="g")
Definition: TStyle.h:364
Int_t GetOptTitle() const
Definition: TStyle.h:234
Float_t GetScreenFactor() const
Definition: TStyle.h:244
TString fPaintTextFormat
Printing format for TH2::PaintText.
Definition: TStyle.h:131
Color_t GetHistLineColor() const
Definition: TStyle.h:221
Color_t fStatColor
Stat fill area color.
Definition: TStyle.h:103
Int_t GetNdivisions(Option_t *axis="X") const
Return number of divisions.
Definition: TStyle.cxx:895
void SetFrameFillColor(Color_t color=1)
Definition: TStyle.h:350
Int_t fFrameBorderMode
Pad frame border mode.
Definition: TStyle.h:73
Int_t GetPadTickX() const
Definition: TStyle.h:205
Color_t GetTitleColor(Option_t *axis="X") const
Return title color.
Definition: TStyle.cxx:1015
Style_t fHistLineStyle
Histogram line style.
Definition: TStyle.h:77
Color_t GetFrameLineColor() const
Definition: TStyle.h:214
Style_t GetGridStyle() const
Definition: TStyle.h:211
Int_t GetJoinLinePS() const
Definition: TStyle.h:275
void SetStatFont(Style_t font=62)
Definition: TStyle.h:372
void SetEndErrorSize(Float_t np=2)
Set the size (in pixels) of the small lines drawn at the end of the error bars (TH1 or TGraphErrors).
Definition: TStyle.cxx:1152
Float_t GetStatFontSize() const
Definition: TStyle.h:249
Float_t GetBarOffset() const
Definition: TStyle.h:171
Float_t GetStatX() const
Definition: TStyle.h:252
Float_t GetLabelSize(Option_t *axis="X") const
Return label size.
Definition: TStyle.cxx:963
Color_t GetPadColor() const
Definition: TStyle.h:196
Float_t fBarOffset
Offset of bar for graphs.
Definition: TStyle.h:34
void SetPadRightMargin(Float_t margin=0.1)
Definition: TStyle.h:339
Style_t GetHistFillStyle() const
Definition: TStyle.h:222
void SetCanvasColor(Color_t color=19)
Definition: TStyle.h:322
TAttAxis fZaxis
Z axis attributes.
Definition: TStyle.h:32
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition: TStyle.cxx:1586
Float_t GetPadRightMargin() const
Definition: TStyle.h:202
Float_t GetTickLength(Option_t *axis="X") const
Return tick length.
Definition: TStyle.cxx:1003
Int_t fDrawBorder
Flag to draw border(=1) or not (0)
Definition: TStyle.h:36
void SetTitleBorderSize(Width_t size=2)
Definition: TStyle.h:386
Style_t GetFrameFillStyle() const
Definition: TStyle.h:215
Float_t GetTitleSize(Option_t *axis="X") const
Return title size.
Definition: TStyle.cxx:1051
Float_t GetLegoInnerR() const
Definition: TStyle.h:228
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Function used by the TStyle manager when drawing a canvas showing the current style.
Definition: TStyle.cxx:573
Int_t AxisChoice(Option_t *axis) const
Definition: TStyle.h:146
TString fTitlePS
User defined Postscript file title.
Definition: TStyle.h:129
Style_t GetLabelFont(Option_t *axis="X") const
Return label font.
Definition: TStyle.cxx:939
virtual ~TStyle()
Destructor.
Definition: TStyle.cxx:395
void SetCanvasBorderMode(Int_t mode=1)
Definition: TStyle.h:324
Float_t GetTitleY() const
Definition: TStyle.h:269
Style_t fFuncStyle
Function style.
Definition: TStyle.h:56
void SetOptDate(Int_t datefl=1)
If optdate is non null, the current date/time will be printed in the canvas.
Definition: TStyle.cxx:1358
Int_t fPadTickX
True to set special pad ticks along X.
Definition: TStyle.h:98
Float_t GetDateX() const
Definition: TStyle.h:186
Style_t fStatFont
Font style of Stats PaveLabel.
Definition: TStyle.h:106
TString fLineStyle[30]
String describing line style i (for postScript)
Definition: TStyle.h:127
void SetDateY(Float_t y=0.01)
Definition: TStyle.h:317
Width_t fGridWidth
Grid line width.
Definition: TStyle.h:60
Float_t GetTitleOffset(Option_t *axis="X") const
Return title offset.
Definition: TStyle.cxx:1039
Color_t GetHistFillColor() const
Definition: TStyle.h:220
void SetFrameBorderMode(Int_t mode=1)
Definition: TStyle.h:356
Style_t GetTitleFont(Option_t *axis="X") const
Return title font.
Definition: TStyle.cxx:1027
Int_t fOptLogx
True if log scale in X.
Definition: TStyle.h:37
Bool_t fStripDecimals
Strip decimals in axis labels.
Definition: TStyle.h:114
Bool_t fHistMinimumZero
True if default minimum is 0, false if minimum is automatic.
Definition: TStyle.h:79
Style_t fLegendFont
Legend font style.
Definition: TStyle.h:63
void SetFuncColor(Color_t color=1)
Definition: TStyle.h:345
Bool_t GetHistMinimumZero() const
Definition: TStyle.h:225
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, Float_t alpha=1.)
See TColor::SetPalette.
Definition: TStyle.cxx:1643
TAttAxis fXaxis
X axis attributes.
Definition: TStyle.h:30
void SetHeaderPS(const char *header)
Define a string to be inserted in the Postscript header.
Definition: TStyle.cxx:1174
virtual void Browse(TBrowser *b)
Browse the style object.
Definition: TStyle.cxx:419
Float_t GetStatY() const
Definition: TStyle.h:253
Color_t fTitleColor
Title fill area color.
Definition: TStyle.h:116
Int_t fJoinLinePS
Determines the appearance of joining lines on PostScript.
Definition: TStyle.h:133
void SetPadTickY(Int_t ticky)
Definition: TStyle.h:343
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Specify a parameter offset to control the distance between the axis and the axis title.
Definition: TStyle.cxx:1609
Width_t fFrameLineWidth
Pad frame line width.
Definition: TStyle.h:71
Color_t GetTitleFillColor() const
Definition: TStyle.h:259
Int_t GetCanvasDefH() const
Definition: TStyle.h:180
void SetColorModelPS(Int_t c=0)
Define the color model used by TPostScript and TPDF (RGB or CMYK).
Definition: TStyle.cxx:1087
Style_t GetTitleStyle() const
Definition: TStyle.h:261
void SetPadTickX(Int_t tickx)
Definition: TStyle.h:342
Float_t GetLabelOffset(Option_t *axis="X") const
Return label offset.
Definition: TStyle.cxx:951
Int_t GetCanvasDefX() const
Definition: TStyle.h:182
Int_t fOptTitle
True if option Title is selected.
Definition: TStyle.h:42
Style_t fTitleFont
Font style of Title PaveLabel.
Definition: TStyle.h:119
Int_t GetOptDate() const
Definition: TStyle.h:230
Bool_t GetPadGridY() const
Definition: TStyle.h:204
Int_t fOptDate
True if date option is selected.
Definition: TStyle.h:40
Float_t fPadTopMargin
Pad top margin.
Definition: TStyle.h:93
Color_t GetStatColor() const
Definition: TStyle.h:245
Width_t fCanvasBorderSize
Canvas border size.
Definition: TStyle.h:83
void SetTitleTextColor(Color_t color=1)
Definition: TStyle.h:383
Color_t fCanvasColor
Canvas color.
Definition: TStyle.h:82
Float_t GetPadLeftMargin() const
Definition: TStyle.h:201
Double_t GetHatchesSpacing() const
Definition: TStyle.h:190
Float_t fStatY
Y position of top right corner of stat box.
Definition: TStyle.h:111
Width_t GetLegendBorderSize() const
Definition: TStyle.h:191
Style_t fFrameLineStyle
Pad frame line style.
Definition: TStyle.h:70
void SetStatBorderSize(Width_t size=2)
Definition: TStyle.h:371
Float_t GetBarWidth() const
Definition: TStyle.h:172
Int_t fCanvasBorderMode
Canvas border mode.
Definition: TStyle.h:84
Bool_t GetCanvasPreferGL() const
Definition: TStyle.h:176
Int_t GetColorModelPS() const
Definition: TStyle.h:185
void SetErrorX(Float_t errorx=0.5)
Definition: TStyle.h:319
Int_t GetCanvasDefY() const
Definition: TStyle.h:183
void SetTitleColor(Color_t color=1, Option_t *axis="X")
Definition: TStyle.cxx:1565
void SetNumberContours(Int_t number=20)
Set the default number of contour levels when drawing 2-d plots.
Definition: TStyle.cxx:1312
Float_t fTitleX
X position of top left corner of title box.
Definition: TStyle.h:122
Int_t fShowToolBar
Show toolbar.
Definition: TStyle.h:47
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Set font number used to draw axis labels.
Definition: TStyle.cxx:1225
Width_t fFuncWidth
Function line width.
Definition: TStyle.h:57
Int_t fPadTickY
True to set special pad ticks along Y.
Definition: TStyle.h:99
TAttAxis fYaxis
Y axis attributes.
Definition: TStyle.h:31
Float_t fImageScaling
Image scaling to produce high definition bitmap images.
Definition: TStyle.h:136
Width_t GetFrameBorderSize() const
Definition: TStyle.h:218
Width_t fHistLineWidth
Histogram line width.
Definition: TStyle.h:78
void SetTimeOffset(Double_t toffset)
Change the time offset for time plotting.
Definition: TStyle.cxx:1661
Bool_t fPadGridY
True to get the grid along Y.
Definition: TStyle.h:97
void SetTitlePS(const char *pstitle)
Define a string to be used in the %Title of the Postscript files.
Definition: TStyle.cxx:1195
Style_t fHistFillStyle
Histogram fill style.
Definition: TStyle.h:76
void SetHistMinimumZero(Bool_t zero=kTRUE)
If the argument zero=kTRUE the minimum value for the Y axis of 1-d histograms is set to 0.
Definition: TStyle.cxx:1100
Bool_t GetPadGridX() const
Definition: TStyle.h:203
Float_t GetStatH() const
Definition: TStyle.h:255
void SetPadLeftMargin(Float_t margin=0.1)
Definition: TStyle.h:338
Float_t fEndErrorSize
Size of lines at the end of error bars.
Definition: TStyle.h:53
void SetJoinLinePS(Int_t joinline=0)
Definition: TStyle.h:288
Bool_t fIsReading
! Set to FALSE when userclass::UseCurrentStyle is called by the style manager
Definition: TStyle.h:135
Width_t GetGridWidth() const
Definition: TStyle.h:212
Width_t fFrameBorderSize
Pad frame border size.
Definition: TStyle.h:72
Color_t GetFuncColor() const
Definition: TStyle.h:207
void SetTitleXOffset(Float_t offset=1)
Definition: TStyle.h:387
void SetLegendBorderSize(Width_t size=4)
Definition: TStyle.h:329
TAttText * GetAttDate()
Definition: TStyle.h:159
Color_t fTitleTextColor
Title text color.
Definition: TStyle.h:117
Int_t GetPadTickY() const
Definition: TStyle.h:206
Width_t GetPadBorderSize() const
Definition: TStyle.h:197
void SetStripDecimals(Bool_t strip=kTRUE)
Set option to strip decimals when drawing axis labels.
Definition: TStyle.cxx:1674
Width_t GetTitleBorderSize() const
Definition: TStyle.h:263
void SetHistLineColor(Color_t color=1)
Definition: TStyle.h:358
TString fHeaderPS
User defined additional Postscript header.
Definition: TStyle.h:128
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Definition: TStyle.cxx:919
virtual void cd()
Change current style.
Definition: TStyle.cxx:444
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Definition: TStyle.cxx:976
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis labels.
Definition: TStyle.cxx:1241
Color_t fPadColor
Pad color.
Definition: TStyle.h:89
void SetFitFormat(const char *format="5.4g")
Definition: TStyle.h:283
Float_t GetErrorX() const
Definition: TStyle.h:175
Float_t fDateX
X position of the date in the canvas (in NDC)
Definition: TStyle.h:51
Int_t fOptLogz
True if log scale in z.
Definition: TStyle.h:39
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition: TStyle.cxx:1628
void SetTitleFillColor(Color_t color=1)
Definition: TStyle.h:382
TString fFitFormat
Printing format for fit parameters.
Definition: TStyle.h:130
Int_t fPadBorderMode
Pad border mode.
Definition: TStyle.h:91
Double_t GetLegendTextSize() const
Definition: TStyle.h:194
Int_t fNumberContours
Default number of contours for 2-d plots.
Definition: TStyle.h:49
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
Definition: TStyle.cxx:1295
Float_t fPadLeftMargin
Pad left margin.
Definition: TStyle.h:94
Float_t fTitleY
Y position of top left corner of title box.
Definition: TStyle.h:123
Double_t fTimeOffset
Time offset to the beginning of an axis.
Definition: TStyle.h:134
Color_t GetCanvasColor() const
Definition: TStyle.h:177
Color_t fFrameLineColor
Pad frame line color.
Definition: TStyle.h:68
Double_t fLegendTextSize
Legend text size. If 0 the size is computed automatically.
Definition: TStyle.h:64
Int_t fShowEditor
Show pad editor.
Definition: TStyle.h:46
Color_t fLegendFillColor
Legend fill color.
Definition: TStyle.h:62
void SetTitleAlign(Int_t a=13)
Definition: TStyle.h:381
Float_t fLineScalePS
Line scale factor when drawing lines on Postscript.
Definition: TStyle.h:132
void SetPaperSize(EPaperSize size)
Set paper size for PostScript output.
Definition: TStyle.cxx:1515
Float_t GetEndErrorSize() const
Definition: TStyle.h:174
Float_t GetPadBottomMargin() const
Definition: TStyle.h:199
void SetFrameLineWidth(Width_t width=1)
Definition: TStyle.h:354
void SetTickLength(Float_t length=0.03, Option_t *axis="X")
Set the tick marks length for an axis.
Definition: TStyle.cxx:1546
Double_t fHistTopMargin
Margin between histogram's top and pad's top.
Definition: TStyle.h:80
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Set the number of divisions to draw an axis.
Definition: TStyle.cxx:1121
Int_t fOptStat
True if option Stat is selected.
Definition: TStyle.h:41
Double_t fHatchesSpacing
Hatches spacing for hatch styles > 3100.
Definition: TStyle.h:66
Color_t fStatTextColor
Stat text color.
Definition: TStyle.h:104
Width_t GetFuncWidth() const
Definition: TStyle.h:209
TAttText fAttDate
Canvas date attribute.
Definition: TStyle.h:50
Width_t fStatBorderSize
Border size of Stats PaveLabel.
Definition: TStyle.h:105
Float_t fTitleW
Width of title box.
Definition: TStyle.h:124
Width_t fPadBorderSize
Pad border size.
Definition: TStyle.h:90
void SetFuncWidth(Width_t width=4)
Definition: TStyle.h:346
Int_t GetDrawBorder() const
Definition: TStyle.h:173
const char * GetTitlePS() const
Definition: TStyle.h:273
Color_t fHistLineColor
Histogram line color.
Definition: TStyle.h:75
Int_t fOptFit
True if option Fit is selected.
Definition: TStyle.h:44
Int_t GetCanvasDefW() const
Definition: TStyle.h:181
Width_t GetStatBorderSize() const
Definition: TStyle.h:247
void GetPaperSize(Float_t &xsize, Float_t &ysize) const
Set paper size for PostScript output.
Definition: TStyle.cxx:994
Int_t GetStripDecimals() const
Definition: TStyle.h:256
Color_t fFrameFillColor
Pad frame fill color.
Definition: TStyle.h:67
Style_t GetHistLineStyle() const
Definition: TStyle.h:223
void SavePrimitive(std::ostream &out, Option_t *="")
Save a main frame widget as a C++ statement(s) on output stream out.
Definition: TStyle.cxx:1740
TStyle()
Default constructor.
Definition: TStyle.cxx:142
Float_t fTitleH
Height of title box.
Definition: TStyle.h:125
void SetTitleStyle(Style_t style=1001)
Definition: TStyle.h:384
void SetStatColor(Color_t color=19)
Definition: TStyle.h:368
Style_t fFrameFillStyle
Pad frame fill style.
Definition: TStyle.h:69
void SetPadColor(Color_t color=19)
Definition: TStyle.h:333
Int_t GetTitleAlign()
Definition: TStyle.h:258
virtual void Reset(Option_t *option="")
Reset.
Definition: TStyle.cxx:582
Int_t fShowEventStatus
Show event status panel.
Definition: TStyle.h:45
Color_t GetTitleTextColor() const
Definition: TStyle.h:260
Bool_t fPadGridX
True to get the grid along X.
Definition: TStyle.h:96
void SetStatY(Float_t y=0)
Definition: TStyle.h:376
Style_t fTitleStyle
Fill area style of title PaveLabel.
Definition: TStyle.h:121
Style_t GetLegendFont() const
Definition: TStyle.h:193
Int_t GetOptLogx() const
Definition: TStyle.h:235
void SetLegendTextSize(Double_t size=0.)
Definition: TStyle.h:332
TStyle & operator=(const TStyle &style)
Definition: TStyle.cxx:410
Float_t GetTitleH() const
Definition: TStyle.h:271
Style_t GetStatStyle() const
Definition: TStyle.h:250
Float_t fStatFontSize
Font size in pixels for fonts with precision type 3.
Definition: TStyle.h:107
Bool_t fCanvasPreferGL
If true, rendering in canvas is with GL.
Definition: TStyle.h:81
Float_t fLegoInnerR
Inner radius for cylindrical legos.
Definition: TStyle.h:126
Width_t GetHistLineWidth() const
Definition: TStyle.h:224
EPaperSize
Definition: TStyle.h:139
@ kA4
Definition: TStyle.h:139
@ kUSLetter
Definition: TStyle.h:139
Int_t fOptLogy
True if log scale in y.
Definition: TStyle.h:38
Style_t GetFrameLineStyle() const
Definition: TStyle.h:216
void SetIsReading(Bool_t reading=kTRUE)
Sets the fIsReading member to reading (default=kTRUE).
Definition: TStyle.cxx:1186
Float_t GetStatW() const
Definition: TStyle.h:254
Style_t fGridStyle
Grid line style.
Definition: TStyle.h:59
Color_t fHistFillColor
Histogram fill color.
Definition: TStyle.h:74
Float_t GetDateY() const
Definition: TStyle.h:187
const char * GetFitFormat() const
Definition: TStyle.h:188
Int_t fCanvasDefH
Default canvas height.
Definition: TStyle.h:85
Int_t GetCanvasBorderMode() const
Definition: TStyle.h:179
Int_t GetPadBorderMode() const
Definition: TStyle.h:198
Color_t fFuncColor
Function color.
Definition: TStyle.h:55
const char * GetHeaderPS() const
Definition: TStyle.h:272
void SetTitleYOffset(Float_t offset=1)
Definition: TStyle.h:389
const char * GetStatFormat() const
Definition: TStyle.h:251
Width_t GetCanvasBorderSize() const
Definition: TStyle.h:178
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
Definition: TStyle.cxx:985
Float_t fStatH
Height of stat box.
Definition: TStyle.h:113
Int_t GetOptFit() const
Definition: TStyle.h:232
Float_t fStatX
X position of top right corner of stat box.
Definition: TStyle.h:110
virtual void Copy(TObject &style) const
Copy this style.
Definition: TStyle.cxx:452
Int_t fCanvasDefY
Default canvas top Y position.
Definition: TStyle.h:88
Int_t GetNumberContours() const
Definition: TStyle.h:229
void SetHistLineWidth(Width_t width=1)
Definition: TStyle.h:361
Float_t fPadBottomMargin
Pad bottom margin.
Definition: TStyle.h:92
virtual void Paint(Option_t *option="")
Show the options from the current style.
Definition: TStyle.cxx:1063
const char * GetPaintTextFormat() const
Definition: TStyle.h:238
Float_t GetLineScalePS() const
Definition: TStyle.h:276
Float_t fErrorX
Per cent of bin width for errors along X.
Definition: TStyle.h:54
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Set axis labels color.
Definition: TStyle.cxx:1205
Style_t GetStatFont() const
Definition: TStyle.h:248
void SetLabelSize(Float_t size=0.04, Option_t *axis="X")
Set size of axis labels.
Definition: TStyle.cxx:1256
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:1402
Width_t fLegendBorderSize
Legend box border size.
Definition: TStyle.h:61
Float_t fStatW
Width of stat box.
Definition: TStyle.h:112
Float_t fBarWidth
Width of bar for graphs.
Definition: TStyle.h:33
Width_t fTitleBorderSize
Border size of Title PavelLabel.
Definition: TStyle.h:118
Int_t GetOptLogz() const
Definition: TStyle.h:237
Float_t fPaperSizeY
PostScript paper size along Y.
Definition: TStyle.h:101
static void BuildStyles()
Create some standard styles.
Definition: TStyle.cxx:427
Int_t fTitleAlign
Title box alignment.
Definition: TStyle.h:115
Style_t GetFuncStyle() const
Definition: TStyle.h:208
Color_t GetLegendFillColor() const
Definition: TStyle.h:192
Float_t GetTitleFontSize() const
Definition: TStyle.h:262
Int_t GetHatchesLineWidth() const
Definition: TStyle.h:189
Float_t fDateY
Y position of the date in the canvas (in NDC)
Definition: TStyle.h:52
Color_t GetAxisColor(Option_t *axis="X") const
Return the axis color number in the axis.
Definition: TStyle.cxx:907
Int_t GetFrameBorderMode() const
Definition: TStyle.h:219
TString fStatFormat
Printing format for stats.
Definition: TStyle.h:109
Float_t GetPadTopMargin() const
Definition: TStyle.h:200
Int_t fColorModelPS
PostScript color model: 0 = RGB, 1 = CMYK.
Definition: TStyle.h:35
void SetLineScalePS(Float_t scale=3)
Definition: TStyle.h:289
Width_t GetFrameLineWidth() const
Definition: TStyle.h:217
Color_t GetFrameFillColor() const
Definition: TStyle.h:213
Style_t fStatStyle
Fill area style of Stats PaveLabel.
Definition: TStyle.h:108
Float_t GetTitleW() const
Definition: TStyle.h:270
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:942
TText * text
const Int_t n
Definition: legend1.C:16
TCanvas * style()
Definition: style.C:1
auto * l
Definition: textangle.C:4