Hello
I am verry new with root and I spend a lot of time by try to solve this proplem. Without success:
I want to use a style with is called ATLASstyle. I load it every time when I start root by using the rootlogon.C file.
rootlogon.C:
void rootlogon()
{
gROOT->LoadMacro(“AtlasStyle.C”);
AtlasStyle();
}
I am producing my root files with a C++ compiler and not interactivity.
The problem is, that it is not possible to draw histograms in different colours. The command Hist->SetLineColor(x) in my C++ code has no effect. Every line of every histogram is still black when I star root an an TBrowser to view my histograms.
Can anybody help me with that?
Thanks a lot
Florian Kleine-Limberg
Here the code from my AtlasStyle.C file:
//
// ATLAS Style, based on a style file from BaBar
//
void AtlasStyle() {
std::cout << “\nApplying Florians style settings…\n” << std::endl ;
TGaxis::SetMaxDigits(3);
TStyle *atlasStyle = new TStyle(“ATLAS”,“Atlas style”);
// gROOT->SetStyle(“Plain”);
atlasStyle->SetPalette(1);
atlasStyle->SetOptFit(1);
atlasStyle->SetOptStat(0);
// use plain black on white colors
Int_t icol = 0; // WHITE
atlasStyle->SetFrameBorderMode(icol);
atlasStyle->SetFrameFillColor(icol);
atlasStyle->SetCanvasBorderMode(icol);
atlasStyle->SetCanvasColor(icol);
atlasStyle->SetPadBorderMode(icol);
atlasStyle->SetPadColor(icol);
atlasStyle->SetStatColor(icol);
//atlasStyle->SetFillColor(icol);
// set the paper & margin sizes
// atlasStyle->SetPaperSize(20,26);
// atlasStyle->SetPadTopMargin(0.05);
// atlasStyle->SetPadRightMargin(0.05);
// atlasStyle->SetPadBottomMargin(0.16);
// atlasStyle->SetPadLeftMargin(0.16);
// use large fonts
//Int_t font=72; // Helvetica italics
Int_t font = 42; // Helvetica
Double_t tsize = 0.03;
atlasStyle->SetTextFont(font);
atlasStyle->SetTextSize(tsize);
atlasStyle->SetLabelFont(font,“x”);
atlasStyle->SetTitleFont(font,“x”);
atlasStyle->SetLabelFont(font,“y”);
atlasStyle->SetTitleFont(font,“y”);
atlasStyle->SetLabelFont(font,“z”);
atlasStyle->SetTitleFont(font,“z”);
atlasStyle->SetLabelSize(tsize,“x”);
atlasStyle->SetTitleSize(tsize,“x”);
atlasStyle->SetLabelSize(tsize,“y”);
atlasStyle->SetTitleSize(tsize,“y”);
atlasStyle->SetLabelSize(tsize,“z”);
atlasStyle->SetTitleSize(tsize,“z”);
// use bold lines and markers
/* atlasStyle->SetMarkerStyle(20);
atlasStyle->SetMarkerSize(1.2);
atlasStyle->SetHistLineWidth(2.);
atlasStyle->SetLineStyleString(2,"[12 12]");*/ // postscript dashes
// get rid of X error bars and y error bar caps
//atlasStyle->SetErrorX(0.001);
// do not display any of the standard histogram decorations
atlasStyle->SetOptTitle(0);
//atlasStyle->SetOptStat(1111);
atlasStyle->SetOptStat(0);
//atlasStyle->SetOptFit(1111);
// atlasStyle->SetOptFit(0);
// put tick marks on top and RHS of plots
// atlasStyle->SetPadTickX(1);
// atlasStyle->SetPadTickY(1);
// reset plain style
gROOT->SetStyle("ATLAS");
gROOT->ForceStyle();
}