TStyle.cxx

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TStyle.cxx 36443 2010-10-28 13:01:28Z couet $
00002 // Author: Rene Brun   12/12/94
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include <string.h>
00013 #include <stdio.h>
00014 #include <ctype.h>
00015 #include <cmath>
00016 
00017 #include "Riostream.h"
00018 #include "TApplication.h"
00019 #include "TColor.h"
00020 #include "TROOT.h"
00021 #include "TStyle.h"
00022 #include "TSystem.h"
00023 #include "TVirtualPad.h"
00024 #include "TVirtualMutex.h"
00025 
00026 TStyle  *gStyle;
00027 const UInt_t kTakeStyle = BIT(17);
00028 
00029 ClassImp(TStyle)
00030 
00031 
00032 //______________________________________________________________________________
00033 //
00034 // TStyle objects may be created to define special styles.
00035 // By default ROOT creates a default style that can be accessed via
00036 // the gStyle pointer.
00037 //
00038 // This class includes functions to set some of the following object attributes.
00039 //   - Canvas
00040 //   - Pad
00041 //   - Histogram axis
00042 //   - Lines
00043 //   - Fill areas
00044 //   - Text
00045 //   - Markers
00046 //   - Functions
00047 //   - Histogram Statistics and Titles
00048 
00049 
00050 //______________________________________________________________________________
00051 TStyle::TStyle() :TNamed()
00052 {
00053    // Default constructor.
00054 
00055    Reset();
00056 }
00057 
00058 
00059 //______________________________________________________________________________
00060 TStyle::TStyle(const char *name, const char *title) : TNamed(name,title)
00061 {
00062    // Create a new TStyle.
00063    // The following names are reserved to create special styles
00064    //   -Default: the default style set in TStyle::Reset
00065    //   -Plain: a black&white oriented style
00066    //   -Bold:
00067    //   -Video;
00068    //   -Pub:
00069    //     (see the definition of these styles below).
00070    //
00071    // Note a side-effect of calling gStyle->SetFillColor(0). This is nearly
00072    // equivalent of selecting the "Plain" style.
00073    //
00074    // Many graphics attributes may be set via the TStyle, see in particular
00075    //  - TStyle::SetNdivisions
00076    //  - TStyle::SetAxisColor
00077    //  - TStyle::SetHeaderPS
00078    //  - TStyle::SetTitlePS
00079    //  - TStyle::SetLabelColor
00080    //  - TStyle::SetLabelFont
00081    //  - TStyle::SetLabelOffset
00082    //  - TStyle::SetLabelSize
00083    //  - TStyle::SetOptDate
00084    //  - TStyle::SetLineStyleString
00085    //  - TStyle::SetOptFit
00086    //  - TStyle::SetOptStat
00087    //  - TStyle::SetPaperSize
00088    //  - TStyle::SetTickLength
00089    //  - TStyle::SetTitleOffset
00090    //  - TStyle::SetTitleSize
00091    //  - TStyle::SetPalette
00092    //  - TStyle::SetTimeOffset
00093    //  - TStyle::SetStripDecimals
00094    //
00095    //  The current style is pointed by gStyle.
00096    //  When calling myStyle->cd(), gStyle is set to myStyle.
00097    //  One can also use gROOT to change the current style, e.g.
00098    //    gROOT->SetStyle("Plain") will change the current style gStyle to the
00099    //    "Plain" style
00100    //  See also TROOT::ForceStyle and TROOT::UseCurrentStyle
00101 
00102    // If another style was already created with the same name, it is overwrite.
00103    delete gROOT->GetStyle(name);
00104 
00105    Reset();
00106 
00107    {
00108       R__LOCKGUARD2(gROOTMutex);
00109       gROOT->GetListOfStyles()->Add(this);
00110    }
00111 
00112    //may be a standard style to be initialized
00113    if (strcmp(name,"Plain") == 0) {
00114       SetFrameBorderMode(0);
00115       SetFrameFillColor(0);
00116       SetCanvasBorderMode(0);
00117       SetPadBorderMode(0);
00118       SetPadColor(0);
00119       SetCanvasColor(0);
00120       SetTitleFillColor(0);
00121       SetTitleBorderSize(1);
00122       SetStatColor(0);
00123       SetStatBorderSize(1);
00124       SetLegendBorderSize(1);
00125       return;
00126    }
00127    if (strcmp(name,"Bold") == 0) {
00128    // Authors: Art Poskanzer and Jim Thomas, LBNL, Oct. 2000
00129       SetPalette(1,0);
00130       SetCanvasColor(10);
00131       SetCanvasBorderMode(0);
00132       SetFrameLineWidth(3);
00133       SetFrameFillColor(10);
00134       SetPadColor(10);
00135       SetPadTickX(1);
00136       SetPadTickY(1);
00137       SetPadBottomMargin(0.15);
00138       SetPadLeftMargin(0.15);
00139       SetHistLineWidth(3);
00140       SetHistLineColor(kRed);
00141       SetFuncWidth(3);
00142       SetFuncColor(kGreen);
00143       SetLineWidth(3);
00144       SetLabelSize(0.05,"xyz");
00145       SetLabelOffset(0.01,"y");
00146       SetLabelColor(kBlue,"xy");
00147       SetTitleSize(0.06,"xyz");
00148       SetTitleOffset(1.3,"Y");
00149       SetTitleFillColor(10);
00150       SetTitleTextColor(kBlue);
00151       SetStatColor(10);
00152       return;
00153    }
00154    if (strcmp(name,"Video") == 0) {
00155      // Author: Art Poskanzer, LBNL, Oct. 1999
00156       SetPalette(1,0);
00157       SetCanvasColor(10);
00158       SetCanvasBorderMode(0);
00159       SetFrameLineWidth(3);
00160       SetFrameFillColor(10);
00161       SetPadColor(10);
00162       SetPadTickX(1);
00163       SetPadTickY(1);
00164       SetPadBottomMargin(0.2);
00165       SetPadLeftMargin(0.2);
00166       SetHistLineWidth(8);
00167       SetHistLineColor(kRed);
00168       SetLabelSize(0.06,"xyz");
00169       SetLabelColor(kBlue,"xyz");
00170       SetTitleSize(0.08,"xyz");
00171       SetTitleFillColor(10);
00172       SetTitleTextColor(kBlue);
00173       SetStatColor(10);
00174       SetFuncWidth(8);
00175       SetFuncColor(kGreen);
00176       SetLineWidth(3);
00177       return;
00178    }
00179    if (strcmp(name,"Pub") == 0) {
00180    // Authors: Art Poskanzer and Jim Thomas, LBNL, Oct. 2000
00181       SetOptTitle(0);
00182       SetOptStat(0);
00183       SetPalette(8,0);
00184       SetCanvasColor(10);
00185       SetCanvasBorderMode(0);
00186       SetFrameLineWidth(3);
00187       SetFrameFillColor(10);
00188       SetPadColor(10);
00189       SetPadTickX(1);
00190       SetPadTickY(1);
00191       SetPadBottomMargin(0.15);
00192       SetPadLeftMargin(0.15);
00193       SetHistLineWidth(3);
00194       SetHistLineColor(kRed);
00195       SetFuncWidth(3);
00196       SetFuncColor(kGreen);
00197       SetLineWidth(3);
00198       SetLabelSize(0.05,"xyz");
00199       SetLabelOffset(0.01,"y");
00200       SetLabelColor(kBlack,"xyz");
00201       SetTitleSize(0.06,"xyz");
00202       SetTitleOffset(1.3,"y");
00203       SetTitleFillColor(10);
00204       SetTitleTextColor(kBlue);
00205       return;
00206    }
00207 
00208 }
00209 
00210 
00211 //______________________________________________________________________________
00212 TStyle::~TStyle()
00213 {
00214    // Destructor.
00215 
00216    R__LOCKGUARD2(gROOTMutex);
00217    gROOT->GetListOfStyles()->Remove(this);
00218    if (gStyle == this) gStyle = (TStyle*)gROOT->GetListOfStyles()->Last();
00219 }
00220 
00221 
00222 //______________________________________________________________________________
00223 TStyle::TStyle(const TStyle &style) : TNamed(style), TAttLine(style), TAttFill(style), TAttMarker(style), TAttText(style)
00224 {
00225    // Copy constructor.
00226 
00227    ((TStyle&)style).Copy(*this);
00228 }
00229 
00230 
00231 //______________________________________________________________________________
00232 void TStyle::Browse(TBrowser *)
00233 {
00234    // Browse the style object.
00235 
00236    cd();
00237 }
00238 
00239 
00240 //______________________________________________________________________________
00241 void TStyle::BuildStyles()
00242 {
00243    // Create some standard styles.
00244 
00245    TColor *col = new TColor(); // force the initialisation of fgPalette
00246    new TStyle("Plain",  "Plain Style (no colors/fill areas)");
00247    new TStyle("Bold",   "Bold Style");;
00248    new TStyle("Video",  "Style for video presentation histograms");
00249    new TStyle("Pub",    "Style for Publications");
00250    new TStyle("Default","Default Style");
00251    delete col;
00252 }
00253 
00254 
00255 //______________________________________________________________________________
00256 void TStyle::cd()
00257 {
00258    // Change current style.
00259 
00260    gStyle = this;
00261 }
00262 
00263 
00264 //______________________________________________________________________________
00265 void TStyle::Copy(TObject &obj) const
00266 {
00267    // Copy this style.
00268 
00269    TAttLine::Copy(((TStyle&)obj));
00270    TAttFill::Copy(((TStyle&)obj));
00271    TAttMarker::Copy(((TStyle&)obj));
00272    TAttText::Copy(((TStyle&)obj));
00273    fXaxis.Copy(((TStyle&)obj).fXaxis);
00274    fYaxis.Copy(((TStyle&)obj).fYaxis);
00275    fZaxis.Copy(((TStyle&)obj).fZaxis);
00276    fAttDate.Copy(((TStyle&)obj).fAttDate);
00277    ((TStyle&)obj).fIsReading      = fIsReading;
00278    ((TStyle&)obj).fScreenFactor   = fScreenFactor;
00279    ((TStyle&)obj).fCanvasPreferGL = fCanvasPreferGL;
00280    ((TStyle&)obj).fCanvasColor    = fCanvasColor;
00281    ((TStyle&)obj).fCanvasBorderSize= fCanvasBorderSize;
00282    ((TStyle&)obj).fCanvasBorderMode= fCanvasBorderMode;
00283    ((TStyle&)obj).fCanvasDefH     = fCanvasDefH;
00284    ((TStyle&)obj).fCanvasDefW     = fCanvasDefW;
00285    ((TStyle&)obj).fCanvasDefX     = fCanvasDefX;
00286    ((TStyle&)obj).fCanvasDefY     = fCanvasDefY;
00287    ((TStyle&)obj).fPadColor       = fPadColor;
00288    ((TStyle&)obj).fPadBorderSize  = fPadBorderSize;
00289    ((TStyle&)obj).fPadBorderMode  = fPadBorderMode;
00290    ((TStyle&)obj).fPadBottomMargin= fPadBottomMargin;
00291    ((TStyle&)obj).fPadTopMargin   = fPadTopMargin;
00292    ((TStyle&)obj).fPadLeftMargin  = fPadLeftMargin;
00293    ((TStyle&)obj).fPadRightMargin = fPadRightMargin;
00294    ((TStyle&)obj).fPadGridX       = fPadGridX;
00295    ((TStyle&)obj).fPadGridY       = fPadGridY;
00296    ((TStyle&)obj).fPadTickX       = fPadTickX;
00297    ((TStyle&)obj).fPadTickY       = fPadTickY;
00298    ((TStyle&)obj).fPaperSizeX     = fPaperSizeX;
00299    ((TStyle&)obj).fPaperSizeY     = fPaperSizeY;
00300    ((TStyle&)obj).fFuncColor      = fFuncColor;
00301    ((TStyle&)obj).fFuncStyle      = fFuncStyle;
00302    ((TStyle&)obj).fFuncWidth      = fFuncWidth;
00303    ((TStyle&)obj).fGridColor      = fGridColor;
00304    ((TStyle&)obj).fGridStyle      = fGridStyle;
00305    ((TStyle&)obj).fGridWidth      = fGridWidth;
00306    ((TStyle&)obj).fHatchesSpacing = fHatchesSpacing;
00307    ((TStyle&)obj).fHatchesLineWidth= fHatchesLineWidth;
00308    ((TStyle&)obj).fFrameFillColor = fFrameFillColor;
00309    ((TStyle&)obj).fFrameFillStyle = fFrameFillStyle;
00310    ((TStyle&)obj).fFrameLineColor = fFrameLineColor;
00311    ((TStyle&)obj).fFrameLineStyle = fFrameLineStyle;
00312    ((TStyle&)obj).fFrameLineWidth = fFrameLineWidth;
00313    ((TStyle&)obj).fFrameBorderSize= fFrameBorderSize;
00314    ((TStyle&)obj).fFrameBorderMode= fFrameBorderMode;
00315    ((TStyle&)obj).fHistFillColor  = fHistFillColor;
00316    ((TStyle&)obj).fHistFillStyle  = fHistFillStyle;
00317    ((TStyle&)obj).fHistLineColor  = fHistLineColor;
00318    ((TStyle&)obj).fHistLineStyle  = fHistLineStyle;
00319    ((TStyle&)obj).fHistLineWidth  = fHistLineWidth;
00320    ((TStyle&)obj).fHistMinimumZero= fHistMinimumZero;
00321    ((TStyle&)obj).fHistTopMargin  = fHistTopMargin;
00322    ((TStyle&)obj).fBarWidth       = fBarWidth;
00323    ((TStyle&)obj).fBarOffset      = fBarOffset;
00324    ((TStyle&)obj).fDrawBorder     = fDrawBorder;
00325    ((TStyle&)obj).fOptLogx        = fOptLogx;
00326    ((TStyle&)obj).fOptLogy        = fOptLogy;
00327    ((TStyle&)obj).fOptLogz        = fOptLogz;
00328    ((TStyle&)obj).fOptDate        = fOptDate;
00329    ((TStyle&)obj).fOptFit         = fOptFit;
00330    ((TStyle&)obj).fOptStat        = fOptStat;
00331    ((TStyle&)obj).fOptTitle       = fOptTitle;
00332    ((TStyle&)obj).fEndErrorSize   = fEndErrorSize;
00333    ((TStyle&)obj).fErrorX         = fErrorX;
00334    ((TStyle&)obj).fStatColor      = fStatColor;
00335    ((TStyle&)obj).fStatTextColor  = fStatTextColor;
00336    ((TStyle&)obj).fStatBorderSize = fStatBorderSize;
00337    ((TStyle&)obj).fStatFont       = fStatFont;
00338    ((TStyle&)obj).fStatFontSize   = fStatFontSize;
00339    ((TStyle&)obj).fStatStyle      = fStatStyle;
00340    ((TStyle&)obj).fStatFormat     = fStatFormat;
00341    ((TStyle&)obj).fStatW          = fStatW;
00342    ((TStyle&)obj).fStatH          = fStatH ;
00343    ((TStyle&)obj).fStatX          = fStatX;
00344    ((TStyle&)obj).fStatY          = fStatY;
00345    ((TStyle&)obj).fTitleAlign     = fTitleAlign;
00346    ((TStyle&)obj).fTitleColor     = fTitleColor;
00347    ((TStyle&)obj).fTitleTextColor = fTitleTextColor;
00348    ((TStyle&)obj).fTitleFont      = fTitleFont;
00349    ((TStyle&)obj).fTitleFontSize  = fTitleFontSize;
00350    ((TStyle&)obj).fTitleStyle     = fTitleStyle;
00351    ((TStyle&)obj).fTitleBorderSize= fTitleBorderSize;
00352    ((TStyle&)obj).fTitleW         = fTitleW;
00353    ((TStyle&)obj).fTitleH         = fTitleH;
00354    ((TStyle&)obj).fTitleX         = fTitleX;
00355    ((TStyle&)obj).fTitleY         = fTitleY;
00356    ((TStyle&)obj).fDateX          = fDateX;
00357    ((TStyle&)obj).fDateY          = fDateY;
00358    ((TStyle&)obj).fFitFormat      = fFitFormat;
00359    ((TStyle&)obj).fPaintTextFormat= fPaintTextFormat;
00360    ((TStyle&)obj).fShowEventStatus= fShowEventStatus;
00361    ((TStyle&)obj).fShowEditor     = fShowEditor;
00362    ((TStyle&)obj).fShowToolBar    = fShowToolBar;
00363    ((TStyle&)obj).fLegoInnerR     = fLegoInnerR;
00364    ((TStyle&)obj).fStripDecimals  = fStripDecimals;
00365    ((TStyle&)obj).fNumberContours = fNumberContours;
00366    ((TStyle&)obj).fLegendBorderSize = fLegendBorderSize;
00367    Int_t i;
00368    for (i=0;i<30;i++) {
00369       ((TStyle&)obj).fLineStyle[i]     = fLineStyle[i];
00370    }
00371    ((TStyle&)obj).fHeaderPS       = fHeaderPS;
00372    ((TStyle&)obj).fTitlePS        = fTitlePS;
00373    ((TStyle&)obj).fLineScalePS    = fLineScalePS;
00374    ((TStyle&)obj).fColorModelPS   = fColorModelPS;
00375    ((TStyle&)obj).fTimeOffset     = fTimeOffset;
00376 }
00377 
00378 
00379 //______________________________________________________________________________
00380 Int_t TStyle::DistancetoPrimitive(Int_t /*px*/, Int_t /*py*/)
00381 {
00382    // Function used by the TStyle manager when drawing a canvas showing the
00383    // current style.
00384 
00385    gPad->SetSelected(this);
00386    return 0;
00387 }
00388 
00389 
00390 //______________________________________________________________________________
00391 void TStyle::Reset(Option_t *opt)
00392 {
00393    // Reset.
00394 
00395    fIsReading = kTRUE;
00396    TAttLine::ResetAttLine();
00397    TAttFill::ResetAttFill();
00398    TAttText::ResetAttText();
00399    TAttMarker::ResetAttMarker();
00400    SetFillStyle(1001);
00401    SetFillColor(19);
00402    fXaxis.ResetAttAxis("X");
00403    fYaxis.ResetAttAxis("Y");
00404    fZaxis.ResetAttAxis("Z");
00405    fCanvasPreferGL = kFALSE;
00406    fCanvasColor    = 19;
00407    fCanvasBorderSize= 2;
00408    fCanvasBorderMode= 1;
00409    fCanvasDefH     = 500;
00410    fCanvasDefW     = 700;
00411    fCanvasDefX     = 10;
00412    fCanvasDefY     = 10;
00413    fPadColor       = fCanvasColor;
00414    fPadBorderSize  = fCanvasBorderSize;
00415    fPadBorderMode  = fCanvasBorderMode;
00416    fPadBottomMargin= 0.1;
00417    fPadTopMargin   = 0.1;
00418    fPadLeftMargin  = 0.1;
00419    fPadRightMargin = 0.1;
00420    fPadGridX       = kFALSE;
00421    fPadGridY       = kFALSE;
00422    fPadTickX       = 0;
00423    fPadTickY       = 0;
00424    fFuncColor      = 1;
00425    fFuncStyle      = 1;
00426    fFuncWidth      = 3;
00427    fGridColor      = 0;
00428    fGridStyle      = 3;
00429    fGridWidth      = 1;
00430    fHatchesSpacing = 1;
00431    fHatchesLineWidth = 1;
00432    fHistLineColor  = 1;
00433    fHistFillColor  = 0;
00434    fHistFillStyle  = 1001;
00435    fHistLineStyle  = 1;
00436    fHistLineWidth  = 1;
00437    fHistMinimumZero= kFALSE;
00438    fHistTopMargin  = 0.05;
00439    fFrameLineColor = 1;
00440    fFrameFillColor = 0;
00441    fFrameFillStyle = 1001;
00442    fFrameLineStyle = 1;
00443    fFrameLineWidth = 1;
00444    fFrameBorderSize= 1;
00445    fFrameBorderMode= 1;
00446    fBarWidth       = 1;
00447    fBarOffset      = 0;
00448    fDrawBorder     = 0;
00449    fOptLogx        = 0;
00450    fOptLogy        = 0;
00451    fOptLogz        = 0;
00452    fOptDate        = 0;
00453    fOptFile        = 0;
00454    fOptFit         = 0;
00455    fOptStat        = 1;
00456    fOptTitle       = 1;
00457    fEndErrorSize   = 2;
00458    fErrorX         = 0.5;
00459    fScreenFactor   = 1;
00460    fStatColor      = fCanvasColor;
00461    fStatTextColor  = 1;
00462    fStatBorderSize = 2;
00463    fStatFont       = 62;
00464    fStatFontSize   = 0;
00465    fStatStyle      = 1001;
00466    fStatW          = 0.20;
00467    fStatH          = 0.16;
00468    fStatX          = 0.98;
00469    fStatY          = 0.995;
00470    SetStatFormat();
00471    SetFitFormat();
00472    SetPaintTextFormat();
00473    fTitleAlign     = 13;
00474    fTitleColor     = fCanvasColor;
00475    fTitleTextColor = 1;
00476    fTitleFont      = 62;
00477    fTitleFontSize  = 0;
00478    fTitleStyle     = 1001;
00479    fTitleBorderSize= 2;
00480    fTitleW         = 0;
00481    fTitleH         = 0;
00482    fTitleX         = 0.01;
00483    fTitleY         = 0.995;
00484    fShowEventStatus= 0;
00485    fShowEditor     = 0;
00486    fShowToolBar    = 0;
00487    fLegoInnerR     = 0.5;
00488    fHeaderPS       = "";
00489    fTitlePS        = "";
00490    fStripDecimals  = kTRUE;
00491    fNumberContours = 20;
00492    fLegendBorderSize= 4;
00493 
00494    SetDateX();
00495    SetDateY();
00496    fAttDate.SetTextSize(0.025);
00497    fAttDate.SetTextAlign(11);
00498    SetLineScalePS();
00499    SetColorModelPS();
00500    SetLineStyleString(1," ");
00501    SetLineStyleString(2,"12 12");
00502    SetLineStyleString(3,"4 8");
00503    SetLineStyleString(4,"12 16 4 16");
00504    SetLineStyleString(5,"20 12 4 12");
00505    SetLineStyleString(6,"20 12 4 12 4 12 4 12");
00506    SetLineStyleString(7,"20 20");
00507    SetLineStyleString(8,"20 12 4 12 4 12");
00508    SetLineStyleString(9,"80 20");
00509    SetLineStyleString(10,"80 40 4 40");
00510    for (Int_t i=11;i<30;i++) SetLineStyleString(i," ");
00511 
00512    SetPaperSize();
00513 
00514    SetPalette();
00515 
00516    fTimeOffset = 788918400; // UTC time at 01/01/95
00517 
00518    if (strcmp(opt,"Plain") == 0) {
00519       SetFrameBorderMode(0);
00520       SetCanvasBorderMode(0);
00521       SetPadBorderMode(0);
00522       SetPadColor(0);
00523       SetCanvasColor(0);
00524       SetTitleFillColor(0);
00525       SetTitleBorderSize(1);
00526       SetStatColor(0);
00527       SetStatBorderSize(1);
00528       SetLegendBorderSize(1);
00529       return;
00530    }
00531    if (strcmp(opt,"Bold") == 0) {
00532       SetPalette(1,0);
00533       SetCanvasColor(10);
00534       SetCanvasBorderMode(0);
00535       SetFrameLineWidth(3);
00536       SetFrameFillColor(10);
00537       SetPadColor(10);
00538       SetPadTickX(1);
00539       SetPadTickY(1);
00540       SetPadBottomMargin(0.15);
00541       SetPadLeftMargin(0.15);
00542       SetHistLineWidth(3);
00543       SetHistLineColor(kRed);
00544       SetFuncWidth(3);
00545       SetFuncColor(kGreen);
00546       SetLineWidth(3);
00547       SetLabelSize(0.05,"xyz");
00548       SetLabelOffset(0.01,"y");
00549       SetLabelColor(kBlue,"xy");
00550       SetTitleSize(0.06,"xyz");
00551       SetTitleOffset(1.3,"Y");
00552       SetTitleFillColor(10);
00553       SetTitleTextColor(kBlue);
00554       SetStatColor(10);
00555       return;
00556    }
00557    if (strcmp(opt,"Video") == 0) {
00558       SetPalette(1,0);
00559       SetCanvasColor(10);
00560       SetCanvasBorderMode(0);
00561       SetFrameLineWidth(3);
00562       SetFrameFillColor(10);
00563       SetPadColor(10);
00564       SetPadTickX(1);
00565       SetPadTickY(1);
00566       SetPadBottomMargin(0.2);
00567       SetPadLeftMargin(0.2);
00568       SetHistLineWidth(8);
00569       SetHistLineColor(kRed);
00570       SetLabelSize(0.06,"xyz");
00571       SetLabelColor(kBlue,"xyz");
00572       SetTitleSize(0.08,"xyz");
00573       SetTitleFillColor(10);
00574       SetTitleTextColor(kBlue);
00575       SetStatColor(10);
00576       SetFuncWidth(8);
00577       SetFuncColor(kGreen);
00578       SetLineWidth(3);
00579       return;
00580    }
00581    if (strcmp(opt,"Pub") == 0) {
00582       SetOptTitle(0);
00583       SetOptStat(0);
00584       SetPalette(8,0);
00585       SetCanvasColor(10);
00586       SetCanvasBorderMode(0);
00587       SetFrameLineWidth(3);
00588       SetFrameFillColor(10);
00589       SetPadColor(10);
00590       SetPadTickX(1);
00591       SetPadTickY(1);
00592       SetPadBottomMargin(0.15);
00593       SetPadLeftMargin(0.15);
00594       SetHistLineWidth(3);
00595       SetHistLineColor(kRed);
00596       SetFuncWidth(3);
00597       SetFuncColor(kGreen);
00598       SetLineWidth(3);
00599       SetLabelSize(0.05,"xyz");
00600       SetLabelOffset(0.01,"y");
00601       SetLabelColor(kBlack,"xyz");
00602       SetTitleSize(0.06,"xyz");
00603       SetTitleOffset(1.3,"y");
00604       SetTitleFillColor(10);
00605       SetTitleTextColor(kBlue);
00606       return;
00607    }
00608 }
00609 
00610 
00611 //______________________________________________________________________________
00612 Int_t TStyle::AxisChoice( Option_t *axis) const
00613 {
00614    // Return axis number.
00615 
00616    char achoice = toupper(axis[0]);
00617    if (achoice == 'X') return 1;
00618    if (achoice == 'Y') return 2;
00619    if (achoice == 'Z') return 3;
00620    return 0;
00621 }
00622 
00623 
00624 //______________________________________________________________________________
00625 Int_t TStyle::GetNdivisions( Option_t *axis) const
00626 {
00627    // Return number of divisions.
00628 
00629    Int_t ax = AxisChoice(axis);
00630    if (ax == 1) return fXaxis.GetNdivisions();
00631    if (ax == 2) return fYaxis.GetNdivisions();
00632    if (ax == 3) return fZaxis.GetNdivisions();
00633    return 0;
00634 }
00635 
00636 
00637 //______________________________________________________________________________
00638 Color_t TStyle::GetAxisColor( Option_t *axis) const
00639 {
00640    // Return the axis color number in the axis.
00641 
00642    Int_t ax = AxisChoice(axis);
00643    if (ax == 1) return fXaxis.GetAxisColor();
00644    if (ax == 2) return fYaxis.GetAxisColor();
00645    if (ax == 3) return fZaxis.GetAxisColor();
00646    return 0;
00647 }
00648 
00649 
00650 //______________________________________________________________________________
00651 Int_t TStyle::GetColorPalette(Int_t i) const
00652 {
00653    // Return color number i in current palette.
00654 
00655    return TColor::GetColorPalette(i);
00656 }
00657 
00658 
00659 //______________________________________________________________________________
00660 Color_t TStyle::GetLabelColor( Option_t *axis) const
00661 {
00662    // Return the label color number in the axis.
00663 
00664    Int_t ax = AxisChoice(axis);
00665    if (ax == 1) return fXaxis.GetLabelColor();
00666    if (ax == 2) return fYaxis.GetLabelColor();
00667    if (ax == 3) return fZaxis.GetLabelColor();
00668    return 0;
00669 }
00670 
00671 
00672 //______________________________________________________________________________
00673 Style_t TStyle::GetLabelFont( Option_t *axis) const
00674 {
00675    // Return label font.
00676 
00677    Int_t ax = AxisChoice(axis);
00678    if (ax == 1) return fXaxis.GetLabelFont();
00679    if (ax == 2) return fYaxis.GetLabelFont();
00680    if (ax == 3) return fZaxis.GetLabelFont();
00681    return 0;
00682 }
00683 
00684 
00685 //______________________________________________________________________________
00686 Float_t TStyle::GetLabelOffset( Option_t *axis) const
00687 {
00688    // Return label offset.
00689 
00690    Int_t ax = AxisChoice(axis);
00691    if (ax == 1) return fXaxis.GetLabelOffset();
00692    if (ax == 2) return fYaxis.GetLabelOffset();
00693    if (ax == 3) return fZaxis.GetLabelOffset();
00694    return 0;
00695 }
00696 
00697 
00698 //______________________________________________________________________________
00699 Float_t TStyle::GetLabelSize( Option_t *axis) const
00700 {
00701    // Return label size.
00702 
00703    Int_t ax = AxisChoice(axis);
00704    if (ax == 1) return fXaxis.GetLabelSize();
00705    if (ax == 2) return fYaxis.GetLabelSize();
00706    if (ax == 3) return fZaxis.GetLabelSize();
00707    return 0;
00708 }
00709 
00710 
00711 //______________________________________________________________________________
00712 const char *TStyle::GetLineStyleString(Int_t i) const
00713 {
00714    // Return line style string (used by PostScript).
00715    // See SetLineStyleString for more explanations
00716 
00717    if (i < 1 || i > 29) return fLineStyle[0].Data();
00718    return fLineStyle[i].Data();
00719 }
00720 
00721 
00722 //______________________________________________________________________________
00723 Int_t TStyle::GetNumberOfColors() const
00724 {
00725    // Return number of colors in the color palette.
00726 
00727    return TColor::GetNumberOfColors();
00728 }
00729 
00730 
00731 //______________________________________________________________________________
00732 void TStyle::GetPaperSize(Float_t &xsize, Float_t &ysize) const
00733 {
00734    // Set paper size for PostScript output.
00735 
00736    xsize = fPaperSizeX;
00737    ysize = fPaperSizeY;
00738 }
00739 
00740 
00741 //______________________________________________________________________________
00742 Float_t TStyle::GetTickLength( Option_t *axis) const
00743 {
00744    // Return tick length.
00745 
00746    Int_t ax = AxisChoice(axis);
00747    if (ax == 1) return fXaxis.GetTickLength();
00748    if (ax == 2) return fYaxis.GetTickLength();
00749    if (ax == 3) return fZaxis.GetTickLength();
00750    return 0;
00751 }
00752 
00753 
00754 //______________________________________________________________________________
00755 Color_t TStyle::GetTitleColor( Option_t *axis) const
00756 {
00757    // Return title color.
00758 
00759    Int_t ax = AxisChoice(axis);
00760    if (ax == 1) return fXaxis.GetTitleColor();
00761    if (ax == 2) return fYaxis.GetTitleColor();
00762    if (ax == 3) return fZaxis.GetTitleColor();
00763    return fTitleTextColor;
00764 }
00765 
00766 
00767 //______________________________________________________________________________
00768 Style_t TStyle::GetTitleFont( Option_t *axis) const
00769 {
00770    // Return title font.
00771 
00772    Int_t ax = AxisChoice(axis);
00773    if (ax == 1) return fXaxis.GetTitleFont();
00774    if (ax == 2) return fYaxis.GetTitleFont();
00775    if (ax == 3) return fZaxis.GetTitleFont();
00776    return fTitleFont;
00777 }
00778 
00779 
00780 //______________________________________________________________________________
00781 Float_t TStyle::GetTitleOffset( Option_t *axis) const
00782 {
00783    // Return title offset.
00784 
00785    Int_t ax = AxisChoice(axis);
00786    if (ax == 1) return fXaxis.GetTitleOffset();
00787    if (ax == 2) return fYaxis.GetTitleOffset();
00788    if (ax == 3) return fZaxis.GetTitleOffset();
00789    return 0;
00790 }
00791 
00792 
00793 //______________________________________________________________________________
00794 Float_t TStyle::GetTitleSize( Option_t *axis) const
00795 {
00796    // Return title size.
00797 
00798    Int_t ax = AxisChoice(axis);
00799    if (ax == 1) return fXaxis.GetTitleSize();
00800    if (ax == 2) return fYaxis.GetTitleSize();
00801    if (ax == 3) return fZaxis.GetTitleSize();
00802    return fTitleFontSize;
00803 }
00804 
00805 
00806 //______________________________________________________________________________
00807 void TStyle::Paint(Option_t *option)
00808 {
00809    // Show the options from the current style
00810    // if (TClass::GetClass("TStyleManager")) gSystem->Load("libGed");
00811 
00812    gROOT->ProcessLine(Form("TStyleManager::PaintStyle((TStyle*)0x%lx,\"%s\")",
00813                            (ULong_t)this,option));
00814 }
00815 
00816 
00817 //______________________________________________________________________________
00818 void TStyle::SetColorModelPS(Int_t c)
00819 {
00820    // Define the color model used by TPostScript and TPDF (RGB or CMYK).
00821    // CMY and CMYK models are subtractive color models unlike RGB which is
00822    // additive. They are mainly used for printing purposes. CMY means Cyan Magenta
00823    // Yellow. To convert RGB to CMY it is enough to do: C=1-R, M=1-G and Y=1-B.
00824    // CMYK has one more component K (black). The conversion from RGB to CMYK is:
00825    //
00826    // Double_t Black   = TMath::Min(TMath::Min(1-Red,1-Green),1-Blue);
00827    // Double_t Cyan    = (1-Red-Black)/(1-Black);
00828    // Double_t Magenta = (1-Green-Black)/(1-Black);
00829    // Double_t Yellow  = (1-Blue-Black)/(1-Black);
00830    //
00831    // CMYK adds the black component which allows better quality for black
00832    // printing. PostScript and PDF support the CMYK model.
00833    //
00834    // c = 0 means TPostScript and TPDF will use RGB color model (default)
00835    // c = 1 means TPostScript and TPDF will use CMYK color model
00836 
00837    fColorModelPS = c;
00838 }
00839 
00840 
00841 //______________________________________________________________________________
00842 void TStyle::SetHistMinimumZero(Bool_t zero)
00843 {
00844    // If the argument zero=kTRUE the minimum value for the Y axis of 1-d histograms
00845    // is set to 0 if the minimum bin content is greater than 0 and TH1::SetMinimum
00846    // has not been called.
00847    // Otherwise the minimum is based on the minimum bin content.
00848 
00849    fHistMinimumZero = zero;
00850 }
00851 
00852 
00853 //______________________________________________________________________________
00854 void TStyle::SetNdivisions(Int_t n, Option_t *axis)
00855 {
00856    // Set the number of divisions to draw an axis.
00857    //  ndiv      : Number of divisions.
00858    //
00859    //       n = N1 + 100*N2 + 10000*N3
00860    //       N1=number of primary divisions.
00861    //       N2=number of secondary divisions.
00862    //       N3=number of 3rd divisions.
00863    //           e.g.:
00864    //           nndi=0 --> no tick marks.
00865    //           nndi=2 --> 2 divisions, one tick mark in the middle
00866    //                      of the axis.
00867    // axis specifies which axis ("x","y","z"), default = "x"
00868    // if axis="xyz" set all 3 axes
00869 
00870    TString opt = axis;
00871    opt.ToLower();
00872    if (opt.Contains("x")) fXaxis.SetNdivisions(n);
00873    if (opt.Contains("y")) fYaxis.SetNdivisions(n);
00874    if (opt.Contains("z")) fZaxis.SetNdivisions(n);
00875 }
00876 
00877 
00878 //______________________________________________________________________________
00879 void TStyle::SetAxisColor(Color_t color, Option_t *axis)
00880 {
00881    // Set color to draw the axis line and tick marks.
00882    // axis specifies which axis ("x","y","z"), default = "x"
00883    // if axis="xyz" set all 3 axes
00884 
00885    TString opt = axis;
00886    opt.ToLower();
00887 
00888    if (opt.Contains("x")) fXaxis.SetAxisColor(color);
00889    if (opt.Contains("y")) fYaxis.SetAxisColor(color);
00890    if (opt.Contains("z")) fZaxis.SetAxisColor(color);
00891 }
00892 
00893 
00894 //______________________________________________________________________________
00895 void TStyle::SetEndErrorSize(Float_t np)
00896 {
00897    // Set the size (in pixels) of the small lines drawn at the
00898    // end of the error bars (TH1 or TGraphErrors).
00899    // The default value is 2 pixels.
00900    // Set np=0 to remove these lines
00901 
00902    if (np >= 0) fEndErrorSize = np;
00903    else         fEndErrorSize = 0;
00904 }
00905 
00906 
00907 //______________________________________________________________________________
00908 void TStyle::SetHeaderPS(const char *header)
00909 {
00910    // Define a string to be inserted in the Postscript header
00911    // The string in header will be added to the Postscript file
00912    // immediatly following the %%Page line
00913    // For example, this string may contain special Postscript instructions like
00914    //      200 200 translate
00915    // the following header string will print the string "my annotation" at the
00916    // bottom left corner of the page (outside the user area)
00917    //  "gsave 100 -100 t 0 r 0 0 m /Helvetica-Bold findfont 56 sf 0 0 m ( my annotation ) show gr"
00918    // This information is used in TPostScript::Initialize
00919 
00920    fHeaderPS = header;
00921 }
00922 
00923 
00924 //______________________________________________________________________________
00925 void TStyle::SetIsReading(Bool_t reading)
00926 {
00927    // Sets the fIsReading member to reading (default=kTRUE)
00928    // fIsReading (used via gStyle->IsReading()) can be used in
00929    // the functions myclass::UseCurrentStyle to read from the current style
00930    // or write to the current style
00931 
00932    fIsReading = reading;
00933 }
00934 
00935 
00936 //______________________________________________________________________________
00937 void TStyle::SetTitlePS(const char *pstitle)
00938 {
00939    // Define a string to be used in the %%Title of the Postscript files.
00940    // If this string is not defined, ROOT will use the canvas title.
00941 
00942    fTitlePS = pstitle;
00943 }
00944 
00945 
00946 //______________________________________________________________________________
00947 void TStyle::SetLabelColor(Color_t color, Option_t *axis)
00948 {
00949    // Set axis labels color.
00950    // axis specifies which axis ("x","y","z"), default = "x"
00951    // if axis="xyz" set all 3 axes
00952 
00953    TString opt = axis;
00954    opt.ToLower();
00955 
00956    if (opt.Contains("x")) fXaxis.SetLabelColor(color);
00957    if (opt.Contains("y")) fYaxis.SetLabelColor(color);
00958    if (opt.Contains("z")) fZaxis.SetLabelColor(color);
00959 }
00960 
00961 
00962 //______________________________________________________________________________
00963 void TStyle::SetLabelFont(Style_t font, Option_t *axis)
00964 {
00965    // Set font number used to draw axis labels.
00966    //    font  : Text font code = 10*fontnumber + precision
00967    //             Font numbers must be between 1 and 14
00968    //             precision = 1 fast hardware fonts (steps in the size)
00969    //             precision = 2 scalable and rotatable hardware fonts
00970    // The default font number is 62.
00971    // axis specifies which axis ("x","y","z"), default = "x"
00972    // if axis="xyz" set all 3 axes
00973 
00974    TString opt = axis;
00975    opt.ToLower();
00976 
00977    if (opt.Contains("x")) fXaxis.SetLabelFont(font);
00978    if (opt.Contains("y")) fYaxis.SetLabelFont(font);
00979    if (opt.Contains("z")) fZaxis.SetLabelFont(font);
00980 }
00981 
00982 
00983 //______________________________________________________________________________
00984 void TStyle::SetLabelOffset(Float_t offset, Option_t *axis)
00985 {
00986    // Set offset between axis and axis labels.
00987    // The offset is expressed as a percent of the pad height.
00988    // axis specifies which axis ("x","y","z"), default = "x"
00989    // if axis="xyz" set all 3 axes
00990 
00991    TString opt = axis;
00992    opt.ToLower();
00993 
00994    if (opt.Contains("x")) fXaxis.SetLabelOffset(offset);
00995    if (opt.Contains("y")) fYaxis.SetLabelOffset(offset);
00996    if (opt.Contains("z")) fZaxis.SetLabelOffset(offset);
00997 }
00998 
00999 
01000 //______________________________________________________________________________
01001 void TStyle::SetLabelSize(Float_t size, Option_t *axis)
01002 {
01003    // Set size of axis labels. The size is expressed as a percent of the pad height.
01004    // axis specifies which axis ("x","y","z"), default = "x"
01005    // if axis="xyz" set all 3 axes
01006 
01007    TString opt = axis;
01008    opt.ToLower();
01009 
01010    if (opt.Contains("x")) fXaxis.SetLabelSize(size);
01011    if (opt.Contains("y")) fYaxis.SetLabelSize(size);
01012    if (opt.Contains("z")) fZaxis.SetLabelSize(size);
01013 }
01014 
01015 
01016 //______________________________________________________________________________
01017 void TStyle::SetLineStyleString(Int_t i, const char *text)
01018 {
01019    // Set line style string using the PostScript convention.
01020    // A line is a suite of segments, each segment is described by the number of
01021    // pixels. The initial and alternating elements (second, fourth, and so on)
01022    // are the dashes, and the others spaces between dashes.
01023    //
01024    // Default fixed line styles are pre-defined as:
01025    //
01026    //   linestyle 1  "[]"             solid
01027    //   linestyle 2  "[12 12]"        dashed
01028    //   linestyle 3  "[4 8]"          dotted
01029    //   linestyle 4  "[12 16 4 16]"   dash-dotted
01030    //
01031    //  For example the following lines define the line style 5 to 9.
01032    //
01033    //   gStyle->SetLineStyleString(5,"20 12 4 12");
01034    //   gStyle->SetLineStyleString(6,"20 12 4 12 4 12 4 12");
01035    //   gStyle->SetLineStyleString(7,"20 20");
01036    //   gStyle->SetLineStyleString(8,"20 12 4 12 4 12");
01037    //   gStyle->SetLineStyleString(9,"80 20");
01038    //
01039    //Begin_Html
01040    /*
01041    <img src="gif/userlinestyle.gif">
01042    */
01043    //End_Html
01044    //
01045    // Note:
01046    //  - Up to 30 different styles may be defined.
01047    //  - The opening and closing brackets may be omitted
01048    //  - It is recommended to use 4 as the smallest segment length and multiple of
01049    //    4 for other lengths.
01050    //  - The line style 1 to 10 are predefined. 1 to 4 cannot be changed.
01051 
01052    char *l;
01053    Int_t nch = strlen(text);
01054    char *st = new char[nch+10];
01055    snprintf(st,nch+10," ");
01056    strlcat(st,text,nch+10);
01057    l = strstr(st,"["); if (l) l[0] = ' ';
01058    l = strstr(st,"]"); if (l) l[0] = ' ';
01059    if (i >= 1 && i <= 29) fLineStyle[i] = st;
01060    delete [] st;
01061 }
01062 
01063 
01064 //______________________________________________________________________________
01065 void TStyle::SetNumberContours(Int_t number)
01066 {
01067    // Set the default number of contour levels when drawing 2-d plots.
01068 
01069    if (number > 0 && number < 1000) {
01070       fNumberContours = number;
01071       return;
01072    }
01073 
01074    Error("SetNumberContours","Illegal number of contours: %d, must be > 0 and < 1000",number);
01075 }
01076 
01077 
01078 //______________________________________________________________________________
01079 void TStyle::SetOptDate(Int_t optdate)
01080 {
01081    // If optdate is non null, the current date/time will be printed in the canvas.
01082    // The position of the date string can be controlled by:
01083    //  optdate = 10*format + mode
01084    //    mode = 1   (default) date is printed in the bottom/left corner.
01085    //    mode = 2   date is printed in the bottom/right corner.
01086    //    mode = 3   date is printed in the top/right corner.
01087    //    format = 0 (default) date has the format like: "Wed Sep 25 17:10:35 2002"
01088    //    format = 1 date has the format like: "2002-09-25"
01089    //    format = 2 date has the format like: "2002-09-25 17:10:35"
01090    //
01091    //  examples:
01092    //    optdate = 1  date like "Wed Sep 25 17:10:35 2002" in the bottom/left corner.
01093    //    optdate = 13 date like "2002-09-25" in the top/right corner.
01094    //
01095    //  The date position can also be controlled by:
01096    //    gStyle->SetDateX(x);  x in NDC
01097    //    gStyle->SetDateY(y);  y in NDC
01098    //
01099    //  The date text attributes can be changed with:
01100    //    gStyle->GetAttDate()->SetTextFont(font=62);
01101    //    gStyle->GetAttDate()->SetTextSize(size=0.025);
01102    //    gStyle->GetAttDate()->SetTextAngle(angle=0);
01103    //    gStyle->GetAttDate()->SetTextAlign(align=11);
01104    //    gStyle->GetAttDate()->SetTextColor(color=1);
01105    //
01106    //  The current date attributes can be obtained via:
01107    //    gStyle->GetAttDate()->GetTextxxxx();
01108    //
01109    //  When the date option is active, a text object is created when the pad
01110    //  paint its list of primitives. The text object is named "DATE".
01111    //  The DATE attributes can also be edited interactively (position
01112    //  and attributes) via the normal context menu.
01113 
01114    fOptDate = optdate;
01115    Int_t mode = optdate%10;
01116    if (mode == 1) {
01117       SetDateX(0.01);
01118       SetDateY(0.01);
01119       fAttDate.SetTextAlign(11);
01120    }
01121    if (mode == 2) {
01122       SetDateX(0.99);
01123       SetDateY(0.01);
01124       fAttDate.SetTextAlign(31);
01125    }
01126    if (mode == 3) {
01127       SetDateX(0.99);
01128       SetDateY(0.99);
01129       fAttDate.SetTextAlign(33);
01130    }
01131 }
01132 
01133 
01134 //______________________________________________________________________________
01135 void TStyle::SetOptFit(Int_t mode)
01136 {
01137    // The type of information about fit parameters printed in the histogram
01138    // statistics box can be selected via the parameter mode.
01139    //  The parameter mode can be = pcev  (default = 0111)
01140    //    p = 1;  print Probability
01141    //    c = 1;  print Chisquare/Number of degress of freedom
01142    //    e = 1;  print errors (if e=1, v must be 1)
01143    //    v = 1;  print name/values of parameters
01144    //  Example: gStyle->SetOptFit(1011);
01145    //           print fit probability, parameter names/values and errors.
01146    //    When "v"=1 is specified, only the non-fixed parameters are shown.
01147    //    When "v"=2 all parameters are shown.
01148    //
01149    //  Note: gStyle->SetOptFit(1) means "default value", so it is equivalent to
01150    //        gStyle->SetOptFit(111)
01151    //
01152    // see also SetOptStat below.
01153 
01154    fOptFit = mode;
01155    if (gPad) {
01156       TObject *obj;
01157       TIter next(gPad->GetListOfPrimitives());
01158       while ((obj = next())) {
01159          TObject *stats = obj->FindObject("stats");
01160          if (stats) stats->SetBit(kTakeStyle);
01161       }
01162       gPad->Modified(); gPad->Update();
01163    }
01164 }
01165 
01166 
01167 //______________________________________________________________________________
01168 void TStyle::SetOptStat(Int_t mode)
01169 {
01170    // The type of information printed in the histogram statistics box
01171    //  can be selected via the parameter mode.
01172    //  The parameter mode can be = ksiourmen  (default = 000001111)
01173    //    k = 1;  kurtosis printed
01174    //    k = 2;  kurtosis and kurtosis error printed
01175    //    s = 1;  skewness printed
01176    //    s = 2;  skewness and skewness error printed
01177    //    i = 1;  integral of bins printed
01178    //    o = 1;  number of overflows printed
01179    //    u = 1;  number of underflows printed
01180    //    r = 1;  rms printed
01181    //    r = 2;  rms and rms error printed
01182    //    m = 1;  mean value printed
01183    //    m = 2;  mean and mean error values printed
01184    //    e = 1;  number of entries printed
01185    //    n = 1;  name of histogram is printed
01186    //  Example: gStyle->SetOptStat(11);
01187    //           print only name of histogram and number of entries.
01188    //           gStyle->SetOptStat(1101);  displays the name of histogram, mean value and RMS.
01189    //  WARNING: never call SetOptStat(000111); but SetOptStat(1111), 0001111 will
01190    //          be taken as an octal number !!
01191    //  WARNING: SetOptStat(1) is taken as SetOptStat(1111) (for back compatibility
01192    //           with older versions. If you want to print only the name of the histogram
01193    //           call SetOptStat(1000000001).
01194    //  NOTE that in case of 2-D histograms, when selecting just underflow (10000)
01195    //        or overflow (100000), the stats box will show all combinations
01196    //        of underflow/overflows and not just one single number!
01197 
01198    fOptStat = mode;
01199    if (gPad) {
01200       TObject *obj;
01201       TIter next(gPad->GetListOfPrimitives());
01202       while ((obj = next())) {
01203          TObject *stats = obj->FindObject("stats");
01204          if (stats) stats->SetBit(kTakeStyle);
01205       }
01206       gPad->Modified(); gPad->Update();
01207    }
01208 }
01209 
01210 
01211 //______________________________________________________________________________
01212 void TStyle::SetOptStat(Option_t *stat)
01213 {
01214    //  The parameter mode can be any combination of kKsSiourRmMen
01215    //    k :  kurtosis printed
01216    //    K :  kurtosis and kurtosis error printed
01217    //    s :  skewness printed
01218    //    S :  skewness and skewness error printed
01219    //    i :  integral of bins printed
01220    //    o :  number of overflows printed
01221    //    u :  number of underflows printed
01222    //    r :  rms printed
01223    //    R :  rms and rms error printed
01224    //    m :  mean value printed
01225    //    M :  mean value mean error values printed
01226    //    e :  number of entries printed
01227    //    n :  name of histogram is printed
01228    //  Example: gStyle->SetOptStat("ne");
01229    //           print only name of histogram and number of entries.
01230    //  gStyle->SetOptStat("n") print only the name of the histogram
01231    //  gStyle->SetOptStat("nemr") is the default
01232 
01233    Int_t mode=0;
01234 
01235    TString opt = stat;
01236 
01237    if (opt.Contains("n")) mode+=1;
01238    if (opt.Contains("e")) mode+=10;
01239    if (opt.Contains("m")) mode+=100;
01240    if (opt.Contains("M")) mode+=200;
01241    if (opt.Contains("r")) mode+=1000;
01242    if (opt.Contains("R")) mode+=2000;
01243    if (opt.Contains("u")) mode+=10000;
01244    if (opt.Contains("o")) mode+=100000;
01245    if (opt.Contains("i")) mode+=1000000;
01246    if (opt.Contains("s")) mode+=10000000;
01247    if (opt.Contains("S")) mode+=20000000;
01248    if (opt.Contains("k")) mode+=100000000;
01249    if (opt.Contains("K")) mode+=200000000;
01250    if (mode == 1) mode = 1000000001;
01251 
01252    SetOptStat(mode);
01253 }
01254 
01255 
01256 //______________________________________________________________________________
01257 void TStyle::SetPaperSize(EPaperSize size)
01258 {
01259    // Set paper size for PostScript output.
01260 
01261    switch (size) {
01262       case kA4:
01263          SetPaperSize(20, 26);
01264          break;
01265       case kUSLetter:
01266          SetPaperSize(20, 24);
01267          break;
01268       default:
01269          Error("SetPaperSize", "illegal paper size %d\n", (int)size);
01270          break;
01271    }
01272 }
01273 
01274 
01275 //______________________________________________________________________________
01276 void TStyle::SetPaperSize(Float_t xsize, Float_t ysize)
01277 {
01278    // Set paper size for PostScript output.
01279    // The paper size is specified in centimeters. Default is 20x26.
01280    // See also TPad::Print
01281 
01282    fPaperSizeX = xsize;
01283    fPaperSizeY = ysize;
01284 }
01285 
01286 
01287 //______________________________________________________________________________
01288 void TStyle::SetTickLength(Float_t length, Option_t *axis)
01289 {
01290    // Set the tick marks length for an axis.
01291    // axis specifies which axis ("x","y","z"), default = "x"
01292    // if axis="xyz" set all 3 axes
01293 
01294    TString opt = axis;
01295    opt.ToLower();
01296 
01297    if (opt.Contains("x")) fXaxis.SetTickLength(length);
01298    if (opt.Contains("y")) fYaxis.SetTickLength(length);
01299    if (opt.Contains("z")) fZaxis.SetTickLength(length);
01300 }
01301 
01302 
01303 //______________________________________________________________________________
01304 void TStyle::SetTitleColor(Color_t color, Option_t *axis)
01305 {
01306    // if axis =="x"  set the X axis title color
01307    // if axis =="y"  set the Y axis title color
01308    // if axis =="z"  set the Z axis title color
01309    // any other value of axis will set the pad title color
01310    //
01311    // if axis="xyz" set all 3 axes
01312 
01313    TString opt = axis;
01314    opt.ToLower();
01315 
01316    Bool_t set = kFALSE;
01317    if (opt.Contains("x")) {fXaxis.SetTitleColor(color); set = kTRUE;}
01318    if (opt.Contains("y")) {fYaxis.SetTitleColor(color); set = kTRUE;}
01319    if (opt.Contains("z")) {fZaxis.SetTitleColor(color); set = kTRUE;}
01320    if (!set) fTitleColor = color;
01321 }
01322 
01323 
01324 //______________________________________________________________________________
01325 void TStyle::SetTitleFont(Style_t font, Option_t *axis)
01326 {
01327    // if axis =="x"  set the X axis title font
01328    // if axis =="y"  set the Y axis title font
01329    // if axis =="z"  set the Z axis title font
01330    // any other value of axis will set the pad title font
01331    //
01332    // if axis="xyz" set all 3 axes
01333 
01334    TString opt = axis;
01335    opt.ToLower();
01336 
01337    Bool_t set = kFALSE;
01338    if (opt.Contains("x")) {fXaxis.SetTitleFont(font); set = kTRUE;}
01339    if (opt.Contains("y")) {fYaxis.SetTitleFont(font); set = kTRUE;}
01340    if (opt.Contains("z")) {fZaxis.SetTitleFont(font); set = kTRUE;}
01341    if (!set) fTitleFont = font;
01342 }
01343 
01344 
01345 //______________________________________________________________________________
01346 void TStyle::SetTitleOffset(Float_t offset, Option_t *axis)
01347 {
01348    // Specify a parameter offset to control the distance between the axis
01349    // and the axis title.
01350    // offset = 1 means : use the default distance
01351    // offset = 1.2 means: the distance will be 1.2*(default distance)
01352    // offset = 0.8 means: the distance will be 0.8*(default distance)
01353    //
01354    // axis specifies which axis ("x","y","z"), default = "x"
01355    // if axis="xyz" set all 3 axes
01356 
01357    TString opt = axis;
01358    opt.ToLower();
01359 
01360    if (opt.Contains("x")) fXaxis.SetTitleOffset(offset);
01361    if (opt.Contains("y")) fYaxis.SetTitleOffset(offset);
01362    if (opt.Contains("z")) fZaxis.SetTitleOffset(offset);
01363 }
01364 
01365 
01366 //______________________________________________________________________________
01367 void TStyle::SetTitleSize(Float_t size, Option_t *axis)
01368 {
01369    // if axis =="x"  set the X axis title size
01370    // if axis =="y"  set the Y axis title size
01371    // if axis =="z"  set the Z axis title size
01372    // any other value of axis will set the pad title size
01373    //
01374    // if axis="xyz" set all 3 axes
01375 
01376    TString opt = axis;
01377    opt.ToLower();
01378 
01379    Bool_t set = kFALSE;
01380    if (opt.Contains("x")) {fXaxis.SetTitleSize(size); set = kTRUE;}
01381    if (opt.Contains("y")) {fYaxis.SetTitleSize(size); set = kTRUE;}
01382    if (opt.Contains("z")) {fZaxis.SetTitleSize(size); set = kTRUE;}
01383    if (!set) fTitleFontSize = size;
01384 }
01385 
01386 
01387 //______________________________________________________________________________
01388 void TStyle::SetPalette(Int_t ncolors, Int_t *colors)
01389 {
01390    // See TColor::SetPalette.
01391 
01392    TColor::SetPalette(ncolors,colors);
01393 }
01394 
01395 
01396 //______________________________________________________________________________
01397 void TStyle::SetTimeOffset(Double_t toffset)
01398 {
01399    // Change the time offset for time plotting.
01400    // Times are expressed in seconds. The corresponding numbers usually have 9
01401    // digits (or more if one takes into account fractions of seconds).
01402    // Thus, since it is very inconvenient to plot very large numbers on a scale,
01403    // one has to set an offset time that will be added to the axis begining,
01404    // in order to plot times correctly and conveniently. A convenient way to
01405    // set the time offset is to use TDatime::Convert().
01406    //
01407    // By default the time offset is set to 788918400 which corresponds to
01408    // 01/01/1995. This allows to have valid dates until 2072. The standard
01409    // UNIX time offset in 1970 allows only valid dates until 2030.
01410 
01411    fTimeOffset = toffset;
01412 }
01413 
01414 
01415 //______________________________________________________________________________
01416 void TStyle::SetStripDecimals(Bool_t strip)
01417 {
01418    //  Set option to strip decimals when drawing axis labels.
01419    //  By default, TGaxis::PaintAxis removes trailing 0s after a dot
01420    //  in the axis labels. Ex: {0,0.5,1,1.5,2,2.5, etc}
01421    //  If this function is called with strip=kFALSE, TGAxis::PaintAxis will
01422    //  draw labels with the same number of digits after the dot
01423    //  Ex: (0.0,0.5,1.0,1.5,2.0,2.5,etc}
01424 
01425    fStripDecimals = strip;
01426 }
01427 
01428 
01429 //______________________________________________________________________________
01430 void TStyle::SaveSource(const char *filename, Option_t *option)
01431 {
01432    // Save the current style in a C++ macro file.
01433 
01434    // Opens a file named filename or "Rootstyl.C"
01435    TString ff = strlen(filename) ? filename : "Rootstyl.C";
01436 
01437    // Computes the main method name.
01438    const char *fname = gSystem->BaseName(ff.Data());
01439    Int_t lenfname = strlen(fname);
01440    char *sname = new char[lenfname + 1];
01441    Int_t i = 0;
01442    while ((fname[i] != '.') && (i < lenfname)) {
01443       sname[i] = fname[i];
01444       i++;
01445    }
01446    if (i == lenfname) ff += ".C";
01447    sname[i] = 0;
01448 
01449    // Tries to open the file.
01450    ofstream out;
01451    out.open(ff.Data(), ios::out);
01452    if (!out.good()) {
01453       delete [] sname;
01454       Error("SaveSource", "cannot open file: %s", ff.Data());
01455       return;
01456    }
01457 
01458    // Writes macro header, date/time stamp as string, and the used Root version
01459    TDatime t;
01460    out <<"// Mainframe macro generated from application: " << gApplication->Argv(0) << endl;
01461    out <<"// By ROOT version " << gROOT->GetVersion() << " on " << t.AsSQLString() << endl;
01462    out << endl;
01463 
01464    char quote = '"';
01465 
01466    // Writes include.
01467    out << "#if !defined( __CINT__) || defined (__MAKECINT__)" << endl << endl;
01468    out << "#ifndef ROOT_TStyle" << endl;
01469    out << "#include " << quote << "TStyle.h" << quote << endl;
01470    out << "#endif" << endl;
01471    out << endl << "#endif" << endl;
01472 
01473    // Writes the macro entry point equal to the fname
01474    out << endl;
01475    out << "void " << sname << "()" << endl;
01476    out << "{" << endl;
01477    delete [] sname;
01478 
01479    TStyle::SavePrimitive(out, option);
01480 
01481    out << "}" << endl;
01482    out.close();
01483 
01484    printf(" C++ macro file %s has been generated\n", gSystem->BaseName(ff.Data()));
01485 }
01486 
01487 
01488 //______________________________________________________________________________
01489 void TStyle::SavePrimitive(ostream &out, Option_t * /*= ""*/)
01490 {
01491    // Save a main frame widget as a C++ statement(s) on output stream out.
01492 
01493    char quote = '"';
01494 
01495    out << "   // Add the saved style to the current ROOT session." << endl;
01496    out << endl;
01497    out<<"   "<<"delete gROOT->GetStyle("<<quote<<GetName()<<quote<<");"<< endl;
01498    out << endl;
01499    out<<"   "<<"TStyle *tmpStyle = new TStyle("
01500                            << quote << GetName()  << quote << ", "
01501                            << quote << GetTitle() << quote << ");" << endl;
01502 
01503    // fXAxis, fYAxis and fZAxis
01504    out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("x") <<", \"x\");"<<endl;
01505    out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("y") <<", \"y\");"<<endl;
01506    out<<"   "<<"tmpStyle->SetNdivisions(" <<GetNdivisions("z") <<", \"z\");"<<endl;
01507    out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("x")  <<", \"x\");"<<endl;
01508    out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("y")  <<", \"y\");"<<endl;
01509    out<<"   "<<"tmpStyle->SetAxisColor("  <<GetAxisColor("z")  <<", \"z\");"<<endl;
01510    out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("x") <<", \"x\");"<<endl;
01511    out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("y") <<", \"y\");"<<endl;
01512    out<<"   "<<"tmpStyle->SetLabelColor(" <<GetLabelColor("z") <<", \"z\");"<<endl;
01513    out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("x")  <<", \"x\");"<<endl;
01514    out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("y")  <<", \"y\");"<<endl;
01515    out<<"   "<<"tmpStyle->SetLabelFont("  <<GetLabelFont("z")  <<", \"z\");"<<endl;
01516    out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("x")<<", \"x\");"<<endl;
01517    out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("y")<<", \"y\");"<<endl;
01518    out<<"   "<<"tmpStyle->SetLabelOffset("<<GetLabelOffset("z")<<", \"z\");"<<endl;
01519    out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("x")  <<", \"x\");"<<endl;
01520    out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("y")  <<", \"y\");"<<endl;
01521    out<<"   "<<"tmpStyle->SetLabelSize("  <<GetLabelSize("z")  <<", \"z\");"<<endl;
01522    out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("x") <<", \"x\");"<<endl;
01523    out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("y") <<", \"y\");"<<endl;
01524    out<<"   "<<"tmpStyle->SetTickLength(" <<GetTickLength("z") <<", \"z\");"<<endl;
01525    out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("x")<<", \"x\");"<<endl;
01526    out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("y")<<", \"y\");"<<endl;
01527    out<<"   "<<"tmpStyle->SetTitleOffset("<<GetTitleOffset("z")<<", \"z\");"<<endl;
01528    out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("x")  <<", \"x\");"<<endl;
01529    out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("y")  <<", \"y\");"<<endl;
01530    out<<"   "<<"tmpStyle->SetTitleSize("  <<GetTitleSize("z")  <<", \"z\");"<<endl;
01531    out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("x") <<", \"x\");"<<endl;
01532    out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("y") <<", \"y\");"<<endl;
01533    out<<"   "<<"tmpStyle->SetTitleColor(" <<GetTitleColor("z") <<", \"z\");"<<endl;
01534    out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("x")  <<", \"x\");"<<endl;
01535    out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("y")  <<", \"y\");"<<endl;
01536    out<<"   "<<"tmpStyle->SetTitleFont("  <<GetTitleFont("z")  <<", \"z\");"<<endl;
01537 
01538    out<<"   "<<"tmpStyle->SetBarWidth("       <<GetBarWidth()       <<");"<<endl;
01539    out<<"   "<<"tmpStyle->SetBarOffset("      <<GetBarOffset()      <<");"<<endl;
01540    out<<"   "<<"tmpStyle->SetDrawBorder("     <<GetDrawBorder()     <<");"<<endl;
01541    out<<"   "<<"tmpStyle->SetOptLogx("        <<GetOptLogx()        <<");"<<endl;
01542    out<<"   "<<"tmpStyle->SetOptLogy("        <<GetOptLogy()        <<");"<<endl;
01543    out<<"   "<<"tmpStyle->SetOptLogz("        <<GetOptLogz()        <<");"<<endl;
01544    out<<"   "<<"tmpStyle->SetOptDate("        <<GetOptDate()        <<");"<<endl;
01545    out<<"   "<<"tmpStyle->SetOptStat("        <<GetOptStat()        <<");"<<endl;
01546 
01547    if (GetOptTitle()) out << "   tmpStyle->SetOptTitle(kTRUE);"  << endl;
01548    else               out << "   tmpStyle->SetOptTitle(kFALSE);" << endl;
01549    out<<"   "<<"tmpStyle->SetOptFit("         <<GetOptFit()         <<");"<<endl;
01550    out<<"   "<<"tmpStyle->SetNumberContours(" <<GetNumberContours() <<");"<<endl;
01551 
01552    // fAttDate
01553    out<<"   "<<"tmpStyle->GetAttDate()->SetTextFont(" <<GetAttDate()->GetTextFont() <<");"<<endl;
01554    out<<"   "<<"tmpStyle->GetAttDate()->SetTextSize(" <<GetAttDate()->GetTextSize() <<");"<<endl;
01555    out<<"   "<<"tmpStyle->GetAttDate()->SetTextAngle("<<GetAttDate()->GetTextAngle()<<");"<<endl;
01556    out<<"   "<<"tmpStyle->GetAttDate()->SetTextAlign("<<GetAttDate()->GetTextAlign()<<");"<<endl;
01557    out<<"   "<<"tmpStyle->GetAttDate()->SetTextColor("<<GetAttDate()->GetTextColor()<<");"<<endl;
01558 
01559    out<<"   "<<"tmpStyle->SetDateX("           <<GetDateX()           <<");"<<endl;
01560    out<<"   "<<"tmpStyle->SetDateY("           <<GetDateY()           <<");"<<endl;
01561    out<<"   "<<"tmpStyle->SetEndErrorSize("    <<GetEndErrorSize()    <<");"<<endl;
01562    out<<"   "<<"tmpStyle->SetErrorX("          <<GetErrorX()          <<");"<<endl;
01563    out<<"   "<<"tmpStyle->SetFuncColor("       <<GetFuncColor()       <<");"<<endl;
01564    out<<"   "<<"tmpStyle->SetFuncStyle("       <<GetFuncStyle()       <<");"<<endl;
01565    out<<"   "<<"tmpStyle->SetFuncWidth("       <<GetFuncWidth()       <<");"<<endl;
01566    out<<"   "<<"tmpStyle->SetGridColor("       <<GetGridColor()       <<");"<<endl;
01567    out<<"   "<<"tmpStyle->SetGridStyle("       <<GetGridStyle()       <<");"<<endl;
01568    out<<"   "<<"tmpStyle->SetGridWidth("       <<GetGridWidth()       <<");"<<endl;
01569    out<<"   "<<"tmpStyle->SetLegendBorderSize("<<GetLegendBorderSize()<<");"<<endl;
01570    out<<"   "<<"tmpStyle->SetHatchesLineWidth("<<GetHatchesLineWidth()<<");"<<endl;
01571    out<<"   "<<"tmpStyle->SetHatchesSpacing("  <<GetHatchesSpacing()  <<");"<<endl;
01572    out<<"   "<<"tmpStyle->SetFrameFillColor("  <<GetFrameFillColor()  <<");"<<endl;
01573    out<<"   "<<"tmpStyle->SetFrameLineColor("  <<GetFrameLineColor()  <<");"<<endl;
01574    out<<"   "<<"tmpStyle->SetFrameFillStyle("  <<GetFrameFillStyle()  <<");"<<endl;
01575    out<<"   "<<"tmpStyle->SetFrameLineStyle("  <<GetFrameLineStyle()  <<");"<<endl;
01576    out<<"   "<<"tmpStyle->SetFrameLineWidth("  <<GetFrameLineWidth()  <<");"<<endl;
01577    out<<"   "<<"tmpStyle->SetFrameBorderSize(" <<GetFrameBorderSize() <<");"<<endl;
01578    out<<"   "<<"tmpStyle->SetFrameBorderMode(" <<GetFrameBorderMode() <<");"<<endl;
01579    out<<"   "<<"tmpStyle->SetHistFillColor("   <<GetHistFillColor()   <<");"<<endl;
01580    out<<"   "<<"tmpStyle->SetHistLineColor("   <<GetHistLineColor()   <<");"<<endl;
01581    out<<"   "<<"tmpStyle->SetHistFillStyle("   <<GetHistFillStyle()   <<");"<<endl;
01582    out<<"   "<<"tmpStyle->SetHistLineStyle("   <<GetHistLineStyle()   <<");"<<endl;
01583    out<<"   "<<"tmpStyle->SetHistLineWidth("   <<GetHistLineWidth()   <<");"<<endl;
01584    if (GetHistMinimumZero()) out<<"   tmpStyle->SetHistMinimumZero(kTRUE);" <<endl;
01585    else                      out<<"   tmpStyle->SetHistMinimumZero(kFALSE);"<<endl;
01586    if (GetCanvasPreferGL()) out<<"   tmpStyle->SetCanvasPreferGL(kTRUE);" <<endl;
01587    else                     out<<"   tmpStyle->SetCanvasPreferGL(kFALSE);"<<endl;
01588    out<<"   "<<"tmpStyle->SetCanvasColor("     <<GetCanvasColor()     <<");"<<endl;
01589    out<<"   "<<"tmpStyle->SetCanvasBorderSize("<<GetCanvasBorderSize()<<");"<<endl;
01590    out<<"   "<<"tmpStyle->SetCanvasBorderMode("<<GetCanvasBorderMode()<<");"<<endl;
01591    out<<"   "<<"tmpStyle->SetCanvasDefH("      <<GetCanvasDefH()      <<");"<<endl;
01592    out<<"   "<<"tmpStyle->SetCanvasDefW("      <<GetCanvasDefW()      <<");"<<endl;
01593    out<<"   "<<"tmpStyle->SetCanvasDefX("      <<GetCanvasDefX()      <<");"<<endl;
01594    out<<"   "<<"tmpStyle->SetCanvasDefY("      <<GetCanvasDefY()      <<");"<<endl;
01595    out<<"   "<<"tmpStyle->SetPadColor("        <<GetPadColor()        <<");"<<endl;
01596    out<<"   "<<"tmpStyle->SetPadBorderSize("   <<GetPadBorderSize()   <<");"<<endl;
01597    out<<"   "<<"tmpStyle->SetPadBorderMode("   <<GetPadBorderMode()   <<");"<<endl;
01598    out<<"   "<<"tmpStyle->SetPadBottomMargin(" <<GetPadBottomMargin() <<");"<<endl;
01599    out<<"   "<<"tmpStyle->SetPadTopMargin("    <<GetPadTopMargin()    <<");"<<endl;
01600    out<<"   "<<"tmpStyle->SetPadLeftMargin("   <<GetPadLeftMargin()   <<");"<<endl;
01601    out<<"   "<<"tmpStyle->SetPadRightMargin("  <<GetPadRightMargin()  <<");"<<endl;
01602    if (GetPadGridX()) out<<"   tmpStyle->SetPadGridX(kTRUE);" <<endl;
01603    else               out<<"   tmpStyle->SetPadGridX(kFALSE);"<<endl;
01604    if (GetPadGridY()) out<<"   tmpStyle->SetPadGridY(kTRUE);" <<endl;
01605    else               out<<"   tmpStyle->SetPadGridY(kFALSE);"<<endl;
01606    out<<"   "<<"tmpStyle->SetPadTickX("        <<GetPadTickX()         <<");"<<endl;
01607    out<<"   "<<"tmpStyle->SetPadTickY("        <<GetPadTickY()         <<");"<<endl;
01608 
01609    // fPaperSizeX, fPaperSizeY
01610    out<<"   "<<"tmpStyle->SetPaperSize("       <<fPaperSizeX          <<", "
01611                                              <<fPaperSizeY          <<");"<<endl;
01612 
01613    out<<"   "<<"tmpStyle->SetScreenFactor("   <<GetScreenFactor()   <<");"<<endl;
01614    out<<"   "<<"tmpStyle->SetStatColor("      <<GetStatColor()      <<");"<<endl;
01615    out<<"   "<<"tmpStyle->SetStatTextColor("  <<GetStatTextColor()  <<");"<<endl;
01616    out<<"   "<<"tmpStyle->SetStatBorderSize(" <<GetStatBorderSize() <<");"<<endl;
01617    out<<"   "<<"tmpStyle->SetStatFont("       <<GetStatFont()       <<");"<<endl;
01618    out<<"   "<<"tmpStyle->SetStatFontSize("   <<GetStatFontSize()   <<");"<<endl;
01619    out<<"   "<<"tmpStyle->SetStatStyle("      <<GetStatStyle()      <<");"<<endl;
01620    out<<"   "<<"tmpStyle->SetStatFormat("     <<quote << GetStatFormat()
01621                                             <<quote               <<");"<<endl;
01622    out<<"   "<<"tmpStyle->SetStatX("          <<GetStatX()          <<");"<<endl;
01623    out<<"   "<<"tmpStyle->SetStatY("          <<GetStatY()          <<");"<<endl;
01624    out<<"   "<<"tmpStyle->SetStatW("          <<GetStatW()          <<");"<<endl;
01625    out<<"   "<<"tmpStyle->SetStatH("          <<GetStatH()          <<");"<<endl;
01626    if (GetStripDecimals()) out<<"   tmpStyle->SetStripDecimals(kTRUE);" <<endl;
01627    else                    out<<"   tmpStyle->SetStripDecimals(kFALSE);"<<endl;
01628    out<<"   "<<"tmpStyle->SetTitleAlign("     <<GetTitleAlign()     <<");"<<endl;
01629    out<<"   "<<"tmpStyle->SetTitleFillColor(" <<GetTitleFillColor() <<");"<<endl;
01630    out<<"   "<<"tmpStyle->SetTitleTextColor(" <<GetTitleTextColor() <<");"<<endl;
01631    out<<"   "<<"tmpStyle->SetTitleBorderSize("<<GetTitleBorderSize()<<");"<<endl;
01632    out<<"   "<<"tmpStyle->SetTitleFont("      <<GetTitleFont()      <<");"<<endl;
01633    out<<"   "<<"tmpStyle->SetTitleFontSize("  <<GetTitleFontSize()  <<");"<<endl;
01634    out<<"   "<<"tmpStyle->SetTitleStyle("     <<GetTitleStyle()     <<");"<<endl;
01635    out<<"   "<<"tmpStyle->SetTitleX("         <<GetTitleX()         <<");"<<endl;
01636    out<<"   "<<"tmpStyle->SetTitleY("         <<GetTitleY()         <<");"<<endl;
01637    out<<"   "<<"tmpStyle->SetTitleW("         <<GetTitleW()         <<");"<<endl;
01638    out<<"   "<<"tmpStyle->SetTitleH("         <<GetTitleH()         <<");"<<endl;
01639    out<<"   "<<"tmpStyle->SetLegoInnerR("     <<GetLegoInnerR()     <<");"<<endl;
01640    out<<endl;
01641 
01642    // fPalette
01643    out<<"   "<<"Int_t fPaletteColor["       <<GetNumberOfColors() <<"] = {";
01644    for (Int_t ci=0; ci<GetNumberOfColors()-1; ++ci) {
01645       if (ci % 10 == 9)
01646          out<<endl<<"                             ";
01647       out<<GetColorPalette(ci)<<", ";
01648    }
01649    out<<GetColorPalette(GetNumberOfColors() - 1)                <<"};"<<endl;
01650    out<<"   "<<"tmpStyle->SetPalette("        << GetNumberOfColors()
01651                                             << ", fPaletteColor);" << endl;
01652    out<<endl;
01653 
01654    // fLineStyle
01655    out<<"   "<<"TString fLineStyleArrayTmp[30] = {";
01656    for (Int_t li=0; li<29; ++li) {
01657       if (li % 5 == 4)
01658          out<<endl<<"                             ";
01659       out<<quote << fLineStyle[li].Data() << quote << ", ";
01660    }
01661    out<<quote<<fLineStyle[29].Data()<<quote<<"};"<<endl;
01662    out<<"   "<<"for (Int_t i=0; i<30; i++)"<<endl;
01663    out<<"   "<<"   tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]);"<<endl;
01664    out<<endl;
01665 
01666    out<<"   "<<"tmpStyle->SetHeaderPS("       <<quote<<GetHeaderPS()
01667                                             <<quote                  <<");"<<endl;
01668    out<<"   "<<"tmpStyle->SetTitlePS("        <<quote<<GetTitlePS()
01669                                             <<quote                  <<");"<<endl;
01670    out<<"   "<<"tmpStyle->SetFitFormat("      <<quote<<GetFitFormat()
01671                                             <<quote                  <<");"<<endl;
01672    out<<"   "<<"tmpStyle->SetPaintTextFormat("<<quote<<GetPaintTextFormat()
01673                                             <<quote                  <<");"<<endl;
01674    out<<"   "<<"tmpStyle->SetLineScalePS("    <<GetLineScalePS()       <<");"<<endl;
01675    out<<"   "<<"tmpStyle->SetColorModelPS("   <<GetColorModelPS()      <<");"<<endl;
01676    out<<"   "<<Form("tmpStyle->SetTimeOffset(%9.0f);", GetTimeOffset()) <<endl;
01677    out<<endl;
01678 
01679    // Inheritance :
01680    // TAttLine :
01681    out <<"   " <<"tmpStyle->SetLineColor(" <<GetLineColor() <<");" <<endl;
01682    out <<"   " <<"tmpStyle->SetLineStyle(" <<GetLineStyle() <<");" <<endl;
01683    out <<"   " <<"tmpStyle->SetLineWidth(" <<GetLineWidth() <<");" <<endl;
01684 
01685    // TAttFill
01686    out <<"   " <<"tmpStyle->SetFillColor(" <<GetFillColor() <<");" <<endl;
01687    out <<"   " <<"tmpStyle->SetFillStyle(" <<GetFillStyle() <<");" <<endl;
01688 
01689    // TAttMarker
01690    out <<"   " <<"tmpStyle->SetMarkerColor(" <<GetMarkerColor() <<");" <<endl;
01691    out <<"   " <<"tmpStyle->SetMarkerSize("  <<GetMarkerSize() <<");" <<endl;
01692    out <<"   " <<"tmpStyle->SetMarkerStyle(" <<GetMarkerStyle() <<");" <<endl;
01693 
01694    // TAttText
01695    out <<"   " <<"tmpStyle->SetTextAlign(" <<GetTextAlign() <<");" <<endl;
01696    out <<"   " <<"tmpStyle->SetTextAngle(" <<GetTextAngle() <<");" <<endl;
01697    out <<"   " <<"tmpStyle->SetTextColor(" <<GetTextColor() <<");" <<endl;
01698    out <<"   " <<"tmpStyle->SetTextFont("  <<GetTextFont()  <<");" <<endl;
01699    out <<"   " <<"tmpStyle->SetTextSize("  <<GetTextSize()  <<");" <<endl;
01700 }

Generated on Tue Jul 5 14:11:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1