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