Make color of TLegend white not grey

Hello, I use gROOT->SetStyle(“Plain”) to get the backgrounds of my plots white in stead of grey but the TLegend is still grey. How can I make that white too? I tried a number of things (googling), for example gStyle->SetCanvasColor(10); but this does not help either :frowning:

Many thanks in advance,

Ytsen.

I cannot reproduce your problem.
Are you calling gROOT->SetStyle(“Plain”) after having drawn the canvas?
If yes, call

mycanvas.UseCurrentStyle();
Rene

Try this:

{
gROOT->SetStyle("Plain");
h1 = new TH1F("h1","",100,-5,5);
h1->FillRandom("gaus",1000);
h1->Draw();
gPad->BuildLegend()->SetFillColor(10);
// TLegend *leg = (TLegend*)gPad->BuildLegend();
// leg->SetFillColor(10);
// gPad->Modified();
}

Jan

No, at the very beginning I have:

gROOT->SetStyle(“Plain”);

Then further on:

TCanvas lumiCanvL7(“lumiCanvL7”,“H1 luminosity; last 7 days.”, 1,1, 1200,1200);
gStyle->SetTitleBorderSize(0);
gStyle->SetCanvasColor(10); // This does not seem to work neither :frowning:
gPad->SetBorderMode(0);

axL7.Draw();
RawLumiGraph.Draw(“B”);
CorLumiGraph.Draw(“B”);
leg.Draw();
lumiCanvL7.Write("",TObject::kOverwrite);
lumiCanvL7.Print(“lumiL7.eps”);

And see the output (where all is white except the TLegend) attached (or see: desy.de/~ytsen/lumiWatcher/debug/lumiL7.eps)

Hello Musinsky,

This BuildLegend option does not work for me, maybe my root version is too old 4.00.08. Thanks anyway,

Ytsen.

Sorry, I confused the legend and the stats box.
Do:

gROOT->SetStyle("Plain"); gStyle->SetFillColor(10);
Rene

YES! That’s it, thanks!