Changing the legend box size at 2 graphs in one TCanvas

Hi,

I have a question about TLegend() command of ROOT.
I created 2 or more graphs in one canvas, so

TCanvas *c1 = new TCanvas(“c1”, “My Canvas”, 10, 10, 400, 400);

c1->Divide(2,1);
c1->cd(1);

c1->cd(2);

When I draw the legend, the size is same as cd(1) and cd(2) by using for loop.

for(Int_t i = 0; i < 2; i++)
{
leg[i] = new TLegend( 0.7, 0.65, 0.95, 0.84 );
leg[i] = SetTextSize( 0.08 );


}

How can I change the box size and keep the same text size in the for loop?
Acutually, I am drawing 6 graphs in one canvas, so I’d better use for loop
(i = 0; i < 6; i++).

Thank you!

A small example

Rene

{ TCanvas *c1 = new TCanvas("c1", "My Canvas", 10, 10, 400, 400); TLegend *leg1 = new TLegend( 0.7, 0.65, 0.95, 0.84 ); leg1->SetTextFont(53); //font precision 3 implies size given in pixels leg1->SetTextSize(16); //text size in pixels TLegend *leg2 = new TLegend( 0.2, 0.45, 0.45, 0.84 ); leg2->SetTextFont(53); leg2->SetTextSize(16); //text size in pixels for (Int_t i=0;i<6;i++) { char *name = Form("histo%d",i); TH1F *h = new TH1F(name,name,100,-3,3); h->FillRandom("gaus",1000-100*i); h->SetLineColor(i+1); h->Draw("same"); if (i<3) leg1->AddEntry(h,"","l"); else leg2->AddEntry(h,"","l"); } leg1->Draw(); leg2->Draw(); }