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