UseCurrentStyle() different effects in script and console

Dear all,

I have encountered the problem, that there is a difference between the use of the UseCurrentStyle() command in a script and the root session:

I am setting the style to “Plain” and draw a histogram (see code below). This creates a read
“shadow” on the right and lower margin of the histogram. When I type myCanvas->UseCurrentStyle() in the root session, the shadow disappears. This command does not help, if I use it in a script. Since I need a few hundred frames for a movie, removing it by hand is not an option.

Code creating error:

{
gROOT->SetStyle(“Plain”);
gStyle->SetOptStat(kFALSE);
EFELD=new TH2D(“EFLED”,"",1001,-1.1,1.1,1001,-1.1,1.1);
EFELD->SetXTitle(“X”);
EFELD->SetYTitle(“Y”);
EFELD->GetXaxis()->CenterTitle();
EFELD->GetYaxis()->CenterTitle();
EFELD->GetYaxis()->SetTitleOffset(1.5);
EFELD->GetXaxis()->SetLabelOffset(0.015);
EFELD->Reset("");
EFELD->Draw();
//myCanvas->UseCurrentStyle(); // to see effect (or better: no effect), remove first //
}

The code is saved in E.c and executed using .x E.c in the Root-Session.

I have tried to use gPad->SetFillColor(kWhite); instead to create a white background, but this does not help.

Has anyone a solution to get rid of the read shadow using a script?

Best regards
Maciek

System in Use: Root Version 5.24, Phenom II X4 920, Windows XP Profesional Service Pack 3

I think you are looking for:

   gStyle->SetFrameBorderMode(0);

Sorry, this is not working, neither in the console nor in the script.
Have you been able to reproduce the error?

I set it in my rootlogon.C and when i save an image in a PS file I get not border (shade). My rootlogon.C is:

{
   gStyle->SetCanvasColor(0);
   gStyle->SetFrameBorderMode(0);
   gStyle->SetStatBorderSize(1);
   gStyle->SetFrameFillColor(0);
   gStyle->SetTitleFillColor(0);
   gROOT->ForceStyle();
}

After including your gStyle - commands in my rootlogon.c the problem was solved.

Thank you.
Maciek