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