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