void hggPaperStyle() { // Hgg Paper style for plots TStyle *hggStyle = new TStyle("hggStyle","Hgg Paper Style"); //hggStyle->SetCanvasColor(0); //hggStyle->SetPadColor(0); hggStyle->SetPadTickX(0); hggStyle->SetPadTickY(0); hggStyle->SetFrameFillColor(0); hggStyle->SetStatColor(0); hggStyle->SetOptStat(0); hggStyle->SetTitleFillColor(0); hggStyle->SetCanvasBorderMode(0); hggStyle->SetPadBorderMode(0); hggStyle->SetFrameBorderMode(0); hggStyle->SetFrameBorderSize(1); hggStyle->SetPadColor(kWhite); hggStyle->SetCanvasColor(kWhite); hggStyle->SetCanvasDefH(600); //Height of canvas hggStyle->SetCanvasDefW(800); //Width of canvas hggStyle->SetCanvasDefX(0); //POsition on screen hggStyle->SetCanvasDefY(0); hggStyle->SetPadLeftMargin(0.16);//0.16); hggStyle->SetPadRightMargin(0.1);//0.02); hggStyle->SetPadTopMargin(0.085);//0.02); hggStyle->SetPadBottomMargin(0.12);//0.02); // For hgg axis titles: hggStyle->SetTitleColor(1, "XYZ"); hggStyle->SetTitleFont(42, "XYZ"); hggStyle->SetTitleSize(0.05, "XYZ"); hggStyle->SetTitleYOffset(1.5); // => 1.15 if exponents hggStyle->SetTitleXOffset(1.);//0.9); // For hgg axis labels: hggStyle->SetLabelColor(1, "XYZ"); hggStyle->SetLabelFont(42, "XYZ"); hggStyle->SetLabelOffset(0.007, "XYZ"); hggStyle->SetLabelSize(0.045, "XYZ"); // Legends hggStyle->SetLegendBorderSize(0); hggStyle->SetLegendFillColor(kWhite); hggStyle->SetLegendFont(42); hggStyle->SetFillColor(10); // Nothing for now hggStyle->SetTextFont(42); hggStyle->SetTextSize(0.03); hggStyle->SetOptTitle(0); hggStyle->SetOptStat(0); hggStyle->cd(); }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); //tdrStyle->SetPalette(8); tdrStyle->SetPalette(1); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); //tdrStyle->SetCanvasDefH(600); //Height of canvas //tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); //tdrStyle->SetPadGridX(false); //tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: // tdrStyle->SetHistFillColor(1); // tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); // tdrStyle->SetLegoInnerR(Float_t rad = 0.5); // tdrStyle->SetNumberContours(Int_t number = 20); tdrStyle->SetEndErrorSize(2); //tdrStyle->SetErrorMarker(20); //tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: //tdrStyle->SetOptFit(0010); // display fit parameters values only tdrStyle->SetOptFit(0000); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(2); // for the legends tdrStyle->SetLegendBorderSize(0); tdrStyle->SetLegendFillColor(0); tdrStyle->SetLegendFont(42); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(0); // tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // tdrStyle->SetStatStyle(Style_t style = 1001); // tdrStyle->SetStatX(Float_t x = 0); // tdrStyle->SetStatY(Float_t y = 0); // Margins: tdrStyle->SetPadTopMargin(0.06); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.05); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // tdrStyle->SetTitleH(0); // Set the height of the title box // tdrStyle->SetTitleW(0); // Set the width of the title box // tdrStyle->SetTitleX(0); // Set the position of the title box // tdrStyle->SetTitleY(0.985); // Set the position of the title box // tdrStyle->SetTitleStyle(Style_t style = 1001); // tdrStyle->SetTitleBorderSize(2); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.25); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); // tdrStyle->SetLineScalePS(Float_t scale = 3); // tdrStyle->SetLineStyleString(Int_t i, const char* text); // tdrStyle->SetHeaderPS(const char* header); // tdrStyle->SetTitlePS(const char* pstitle); // tdrStyle->SetBarOffset(Float_t baroff = 0.5); // tdrStyle->SetBarWidth(Float_t barwidth = 0.5); // tdrStyle->SetPaintTextFormat(const char* format = "g"); // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // tdrStyle->SetTimeOffset(Double_t toffset); // tdrStyle->SetHistMinimumZero(kTRUE); tdrStyle->cd(); }
void Style_Toby_2() { // Add the saved style to the current ROOT session. delete gROOT->GetStyle("Toby_2"); TStyle *tmpStyle = new TStyle("Toby_2", "Style for posters and talks"); tmpStyle->SetNdivisions(510, "x"); tmpStyle->SetNdivisions(510, "y"); tmpStyle->SetNdivisions(510, "z"); tmpStyle->SetAxisColor(1, "x"); tmpStyle->SetAxisColor(1, "y"); tmpStyle->SetAxisColor(1, "z"); tmpStyle->SetLabelColor(1, "x"); tmpStyle->SetLabelColor(1, "y"); tmpStyle->SetLabelColor(1, "z"); tmpStyle->SetLabelFont(42, "x"); tmpStyle->SetLabelFont(42, "y"); tmpStyle->SetLabelFont(42, "z"); tmpStyle->SetLabelOffset(0.005, "x"); tmpStyle->SetLabelOffset(0.005, "y"); tmpStyle->SetLabelOffset(0.005, "z"); tmpStyle->SetLabelSize(0.035, "x"); tmpStyle->SetLabelSize(0.035, "y"); tmpStyle->SetLabelSize(0.035, "z"); tmpStyle->SetTickLength(0.03, "x"); tmpStyle->SetTickLength(0.03, "y"); tmpStyle->SetTickLength(0.03, "z"); tmpStyle->SetTitleOffset(1, "x"); tmpStyle->SetTitleOffset(1, "y"); tmpStyle->SetTitleOffset(1, "z"); tmpStyle->SetTitleSize(0.035, "x"); tmpStyle->SetTitleSize(0.035, "y"); tmpStyle->SetTitleSize(0.035, "z"); tmpStyle->SetTitleColor(1, "x"); tmpStyle->SetTitleColor(1, "y"); tmpStyle->SetTitleColor(1, "z"); tmpStyle->SetTitleFont(42, "x"); tmpStyle->SetTitleFont(42, "y"); tmpStyle->SetTitleFont(42, "z"); tmpStyle->SetBarWidth(1); tmpStyle->SetBarOffset(0); tmpStyle->SetDrawBorder(0); tmpStyle->SetOptLogx(0); tmpStyle->SetOptLogy(0); tmpStyle->SetOptLogz(0); tmpStyle->SetOptDate(0); tmpStyle->SetOptStat(111); tmpStyle->SetOptTitle(kTRUE); tmpStyle->SetOptFit(0); tmpStyle->SetNumberContours(20); tmpStyle->GetAttDate()->SetTextFont(62); tmpStyle->GetAttDate()->SetTextSize(0.025); tmpStyle->GetAttDate()->SetTextAngle(0); tmpStyle->GetAttDate()->SetTextAlign(11); tmpStyle->GetAttDate()->SetTextColor(1); tmpStyle->SetDateX(0.01); tmpStyle->SetDateY(0.01); tmpStyle->SetEndErrorSize(2); tmpStyle->SetErrorX(0.5); tmpStyle->SetFuncColor(2); tmpStyle->SetFuncStyle(1); tmpStyle->SetFuncWidth(2); tmpStyle->SetGridColor(0); tmpStyle->SetGridStyle(3); tmpStyle->SetGridWidth(1); tmpStyle->SetLegendBorderSize(1); tmpStyle->SetLegendFillColor(0); tmpStyle->SetLegendFont(42); tmpStyle->SetHatchesLineWidth(1); tmpStyle->SetHatchesSpacing(1); tmpStyle->SetFrameFillColor(0); tmpStyle->SetFrameLineColor(1); tmpStyle->SetFrameFillStyle(1001); tmpStyle->SetFrameLineStyle(1); tmpStyle->SetFrameLineWidth(1); tmpStyle->SetFrameBorderSize(1); tmpStyle->SetFrameBorderMode(0); tmpStyle->SetHistFillColor(0); tmpStyle->SetHistLineColor(602); tmpStyle->SetHistFillStyle(1001); tmpStyle->SetHistLineStyle(1); tmpStyle->SetHistLineWidth(1); tmpStyle->SetHistMinimumZero(kFALSE); tmpStyle->SetCanvasPreferGL(kFALSE); tmpStyle->SetCanvasColor(0); tmpStyle->SetCanvasBorderSize(2); tmpStyle->SetCanvasBorderMode(0); tmpStyle->SetCanvasDefH(500); tmpStyle->SetCanvasDefW(700); tmpStyle->SetCanvasDefX(10); tmpStyle->SetCanvasDefY(10); tmpStyle->SetPadColor(0); tmpStyle->SetPadBorderSize(2); tmpStyle->SetPadBorderMode(0); tmpStyle->SetPadBottomMargin(0.1); tmpStyle->SetPadTopMargin(0.1); tmpStyle->SetPadLeftMargin(0.1); tmpStyle->SetPadRightMargin(0.1); tmpStyle->SetPadGridX(kFALSE); tmpStyle->SetPadGridY(kFALSE); tmpStyle->SetPadTickX(0); tmpStyle->SetPadTickY(0); tmpStyle->SetPaperSize(20, 26); tmpStyle->SetScreenFactor(1); tmpStyle->SetStatColor(0); tmpStyle->SetStatTextColor(1); tmpStyle->SetStatBorderSize(1); tmpStyle->SetStatFont(42); tmpStyle->SetStatFontSize(0); tmpStyle->SetStatStyle(1001); tmpStyle->SetStatFormat("6.4g"); tmpStyle->SetStatX(0.9); tmpStyle->SetStatY(0.97); tmpStyle->SetStatW(0.15); tmpStyle->SetStatH(0.16); tmpStyle->SetStripDecimals(kTRUE); tmpStyle->SetTitleAlign(23); tmpStyle->SetTitleFillColor(0); tmpStyle->SetTitleTextColor(1); tmpStyle->SetTitleBorderSize(0); tmpStyle->SetTitleFont(42); tmpStyle->SetTitleFontSize(0.05); tmpStyle->SetTitleStyle(0); tmpStyle->SetTitleX(0.5); tmpStyle->SetTitleY(0.995); tmpStyle->SetTitleW(0); tmpStyle->SetTitleH(0); tmpStyle->SetLegoInnerR(0.5); Int_t fPaletteColor[50] = {51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}; tmpStyle->SetPalette(50, fPaletteColor); TString fLineStyleArrayTmp[30] = {"", " ", " 12 12", " 4 8", " 12 16 4 16", " 20 12 4 12", " 20 12 4 12 4 12 4 12", " 20 20", " 20 12 4 12 4 12", " 80 20", " 80 40 4 40", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; for (Int_t i=0; i<30; i++) tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]); tmpStyle->SetHeaderPS(""); tmpStyle->SetTitlePS(""); tmpStyle->SetFitFormat("5.4g"); tmpStyle->SetPaintTextFormat("g"); tmpStyle->SetLineScalePS(3); tmpStyle->SetColorModelPS(0); tmpStyle->SetTimeOffset(788918400); tmpStyle->SetLineColor(1); tmpStyle->SetLineStyle(1); tmpStyle->SetLineWidth(1); tmpStyle->SetFillColor(19); tmpStyle->SetFillStyle(1001); tmpStyle->SetMarkerColor(1); tmpStyle->SetMarkerSize(1); tmpStyle->SetMarkerStyle(1); tmpStyle->SetTextAlign(11); tmpStyle->SetTextAngle(0); tmpStyle->SetTextColor(1); tmpStyle->SetTextFont(62); tmpStyle->SetTextSize(0.05); }
TStyle* sPhenixStyle() { TStyle *sphenixStyle = new TStyle("sPHENIX","sPHENIX style"); // use plain black on white colors Int_t icol=0; // WHITE sphenixStyle->SetFrameBorderMode(icol); sphenixStyle->SetFrameFillColor(icol); sphenixStyle->SetCanvasBorderMode(icol); sphenixStyle->SetCanvasColor(icol); sphenixStyle->SetPadBorderMode(icol); sphenixStyle->SetPadColor(icol); sphenixStyle->SetStatColor(icol); //sphenixStyle->SetFillColor(icol); // don't use: white fill color for *all* objects // set the paper & margin sizes sphenixStyle->SetPaperSize(20,26); // set margin sizes sphenixStyle->SetPadTopMargin(0.05); sphenixStyle->SetPadRightMargin(0.05); sphenixStyle->SetPadBottomMargin(0.16); sphenixStyle->SetPadLeftMargin(0.16); // set title offsets (for axis label) sphenixStyle->SetTitleXOffset(1.4); sphenixStyle->SetTitleYOffset(1.4); // use large fonts //Int_t font=72; // Helvetica italics Int_t font=42; // Helvetica Double_t tsize=0.05; sphenixStyle->SetTextFont(font); sphenixStyle->SetTextSize(tsize); sphenixStyle->SetLabelFont(font,"x"); sphenixStyle->SetTitleFont(font,"x"); sphenixStyle->SetLabelFont(font,"y"); sphenixStyle->SetTitleFont(font,"y"); sphenixStyle->SetLabelFont(font,"z"); sphenixStyle->SetTitleFont(font,"z"); sphenixStyle->SetLabelSize(tsize,"x"); sphenixStyle->SetTitleSize(tsize,"x"); sphenixStyle->SetLabelSize(tsize,"y"); sphenixStyle->SetTitleSize(tsize,"y"); sphenixStyle->SetLabelSize(tsize,"z"); sphenixStyle->SetTitleSize(tsize,"z"); // use bold lines and markers sphenixStyle->SetMarkerStyle(20); sphenixStyle->SetMarkerSize(1.2); sphenixStyle->SetHistLineWidth(2.); sphenixStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes // get rid of X error bars //sphenixStyle->SetErrorX(0.001); // get rid of error bar caps sphenixStyle->SetEndErrorSize(0.); // do not display any of the standard histogram decorations sphenixStyle->SetOptTitle(0); //sphenixStyle->SetOptStat(1111); sphenixStyle->SetOptStat(0); //sphenixStyle->SetOptFit(1111); sphenixStyle->SetOptFit(0); // put tick marks on top and RHS of plots sphenixStyle->SetPadTickX(1); sphenixStyle->SetPadTickY(1); // legend modificatin sphenixStyle->SetLegendBorderSize(0); sphenixStyle->SetLegendFillColor(0); sphenixStyle->SetLegendFont(font); #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0) std::cout << "sPhenixStyle: ROOT6 mode" << std::endl; sphenixStyle->SetLegendTextSize(tsize); sphenixStyle->SetPalette(kBird); #else std::cout << "sPhenixStyle: ROOT5 mode" << std::endl; // color palette - manually define 'kBird' palette only available in ROOT 6 Int_t alpha = 0; Double_t stops[9] = { 0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000}; Double_t red[9] = { 0.2082, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764}; Double_t green[9] = { 0.1664, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832}; Double_t blue[9] = { 0.5293, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539}; TColor::CreateGradientColorTable(9, stops, red, green, blue, 255, alpha); #endif sphenixStyle->SetNumberContours(80); return sphenixStyle; }